Code Monkey home page Code Monkey logo

markdox's Introduction

Markdox Build Status

Markdox is a documentation generator based on Dox and Markdown with support for JavaScript, CoffeeScript and IcedCoffeeScript.

It can be used from the command markdox or in NodeJS with var markdox = require('markdox').

Examples can be found under examples/ directory.

Installation

$ npm install -g markdox

Usage

$ markdox myfile.js
# or
$ markdox myfile1.js myfile2.js

or programmatically

markdox.process(files, 'output.md', function(){
  console.log('Documentation generated');
});

or with the gulp plugin

Quick Start

$ markdox test/fixtures/a.js test/fixtures/b.js

Here is the list of supported tags:

  • @author author name [email protected]
  • @version 0.0.1
  • @deprecated
  • @param {type} name Message
  • @return {type} Message
  • @throws {type} Message
  • @see something
  • @name name
  • @method name
  • @class name
  • @function name

Javascript comments should be like this:

/**
 * Escape the given `html`.
 *
 * ### Examples:
 *
 *     utils.escape('<script></script>')
 *     // => '&lt;script&gt;&lt;/script&gt;'
 *
 * @param {String} html string to be escaped
 * @return {String} escaped html
 * @api public
 */

CoffeeScript and IcedCoffeeScript comments:

###*
 * Escape the given `html`.
 *
 * h3 Examples:
 *
 *     utils.escape('<script></script>')
 *     // => '&lt;script&gt;&lt;/script&gt;'
 *
 * @param {String} html string to be escaped
 * @return {String} escaped html
 * @api public
###

Notice that the Markdown titles ##, #### (and the next titles too) inside a Coffeescript comment won't work, because ### is the multiline comment. But it works for Javascript.

In replacement to #, ### (until ######) it is possible to write h1, h2 (until h6), there will be replaced by #, ### ...

More examples can be found in examples/fixtures/ and the results are in examples/docs.

Advanced Usage

Template, Formater and Compiler of Markdox can be overriden.

Nevertheless default formatter, template and compiler are available under markdox.defaultFormatter, markdox.defaultCompiler, markdox.defaultTemplate.

var markdox = require('markdox');

var options = {
  output: 'output.md'
  , formatter: function(docfile){return docfile;}
  , compiler: function(filepath, data){
    return myCustomCompiler(data);
  }
  , template: 'output.ejs'
};

markdox.process(fixtures, options, function(){
  console.log('File `all.md` generated with success');
});

Documentation

Documentation is here and can be generate with:

$ npm run-script documentation

License

(The MIT License)

Copyright (c) 2012 Charles Bourasseau [email protected]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

markdox's People

Contributors

cbou avatar geraintwhite avatar ionicabizau avatar maxgalbu avatar mischkew avatar gberger avatar jtuulos avatar fenomas avatar rubenstolk avatar ouhouhsami avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.