Jade-doc is a Jade documentation generator. It takes Jade files as input, looks for comments flagged with @jadedoc
and puts its contents in an output JSON file.
This package does not provide a styled interface for the documentation itself. Use jade-doc-html or jade-doc-markdown for human readable docs. Optionally use jade-doc-faucet for prettier terminal reporting.
Use the keyword @jadedoc
to flag unbuffered block comments inside your jade files. Comments should be written in properly formatted YAML format.
//- @jadedoc
name: My JadeDoc
description: this is a description for my jade doc
beep: boop
foo: bar
The immediate next Jade code block after the comment will be compiled to HTML output.
//- @jadedoc
name: some-node
div.this-is-output-for-jade-doc
div.this-isnt
Optionally provide mixin arguments. If no arguments are given, mixins will be executed without any arguments.
//- @jadedoc
name: mixin
description: this is jade mixin documentation
arguments:
arg1: foo
arg2: faa
mixin doc3(arg1, arg2)
div this is a mixin #{arg1} #{arg2}
Locals can be also be passed.
//- @jadedoc
name: tag
locals:
foo: foo
div #{foo}
arguments
for mixin arguments.locals
for template locals.
npm install jade-doc
var jadeDoc = require('jade-doc');
jadeDoc({
input: '**/*.jade',
output: 'anything.json'
});
Optionally use it through the command line.
jade-doc input.jade
jade-doc input.jade --output output.json
Output will look something like this.
[
{
"meta": {
"name": "foo",
"description": "foo description"
},
"file": "file.jade",
"source": "// foo",
"output": "<!-- foo-->"
}
]