1 | Overview
|
2 | --------
|
3 |
|
4 | A streamlined static site generator for project documentation based on [Docco](http://jashkenas.github.com/docco/). "Husky" because it's bigger and more irregular than Docco, like [Husky](http://www.wisegeek.com/what-is-a-husky-size-in-clothing.htm) Jeans you would buy at Sears back in the day.
|
5 |
|
6 | A fork of [Docco](http://jashkenas.github.com/docco/), intended to go beyond the appropriate scope of Docco itself. Forked because Docco itself is pretty simple and this is intended to diverge. The initial fork included merged pull requests from [nevir](https://github.com/nevir) and [jswartwood](https://github.com/jswartwood) for their work on supporting recursive directories and an improved "Jump To" menu.
|
7 |
|
8 |
|
9 | Examples
|
10 | --------
|
11 |
|
12 | Check out the [generated documentation](http://mbrevoort.github.com/docco-husky/docco-husky/readme.html) for this project.
|
13 |
|
14 | Or these other samples
|
15 |
|
16 | * [batman.js](http://mbrevoort.github.com/docco-husky/batman/readme.html)
|
17 | * [backbone.js](http://mbrevoort.github.com/docco-husky/backbone/readme.html)
|
18 |
|
19 | Installation
|
20 | ------------
|
21 |
|
22 | ### Possible Gotchas
|
23 |
|
24 | * Docco requires [Pygments](http://pygments.org/) to be installed and will try to install it if it's not already.
|
25 | * Perl is required for [cloc](http://cloc.sourceforge.net/)
|
26 |
|
27 | To install via npm into your project:
|
28 |
|
29 | npm install docco-husky
|
30 |
|
31 | Install globally:
|
32 |
|
33 | [sudo] npm install -g docco-husky
|
34 |
|
35 | Or include as a dependency in your package.json
|
36 |
|
37 |
|
38 | Generating Documentation
|
39 | ------------------------
|
40 |
|
41 | docco-husky will generate docs in a ./docs directory. It accepts multiple files (including
|
42 | wildcards) and directories for it to recurse.
|
43 |
|
44 | docco-husky -name "<optional project name>" <list of files>
|
45 |
|
46 | Optional configuration in your package.json. The project name can alternatively be passed in the package.json configuration and it will override the value passed in the <code>-name</code> option.
|
47 |
|
48 | "docco_husky": {
|
49 | "css": "path/to/alternative/css/file.css"
|
50 | "output_dir": "docs/out", // default "docs"
|
51 | "content_dir": "docs/my_markdown_files", // default null
|
52 | "project_name": "Your Project name",
|
53 | "show_timestamp": true // default true
|
54 | }
|
55 |
|
56 | ### Examples
|
57 |
|
58 | # from a local install
|
59 | ./node_modules/.bin/docco-husky app.js lib public
|
60 |
|
61 | # with a project name
|
62 | ./node_modules/.bin/docco-husky -name "My Project" app.js lib public
|
63 |
|
64 | # with wildcards
|
65 | ./node_modules/.bin/docco-husky -name "My Project" *.js lib public
|
66 |
|
67 | # with global install
|
68 | docco-husky -name "My Project" *.js lib public
|
69 |
|
70 |
|
71 | ### Other Markdown Content
|
72 |
|
73 | <code>docco-husky</code> can also include other markdown content from your project. It expects the markdown files to be in a specified directory configured with <code>content_dir</code>. It walks the directory recursively and puts the resulting files in your the <code>output_dir</code> root including a relative subdirectory.
|
74 |
|
75 | You can manually link to these files from your README.md or optionally if there is a <code>content_index.md</code> file in your <code>content_dir</code> directory, this will be injected into the package.json section of the main page just below the module name and description in <code>index.html</code>. This is a convenient way to reference any additional documents in your <code>index.html</code> that you don't want in your README.md file. One reason you may not want links in your README.md file is that these relative links will not resolve when Github renders your project's README.md file.
|
76 |
|
77 | Output
|
78 | ------------------------
|
79 |
|
80 | docco-husky will write generated files to ./docs by default or to the directory specified in the package.json config as <code>output_dir</code>
|
81 |
|
82 | For all source files, the output will be like
|
83 | <base>.<ext> (e.g. foo.js) --> <base>.html (e.g. foo.html).
|
84 |
|
85 | An index.html will be generated and will include a formatted version of a
|
86 | README.md if your project includes it, some details from the a package.json file,
|
87 | and project stats generated by cloc.
|
88 |
|
89 | Single line comments will only be parsed with the exception os Javascript (as of 0.2.0) which
|
90 | is in an early experimental state. |
\ | No newline at end of file |