coddoc
Version:
Documentation generator
325 lines (262 loc) • 11.2 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>coddoc</title>
<link rel="stylesheet" href="./assets/css/bootstrap.css">
<link rel="stylesheet" href="./assets/css/bootstrap-responsive.css">
<link rel="stylesheet" href="./assets/js/google-code-prettify/prettify.css">
<style type="text/css">
.subnav-inner {
width: 100%;
height: 36px;
background-color: #EEE;
background-repeat: repeat-x;
background-image: -moz-linear-gradient(top, whiteSmoke 0%, #EEE 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, whiteSmoke), color-stop(100%, #EEE));
background-image: -webkit-linear-gradient(top, whiteSmoke 0%, #EEE 100%);
background-image: -ms-linear-gradient(top, whiteSmoke 0%, #EEE 100%);
background-image: -o-linear-gradient(top, whiteSmoke 0%, #EEE 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#f5f5f5', endColorstr = '#eeeeee', GradientType = 0);
background-image: linear-gradient(top, whiteSmoke 0%, #EEE 100%);
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
.subnav .nav > li > a:hover {
color: black ;
}
.subnav .nav li.dropdown .dropdown-toggle .caret,
.subnav .nav li.dropdown.open .caret {
border-top-color: #999 ;
border-bottom-color: #999 ;
}
.subnav-fixed {
position: fixed;
width : 90%;
margin-right: auto;
margin-left: auto;
top: 40px;
left: 0;
right: 0;
z-index: 1020;
border-color: #D5D5D5;
border-width: 0 0 1px;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
-webkit-box-shadow: inset 0 1px 0 #fff, 0 1px 5px rgba(0,0,0,.1);
-moz-box-shadow: inset 0 1px 0 #fff, 0 1px 5px rgba(0,0,0,.1);
box-shadow: inset 0 1px 0 #fff, 0 1px 5px rgba(0,0,0,.1);
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
}
.navbar .nav .dropdown-menu {
max-height: 500px;
overflow: auto;
}
</style>
<style type="text/css">
body {
padding-top: 60px;
padding-bottom: 40px;
}
</style>
<script type="text/javascript">
var init = (function () {
"use strict";
var processScroll = (function () {
var curr = null, prev = null;
return function (nav) {
var $win = $(window);
$('.subnav').each(function () {
var nav = $(this);
var navTop = nav.offset().top - 40;
var scrollTop = $win.scrollTop();
if (scrollTop >= navTop && curr != nav) {
if(curr){
curr.removeClass('subnav-fixed')
prev = curr;
}
curr = nav;
curr.addClass('subnav-fixed')
} else if (curr == nav && scrollTop <= navTop) {
curr.removeClass('subnav-fixed');
prev.addClass('subnav-fixed');
curr = prev;
}else{
nav.removeClass('subnav-fixed');
}
});
};
})();
return function () {
window.prettyPrint && prettyPrint();
$(".collapse").collapse();
// fix sub nav on scroll
processScroll();
$(window).on('scroll', processScroll)
}
})();
</script>
</head>
<body onload="init()">
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a href="./index.html" class="brand">coddoc</a>
<div class="nav-collapse">
<ul class="nav nav-pills">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Namespaces<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="coddoc.html">coddoc</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Classes<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="./coddoc_Context.html">coddoc.Context</a></li>
<li><a href="./coddoc_Symbol.html">coddoc.Symbol</a></li>
<li><a href="./coddoc_Tree.html">coddoc.Tree</a></li>
</ul>
</li>
</ul>
<ul class="nav pull-right">
<li><a href="https://github.com/doug-martin/coddoc" target="#github" class="pull-right">github</a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="container-fluid">
<a name="top"></a>
<div class="container">
<h1>Coddoc</h1>
<h2> Description</h2>
<p>
coddoc is a jsdoc parsing library. Coddoc is different in that it is easily extensible by allowing users to
add tag and code parsers through the use of <a href='./coddoc.html#.addTagHandler'> coddoc.addTagHandler</a> and <a href='./coddoc.html#.addCodeHandler'> coddoc.addCodeHandler</a>.
coddoc also parses source code to be used in APIs.
</p>
<p>
Coddoc also supports the generation of markdown and html through the use of different templates. Currently
the templates use <a href="http://handlebarsjs.com/">Handlebars</a> but you may use any templating engine
you wish
</p>
<h3>JSDOC Tags</h3>
<p>
JSDoc tags currently supported are:
<ul>
<li>augments|extends : extend an object</li>
<li>lends : document all members of an anonymous object as members of a declared symbol</li>
<li>namespace : document a namespace</li>
<li>parameter|param|arg|argument : parameters of a function</li>
<li>return|returns : return value of a function</li>
<li>memberof|memberOf : explicitly document a cod block as a member of an object</li>
<li>name : explicitly document the name of a symbol</li>
<li>constructor|constructs : document a symbol as a constructor for a class</li>
<li>class : documents a symbol as a class</li>
<li>classdesc : alternate way to add a description to a class</li>
<li>example : document an example/s of a symbol</li>
<li>private : document a symbol as private.</li>
<li>ignore : allows you to document a symbol but ignore it in parsing</li>
<li>method|function : explicily document a symbol as a method</li>
<li>field : explicily document a symbol as a field</li>
<li>type : document the type of a field</li>
<li>default : document the default value of a field</li>
<li>throws|throw|exception : document any exception thrown by a method</li>
<li>property : document a property in the constructor declaration of a class</li>
<li>borrows : document any filed/methods borrowed from a class</li>
<li>constant|const : document a field as a constant</li>
<li>desc|description : alternate way to explicitly document the description of a symbol</li>
<li>public:explicitly document a symbol as public</li>
</ul>
<h3>Coddoc Tags</h3>
Coddoc also has a few additional tags.
<ul>
<li>ignoreCode : ignore the parsed code in the output</li>
<li>includeDoc : include an external doc. External docs can be html or markdown.
Example <pre class='prettyprint linenums lang-js'>
@includeDoc [Title Of Doc] ../location/of_doc.md
</pre>
</li>
<li>projectName : document the projectName</li>
<li>github : url to github project</li>
<li>code : specifies a code block without needing an <code>example</code> tag
Example <pre class='prettyprint linenums lang-js'>
{@code var test = "test"; }
</pre>
</li>
<li>header : allows you to document a header that should appear before
generated documentation</li>
<li>footer : allows you to document a footer that should come after the generated documentation</li>
<li>protected : allows you to document a field as protected</li>
</ul>
</p>
<h2>Installation</h2>
Locally
<pre class='prettyprint linenums lang-js'>
npm install coddoc
</pre>
Globally
<pre class='prettyprint linenums lang-js'>
npm install -g coddoc
</pre>
<h2>Usage</h2>
Down doc does not currently create multi file docs instead will output to a single file. You may however implement
your own formatter to create multiple files.
Command line options
<ul>
<li>-d --directory : the directory that contains your code</li>
<li>[-f --formatter] : optional formatter to use, if not specified then a JSON object of the symbols will
be output</li>
<li>[-p --pattern] : optional file pattern to use when searching for files</li>
</ul>
Examples
JSON output
<pre class='prettyprint linenums lang-js'>
coddoc -d ./lib > symbols.json
</pre>
To use the markdown formatter
<pre class='prettyprint linenums lang-js'>
coddoc -d ./lib -f markdown > README.md
</pre>
To use the HTML formatter
<pre class='prettyprint linenums lang-js'>
coddoc -d ./lib -f html > index.html
</pre>
To use pragmatically
<pre class='prettyprint linenums lang-js'>
var coddoc = require("coddoc");
var tree = coddoc.parse({directory : __dirname + "/lib"});
var classes = tree.classes, namespaces = tree.namespaces;
//do something
</pre>
<h2>API</h2>
<hr>
<h2>License</h2>
<p>MIT <a href = https://github.com/Pollenware/coddoc/raw/master/LICENSE>LICENSE</a><p>
<h2>Meta</h2>
<hr>
<p>Code: <code>git clone git://github.com/pollenware/coddoc.git</code></br></p>
</div>
</div>
<script type="text/javascript" src="./assets/js/jquery.js"></script>
<script type="text/javascript" src="./assets/js/bootstrap-transition.js"></script>
<script type="text/javascript" src="./assets/js/bootstrap-dropdown.js"></script>
<script type="text/javascript" src="./assets/js/bootstrap-tab.js"></script>
<script type="text/javascript" src="./assets/js/bootstrap-tooltip.js"></script>
<script type="text/javascript" src="./assets/js/bootstrap-popover.js"></script>
<script type="text/javascript" src="./assets/js/bootstrap-button.js"></script>
<script type="text/javascript" src="./assets/js/bootstrap-collapse.js"></script>
<script type="text/javascript" src="./assets/js/bootstrap-carousel.js"></script>
<script type="text/javascript"
src="./assets/js/google-code-prettify/prettify.js"></script>
</body>
</html>