UNPKG

dokker

Version:

Dokker.js creates professional Javascript code documentations.

109 lines (106 loc) 3.51 kB
<!DOCTYPE html> <html> <head> <meta name="author" content="Dokker.js"> <meta name="description" content="This API documentation is built with Dokker.js at dokkerjs.com"> <title>Dokker.js</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script> <style> body { font: 16px/1.6 "Helvetica Neue", arial, sans-serif; padding: 60px; } pre { font-size: 14px; line-height: 1.3 } code .init { color: #2F6FAD } code .string { color: #5890AD } code .keyword { color: #8A6343 } code .number { color: #2F6FAD } </style> <script> $(function(){ $('code').each(function(){ $(this).html(highlight($(this).text())); }); }); function highlight(js) { return js .replace(/</g, '&lt;') .replace(/>/g, '&gt;') .replace(/\/\/(.*)/gm, '<span class="comment">//$1</span>') .replace(/('.*')/gm, '<span class="string">$1</span>') .replace(/(\d+\.\d+)/gm, '<span class="number">$1</span>') .replace(/(\d+)/gm, '<span class="number">$1</span>') .replace(/\bnew *(\w+)/gm, '<span class="keyword">new</span> <span class="init">$1</span>') .replace(/\b(function|new|throw|return|var|if|else)\b/gm, '<span class="keyword">$1</span>') } </script> </head> <body> <section class="suite"> <h1>Dokker</h1> <dl> <section class="suite"> <h1>.literate()</h1> <dl> <dt>creates a HTML file from annotated source code</dt> <dd><pre><code>return Dokker.literate(options.literate) .then(function(){ done(); }).done();</code></pre></dd> </dl> </section> <section class="suite"> <h1>.jsdocMarkdown()</h1> <dl> docco: /Users/georgschlenkhoff/Downloads/dokker/.tmp/dokker.js -> /Users/georgschlenkhoff/Downloads/dokker/docs/annotated/dokker.html <dt>creates a markdown file from JSDOC comments</dt> <dd><pre><code>return Dokker.jsdocMarkdown(options.jsdoc) .then(function(){ return read(options.jsdoc.markdown); }).then(function(){ done(); }).done();</code></pre></dd> </dl> </section> <section class="suite"> <h1>.jsdocHtml()</h1> <dl> <dt>creates a HTML file from JSDOC commments</dt> <dd><pre><code>return Dokker.jsdocHtml(options.jsdoc) .then(function(){ return read(options.jsdoc.html); }).then(function(){ done(); }).done();</code></pre></dd> </dl> </section> <section class="suite"> <h1>.injectTemplate()</h1> <dl> <dt>injects index.html file in ejs template</dt> <dd><pre><code>return Dokker.injectTemplate(options.jsdoc) .then(function() { return read(options.jsdoc.html, 'utf8'); }).then(function(data){ assert(/&lt;!DOCTYPE html&gt;/.test(data)); done(); }).done();</code></pre></dd> </dl> </section> <section class="suite"> <h1>.copyTemplate()</h1> <dl> <dt>copies styles and app.js from template folder</dt> <dd><pre><code>return Dokker.copyTemplate(options) .then(function(){ return read(path.join(__dirname, '..', options.dir, 'styles.css')); }).then(function(data){ assert(data); done(); }).done();</code></pre></dd> </dl> </section> </dl> </section> </body> </html>