Skip to content

Commit

Permalink
edit docs.js comments and rm lib/cli.js (was empty anyway)
Browse files Browse the repository at this point in the history
  • Loading branch information
mklabs committed Oct 23, 2011
1 parent fff228f commit 4abc675
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
Empty file removed lib/cli.js
Empty file.
35 changes: 21 additions & 14 deletions lib/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ var fs = require('fs'),
spawn = require('child_process').spawn,
Ronn = require('ronn').Ronn;

//
// Output documentation, generated from source files or markdown directly.
//
// This file is a special task file which uses [ronnjs](https://github.com/kapouer/ronnjs) to
// automatically generate manpage from the source file.
//
// It will basically output the comments of a source file, originally done to be docco compliant,
// using `man`. The source files are parsed and their markdown content is runned through ronnjs,
// then executed through the `man` executable.
//


// known markdown extensions
var markdowns = ['.md', '.markdown', '.mkd'],
// the reg used to parse markdown from source files
Expand All @@ -12,28 +24,23 @@ var markdowns = ['.md', '.markdown', '.mkd'],
js: /^\s*\/\/\s?/
};


// the snippet of markdown that is prepended on each file generation.
var manfront = [
":cmd-:page(1) -- documentation for :page",
"==========================================================================================================",
"",
"## :page \n"
].join('\n');

// ## help
//
// This file is a special task file which uses [ronnjs](https://github.com/kapouer/ronnjs) to
// automatically generate manpage from the source file.
//
// It will basically output the comments of a source file, originally done to be docco compliant,
// using `man`. The source files are parsed and their markdown content is runned through ronnjs,
// then executed through the `man` executable.
//
//
// Output documentation, generated from source files or markdown
// directly.
//

// ### help
// Output documentation, generated from source files or markdown directly.
// If file is not a markdown extension, file content is parsed if the extension
// is known (js or coffee) and comments written in markdown are used to
// generate the man page.
//
// The cmd parameter is used only to escape the manfront that is prepended on
// each file generation.
exports.help = function(file, cmd, cb) {
var extname = path.extname(file),
basename = path.basename(file).replace(extname, ''),
Expand Down

0 comments on commit 4abc675

Please sign in to comment.