Skip to content

tes/mr-doc

 
 

Repository files navigation

mr-doc Deps Version Version

mr-doc is a total refactoring of dox-foundation written in ES6, tranformed to ES5 with Babel, and is based on dox. It can automatically generate beautiful documentations and can further spice up your documentations using themes.

By default, mr-doc uses mr-doc-theme-default which uses Twitter Bootstrap for the frontend framework and Prism.js for syntax highlighting.

Docs

The beautifully documentation can be found at GitHub.

Installation

# Install the module globally
$ npm i -g mr-doc

Usage

JavaScript JavaDoc style

/**
 * Create an array of all the right files in the source dir
 * @param      {String}   source path
 * @param      {Object}   options
 * @param      {Function} callback
 * @jsFiddle   A jsFiddle embed URL
 * @return     {Array} an array of string path
 */
function collectFiles(source, options, callback) {
  ...
}

CoffeeScript JavaDoc style

###*
 * Create an array of all the right files in the source dir
 * @param      {String}   source path
 * @param      {Object}   options
 * @param      {Function} callback
 * @jsFiddle   A jsFiddle embed URL
 * @return     {Array} an array of string path
###
collectFiles = (source, options, callback) ->
  ...

Notes

  • mr-doc supports the following variations of @return and @jsFiddle:
    • @return, @returns
    • @jsfiddle, @jsFiddle, @JSFiddle

CLI

$ mr-doc --help

  Usage: mr-doc [options]

  Commands:
    cache                         Manages the mr-doc cache. The available commands are clean and remove.

  Options:

    -h, --help                    Outputs usage information.
    -V, --version                 Outputs the version number.
    -r, --raw                     Outputs "raw" comments, leaving the markdown intact.
    -d, --debug                   Outputs parsed comments for debugging.
    -t, --title <string>          The title for the page produced.
    -s, --source <source>         The folder which should get parsed.
    -i, --ignore <directories>    Comma seperated list of directories to ignore. Default: test, public, static, view, views, templates.
    -T, --target <target>         The folder which will contain the results. Default: <CWD>/docs
    -e, --extension <extension>   Target files extension. Default: html
    -j, --template <template>     The Jade template file to use.
    -b, --theme <theme>           The name of the theme. e.g. mr-doc-theme-cayman or cayman.
  Examples:

    # parse a whole folder
    $ mr-doc --source lib --target docs

    # parse a whole folder and use a specific template
    $ mr-doc --template ./view/myowntpl.jade --source lib --target docs

Themes

Usage

With the release of 2.1.0, you are able to use different themes to spice up your documentations. To use a specific theme, simply use the --theme option followed by the name of the theme:

$ mr-doc --source lib --target docs --theme cayman
# or
$ mr-doc --source lib --target docs --theme mr-doc-theme-cayman

Installing Themes

Themes are just npm modules that can be installed in your application, there is a default theme included with mr-doc.

Current available themes:

To install into your project to use as part of the build step, simply:

npm install mr-doc-theme-cayman --save-dev

Notes

  • The prefix mr-doc-theme- is not necessary except when publishing your own themes.
  • While it is still possible to use templates, I would advise you to use themes instead.

Creating Themes

If you would like to create your own themes, see mr-doc-theme-starter-kit.

Related

  • grunt-doxx - mr-doc grunt plugin automatically generates the documentation for your project.
  • gulp-doxx - mr-doc documentation generator for gulp.

Roadmap

3.0.0

  • Switch the backend from bower to npm for themes. #79
  • Re-introduce mr-doc with a new name. #83

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using gulp and mocha.

Updating Docs

To update the docs on the gh-pages branch:

gulp docs
git checkout gh-pages
git push origin gh-pages

Changelog

The changes can be viewed here.

Donate

License

MIT License

Copyright (c) 2013 Francois-Guillaume Ribreau

About

Generic, template based, HTML output for Dox documentation generator

http://mr-doc.github.io/mr-doc/

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 99.5%
  • Other 0.5%