Documentation generator for Javascript, CoffeeScript, C, C++, Objective-C, Ruby, Python, AS3, Java, and everything else ever.
WTFPL License
named after the documenter of the dock of some nameless bay somewhere.
supported languages:
real sick. check it:
require
architecture to store settingsotis
cake watch
ing?Pygments (http://pygments.org)
(this should easy_install
pygments for you, but if not, it's not very hard to get it up and running manually)
npm install -g otis
$ otis [use <config>] [options] [files to document]
when use <config>
is present, otis will attempt to load config files in the
following order:
... and will bail if neither of the latter two could be found, assuming you
have made a grave error of some kind. otis will not look for
./otis.config.js
under these circumstances.
when there is no 'use ' argument specified, otis will use this order instead:
~/.otis/otis.config.js
./otis.config.js
otis loads all of the config files it can find and merges them together, giving "override precedence" to the files listed closer to the bottom in the two lists above.
so for example, if you have a home directory otis.config.js and also a current directory otis.config.js, otis will load both, and will allow anything in the current directory config to override the home directory config.
they're just your typical input files. four little NBs, though:
inDir
argument -i, --inDir Input directory (defaults to current dir)
-o, --outDir Output directory (defaults to ./doc)
-t, --tplDir Directory containing dox.<ext>, code.<ext>, and tmpl.<ext>
-e, --tplEngine Template parser (see github.com/visionmedia/consolidate.js)
-n, --tplExtension Template file extension
-m, --markdownEngine Only two choices, cowboy.
-u, --onlyUpdated Only process files that have been changed
-c, --colourScheme Color scheme to use (as in pygmentize -L styles)
-y, --css CSS file to include after pygments CSS (you can specify this flag multiple times)
-T, --tolerant Will parse comments without a leading ! (ex: "/**! ...")
-w, --watch Watch on the input directory for file changes (experimental)
-I, --ignoreHidden Ignore hidden files and directories (starting with . or _)
-s, --sidebarState Whether the sidebar should be open or not by default
-x, --exclude Paths to exclude
-W, --writeConfig Write 'otis.config.js' in PWD using the options provided.
-h, --help Show this help text.
you can have otis auto-generate a config file for you in the current
directory freezing whatever flags you pass to it into a reusable command.
if the current directory or ~/.otis
contain an otis.config.js
file, all you
have to type to generate beautiful, easily-navigable documentation is otis .
(mind the dot)
but, just for reference's sake, an otis.config.js
file will basically look
like this:
module.exports = {
inDir: './',
outDir: './doc',
tplDir: require("path").join(process.env.HOME, '.otis', 'templates'),
tplEngine: 'jade',
tplExtension: 'jade',
markdownEngine: 'showdown',
onlyUpdated: false,
colorScheme: 'friendly',
tolerant: false,
ignoreHidden: true,
sidebarState: true,
exclude: 'otis.config.js,*.md,doc,node_modules,bin'
};
yep, just a regular old node.js module.
note that the keys on this object correlate 1 to 1 with the available command-line options. that's the plan moving forward indefinitely.
there's currently only one file that otis is hard-coded to look for in
~/.otis
, namely, otis.config.js
(or otis.config.<config>.js
as the case
may be).
however, it's also a great place to store your custom templates, custom css files, etc. as well. only difference is that you have to tell otis (yes, in a config file) that he should look there for them.
don't waste your ~/.otis
. put it to good use.
$ otis .
$ otis -i src -o documents
or:
$ otis -o documents src
or:
$ otis -o documents src/*
note that in the first example, the contents of src
will be mapped directly
into documents
whereas in the second and third examples, the files will be
created inside documents/src
.
i will bequeath to you the secret, ancient command i use to generate this project's documentation. it does all of the following:
gh-pages
branch of this repo_
or .
node_modules
directory, the README.md
file, and a few otherthe command is:
$ otis .
hahaaaaa, gotcha! see? use otis.config.js files. they're great.
you may not want every single comment in your code to end up as a line in your
documentation. otis assumes that to be the case by default and will only
process a comment as documentation if the very first character after the
comment delimiter is !
(an exclamation point).
so, depending on the language, something like the following:
//! slkdfjslkdjf
/*!
* alskdfjlaskjdf
*/
###!
asldkfjalskdjf
###
if you want to disable this behavior so that all comments become
documentation, just use the --tolerant
or -T
flag on the command line, or
include tolerant: true
in your otis.config.js
file.
these are exactly as in pygmentize -L styles
:
at the moment, only:
bryn austin bellomy < [email protected] >
otis owes unrepayable debts to:
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <[[email protected]](mailto:[email protected])>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.