Mr. Doc Theme Install (Async)

by iwatakeshi

Babel + JSX

/** ES5 */

var Theme = require('mr-doc/src/theme');

/** ES6 */

import Theme from 'mr-doc/lib/theme';


/*Example options*/
var options = {
    theme: {
        // Name of theme to install
        name: 'mr-doc-theme-cayman'
    },
    template: {
        name: 'name of the package or of your choice',
        // Use only if a theme 
        // is not going to be installed
        path: undefined,
        // Let's Theme know that a template is used
        isEnabled: function(){/* Returns a Boolean */},
        // Let's Theme know that the template
        // is a starter kit
        isKit: function(){/* Returns a Boolean */}
    },
    output: {
        path: '...wherever the docs will be installed'
    }
};

// Install the theme
(new Theme(options)).install().then(function (result) {
    /**
    	Result will return an object that contains:
       	theme (where theme is the name of the theme)
       	isCached (where isCached is the truth value on
       	whether the cache exists)
    */
});