bevis-doc-builder

bevis-doc-builder =================

npm install bevis-doc-builder
7 downloads in the last week
25 downloads in the last month

bevis-doc-builder

BEViS Doc building utils.

Building a single-page documentation:

config.node('pages/help', function(nodeConfig) {
    nodeConfig.addTechs([
        // Project Levels
        [require('enb/techs/levels'), {levels: getLevels()}],

        // BEViS Doc Builder: BTJSON
        require('bevis-doc-builder/techs/struct-from-block-info'),
        require('bevis-doc-builder/techs/single-btjson-from-block-info'),

        // BTJSON -> BEMDECL
        require('enb/techs/bemdecl-from-bemjson'),

        // BEMDECL -> DEPS
        require('enb-modules/techs/deps-with-modules'),

        // DEPS -> FILES
        require('enb/techs/files'),

        // FILES -> BT
        require('enb-bt/techs/bt-server'),
        [require('enb-bt/techs/bt-client-module'), {dependencies: {i18n: 'y-i18n'}}],

        // FILES -> I18N
        [require('enb/techs/i18n-merge-keysets'), {lang: 'all' }],
        [require('enb/techs/i18n-merge-keysets'), {lang: '{lang}'}],
        [require('./techs/y-i18n-lang-js'), {lang: 'all'}],
        [require('./techs/y-i18n-lang-js'), {lang: '{lang}'}],

        // BTJSON + BT + I18N -> HTML
        [
            require('enb/techs/html-from-bemjson-i18n'),
            {
                lang: '{lang}',
                target: '?.{lang}.html',
                bemhtmlTarget: '?.bt.js'
            }
        ],

        // FILES -> SRC-JS        
        [require('enb/techs/js'), {target: '?.source.js'}],

        // SRC-JS + BT + I18N -> PRE-JS
        [
            require('enb/techs/file-merge'),
            {
                sources: [
                    '?.source.js',
                    '?.bt.client.js',
                    '?.lang.all.js',
                    '?.lang.ru.js'
                ],
                target: '?.pre.js'
            }
        ],

        // PRE-JS + Modules -> JS
        [require('enb-modules/techs/prepend-modules'), {source: '?.pre.js', target: '?.js'}]

        // FILES -> CSS
        [require('enb/techs/css-stylus-with-nib')],
        [require('enb/techs/css-stylus-with-nib'), {
            target: '?.ie.css',
            variables: {
                ie: 9
            }
        }]
    ]);
    nodeConfig.mode('development', function(nodeConfig) {
        nodeConfig.addTechs([
            [require('enb/techs/file-copy'), {sourceTarget: '?.js', destTarget: '_?.js'}],
            [require('enb/techs/file-copy'), {sourceTarget: '?.css', destTarget: '_?.css'}],
            [require('enb/techs/file-copy'), {sourceTarget: '?.ie.css', destTarget: '_?.ie.css'}]
        ]);
    });
    nodeConfig.mode('production', function(nodeConfig) {
        nodeConfig.addTechs([
            [require('enb/techs/borschik'), {sourceTarget: '?.js', destTarget: '_?.js'}],
            [require('enb/techs/borschik'), {sourceTarget: '?.css', destTarget: '_?.css', freeze: 'yes'}],
            [require('enb/techs/borschik'), {sourceTarget: '?.ie.css', destTarget: '_?.ie.css', freeze: 'yes'}]
        ]);
    });

    nodeConfig.addTargets([
        '?.{lang}.html',
        '_?.js',
        '_?.css',
        '_?.ie.css'
    ]);
});
npm loves you