You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran Dox on dox.js, which generated the JSON object below.
I then applied dox-template. As I'm stuck in a Windows environment running PowerShell which does not support the "<" redirect, I had to modify the shell command a bit, as follows:
cat ./dox.json | ./node_modules/.bin/dox-template -r 0.1.1 > dox.1.html
The resulting HTML file--also below--contains only a horizontal line, followed by the title of "Dox Template v0.1.1," and a search input. the rest of the page is blank.
In addition, why is there not a set of tags created in the resulting documentation page? In other words, why does the documentation begin with ?
tyvm
~Keith :^)
/** * JSON Object created when Dox is applied to dox.js */[{"tags": [],"description": {"full": "<p>Module dependencies.</p>","summary": "<p>Module dependencies.</p>","body": ""},"ignore": true,"code": "var markdown = require('github-flavored-markdown').parse\n , escape = require('./utils').escape;","ctx": {"type": "declaration","name": "markdown","value": "require('github-flavored-markdown').parse","string": "markdown"}},{"tags": [],"description": {"full": "<p>Library version.</p>","summary": "<p>Library version.</p>","body": ""},"ignore": false,"code": "exports.version = '0.3.2';","ctx": {"type": "property","receiver": "exports","name": "version","value": "'0.3.2'","string": "exports.version"}},{"tags": [],"description": {"full": "<p>Expose api.</p>","summary": "<p>Expose api.</p>","body": ""},"ignore": false,"code": "exports.api = require('./api');","ctx": {"type": "property","receiver": "exports","name": "api","value": "require('./api')","string": "exports.api"}},{"tags": [{"type": "param","types": ["String"],"name": "js","description": ""},{"type": "param","types": ["Object"],"name": "options","description": ""},{"type": "return","types": ["Array"],"description": ""},{"type": "see","local": "exports.parseComment","visibility": "exports.parseComment"},{"type": "api","visibility": "public"}],"description": {"full": "<p>Parse comments in the given string of <code>js</code>.</p>","summary": "<p>Parse comments in the given string of <code>js</code>.</p>","body": ""},"isPrivate": false,"ignore": false,"code": "exports.parseComments = function(js, options){\n options = options || {};\n js = js.replace(/\\r\\n/gm, '\\n');\n\n var comments = []\n , raw = options.raw\n , comment\n , buf = ''\n , ignore\n , withinMultiline = false\n , withinSingle = false\n , code;\n\n for (var i = 0, len = js.length; i < len; ++i) {\n // start comment\n if (!withinMultiline && !withinSingle && '/' == js[i] && '*' == js[i+1]) {\n // code following previous comment\n if (buf.trim().length) {\n comment = comments[comments.length - 1];\n if(comment) {\n comment.code = code = buf.trim();\n comment.ctx = exports.parseCodeContext(code);\n }\n buf = '';\n }\n i += 2;\n withinMultiline = true;\n ignore = '!' == js[i];\n // end comment\n } else if (withinMultiline && !withinSingle && '*' == js[i] && '/' == js[i+1]) {\n i += 2;\n buf = buf.replace(/^ *\\* ?/gm, '');\n var comment = exports.parseComment(buf, options);\n comment.ignore = ignore;\n comments.push(comment);\n withinMultiline = ignore = false;\n buf = '';\n } else if (!withinSingle && !withinMultiline && '/' == js[i] && '/' == js[i+1]) {\n withinSingle = true;\n buf += js[i];\n } else if (withinSingle && !withinMultiline && '\\n' == js[i]) {\n withinSingle = false;\n buf += js[i];\n // buffer comment or code\n } else {\n buf += js[i];\n }\n }\n\n if (comments.length === 0) {\n comments.push({\n tags: [],\n description: {full: '', summary: '', body: ''},\n isPrivate: false\n });\n }\n\n // trailing code\n if (buf.trim().length) {\n comment = comments[comments.length - 1];\n code = buf.trim();\n comment.code = code;\n comment.ctx = exports.parseCodeContext(code);\n }\n\n return comments;\n};","ctx": {"type": "method","receiver": "exports","name": "parseComments","string": "exports.parseComments()"}},{"tags": [{"type": "param","types": ["String"],"name": "str","description": ""},{"type": "param","types": ["Object"],"name": "options","description": ""},{"type": "return","types": ["Object"],"description": ""},{"type": "see","local": "exports.parseTag","visibility": "exports.parseTag"},{"type": "api","visibility": "public"}],"description": {"full": "<p>Parse the given comment <code>str</code>.</p>\n\n<p>The comment object returned contains the following</p>\n\n<ul>\n<li><code>tags</code> array of tag objects</li>\n<li><code>description</code> the first line of the comment</li>\n<li><code>body</code> lines following the description</li>\n<li><code>content</code> both the description and the body</li>\n<li><code>isPrivate</code> true when \"@api private\" is used</li>\n</ul>","summary": "<p>Parse the given comment <code>str</code>.</p>","body": "<p>The comment object returned contains the following</p>\n\n<ul>\n<li><code>tags</code> array of tag objects</li>\n<li><code>description</code> the first line of the comment</li>\n<li><code>body</code> lines following the description</li>\n<li><code>content</code> both the description and the body</li>\n<li><code>isPrivate</code> true when \"@api private\" is used</li>\n</ul>"},"isPrivate": false,"ignore": false,"code": "exports.parseComment = function(str, options) {\n str = str.trim();\n options = options || {};\n\n var comment = { tags: [] }\n , raw = options.raw\n , description = {};\n\n // parse comment body\n description.full = str.split('\\n@')[0];\n description.summary = description.full.split('\\n\\n')[0];\n description.body = description.full.split('\\n\\n').slice(1).join('\\n\\n');\n comment.description = description;\n\n // parse tags\n if (~str.indexOf('\\n@')) {\n var tags = '@' + str.split('\\n@').slice(1).join('\\n@');\n comment.tags = tags.split('\\n').map(exports.parseTag);\n comment.isPrivate = comment.tags.some(function(tag){\n return 'api' == tag.type && 'private' == tag.visibility;\n })\n }\n\n // markdown\n if (!raw) {\n description.full = markdown(description.full);\n description.summary = markdown(description.summary);\n description.body = markdown(description.body);\n }\n\n return comment;\n}","ctx": {"type": "method","receiver": "exports","name": "parseComment","string": "exports.parseComment()"}},{"tags": [{"type": "param","types": ["String"],"name": "","description": ""},{"type": "return","types": ["Object"],"description": ""},{"type": "api","visibility": "public"}],"description": {"full": "<p>Parse tag string \"@param {Array} name description\" etc.</p>","summary": "<p>Parse tag string \"@param {Array} name description\" etc.</p>","body": ""},"isPrivate": false,"ignore": false,"code": "exports.parseTag = function(str) {\n var tag = {} \n , parts = str.split(/ +/)\n , type = tag.type = parts.shift().replace('@', '');\n\n switch (type) {\n case 'param':\n tag.types = exports.parseTagTypes(parts.shift());\n tag.name = parts.shift() || '';\n tag.description = parts.join(' ');\n break;\n case 'return':\n tag.types = exports.parseTagTypes(parts.shift());\n tag.description = parts.join(' ');\n break;\n case 'see':\n if (~str.indexOf('http')) {\n tag.title = parts.length > 1\n ? parts.shift()\n : '';\n tag.url = parts.join(' ');\n } else {\n tag.local = parts.join(' ');\n }\n case 'api':\n tag.visibility = parts.shift();\n break;\n case 'type':\n tag.types = exports.parseTagTypes(parts.shift());\n break;\n case 'memberOf':\n tag.parent = parts.shift();\n break;\n case 'augments':\n tag.otherClass = parts.shift();\n break;\n case 'borrows':\n tag.otherMemberName = parts.join(' ').split(' as ')[0];\n tag.thisMemberName = parts.join(' ').split(' as ')[1];\n break;\n default:\n tag.string = parts.join(' ');\n break;\n }\n\n return tag;\n}","ctx": {"type": "method","receiver": "exports","name": "parseTag","string": "exports.parseTag()"}},{"tags": [{"type": "param","types": ["String"],"name": "str","description": ""},{"type": "return","types": ["Array"],"description": ""},{"type": "api","visibility": "public"}],"description": {"full": "<p>Parse tag type string \"{Array|Object}\" etc.</p>","summary": "<p>Parse tag type string \"{Array|Object}\" etc.</p>","body": ""},"isPrivate": false,"ignore": false,"code": "exports.parseTagTypes = function(str) {\n return str\n .replace(/[{}]/g, '')\n .split(/ *[|,\\/] */);\n};","ctx": {"type": "method","receiver": "exports","name": "parseTagTypes","string": "exports.parseTagTypes()"}},{"tags": [{"type": "param","types": ["String"],"name": "str","description": ""},{"type": "return","types": ["Object"],"description": ""},{"type": "api","visibility": "public"}],"description": {"full": "<p>Parse the context from the given <code>str</code> of js.</p>\n\n<p>This method attempts to discover the context<br />for the comment based on it's code. Currently<br />supports:</p>\n\n<ul>\n<li>function statements</li>\n<li>function expressions</li>\n<li>prototype methods</li>\n<li>prototype properties</li>\n<li>methods</li>\n<li>properties</li>\n<li>declarations</li>\n</ul>","summary": "<p>Parse the context from the given <code>str</code> of js.</p>","body": "<p>This method attempts to discover the context<br />for the comment based on it's code. Currently<br />supports:</p>\n\n<ul>\n<li>function statements</li>\n<li>function expressions</li>\n<li>prototype methods</li>\n<li>prototype properties</li>\n<li>methods</li>\n<li>properties</li>\n<li>declarations</li>\n</ul>"},"isPrivate": false,"ignore": false,"code": "exports.parseCodeContext = function(str){\n var str = str.split('\\n')[0];\n\n // function statement\n if (/^function (\\w+) *\\(/.exec(str)) {\n return {\n type: 'function'\n , name: RegExp.$1\n , string: RegExp.$1 + '()'\n };\n // function expression\n } else if (/^var *(\\w+) *= *function/.exec(str)) {\n return {\n type: 'function'\n , name: RegExp.$1\n , string: RegExp.$1 + '()'\n };\n // prototype method\n } else if (/^(\\w+)\\.prototype\\.(\\w+) *= *function/.exec(str)) {\n return {\n type: 'method'\n , constructor: RegExp.$1\n , cons: RegExp.$1\n , name: RegExp.$2\n , string: RegExp.$1 + '.prototype.' + RegExp.$2 + '()'\n };\n // prototype property\n } else if (/^(\\w+)\\.prototype\\.(\\w+) *= *([^\\n;]+)/.exec(str)) {\n return {\n type: 'property'\n , constructor: RegExp.$1\n , cons: RegExp.$1\n , name: RegExp.$2\n , value: RegExp.$3\n , string: RegExp.$1 + '.prototype' + RegExp.$2\n };\n // method\n } else if (/^([\\w.]+)\\.(\\w+) *= *function/.exec(str)) {\n return {\n type: 'method'\n , receiver: RegExp.$1\n , name: RegExp.$2\n , string: RegExp.$1 + '.' + RegExp.$2 + '()'\n };\n // property\n } else if (/^(\\w+)\\.(\\w+) *= *([^\\n;]+)/.exec(str)) {\n return {\n type: 'property'\n , receiver: RegExp.$1\n , name: RegExp.$2\n , value: RegExp.$3\n , string: RegExp.$1 + '.' + RegExp.$2\n };\n // declaration\n } else if (/^var +(\\w+) *= *([^\\n;]+)/.exec(str)) {\n return {\n type: 'declaration'\n , name: RegExp.$1\n , value: RegExp.$2\n , string: RegExp.$1\n };\n }\n};","ctx": {"type": "method","receiver": "exports","name": "parseCodeContext","string": "exports.parseCodeContext()"}}]
/**
* dox-template HTML Created
*/
<head><script>varraw=[]</script><scriptsrc="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js" type="text/javascript" charset="utf-8"></script><scripttype="text/javascript" charset="utf-8">// lunr.js version: 0.0.4// (c) 2011 Oliver Nightingale//// Released under MIT license.//varLunr=function(c,f){varb=newLunr.Index(c);f.call(b,b);returnb};Lunr.utils={uniq:function(c){if(!c)return[];returnc.reduce(function(c,b){c.indexOf(b)===-1&&c.push(b);returnc},[])},intersect:function(c){varf=[].slice.call(arguments,1);returnthis.uniq(c).filter(function(b){returnf.every(function(a){returna.indexOf(b)>=0})})},detect:function(c,f,b){for(vara=c.length,g=null,d=0;d<a;d++)if(f.call(b,c[d],d,c)){g=c[d];break}returng},copy:function(c){returnObject.keys(c).reduce(function(f,b){f[b]=c[b];returnf},{})}};Lunr.Trie=function(){varc=function(){this.children={};this.values=[]};c.prototype={childForKey:function(b){vara=this.children[b];a||(a=newc,this.children[b]=a);returna}};varf=function(){this.root=newc};f.prototype={get:function(b){vara=this;returnthis.keys(b).reduce(function(c,d){a.getNode(d).values.forEach(function(a){a=Lunr.utils.copy(a);if(b===d)a.exact=!0;c.push(a)});returnc},[])},getNode:function(b){vara=function(b,d){if(!d.length)returnb;returna(b.childForKey(d.charAt(0)),d.slice(1))};returna(this.root,b)},keys:function(b){vara=[];b=b||"";varc=function(b,e){b.values.length&&a.push(e);Object.keys(b.children).forEach(function(a){c(b.children[a],e+a)})};c(this.getNode(b),b);returna},set:function(b,a){varc=function(b,e){if(!e.length)returnb.values.push(a);c(b.childForKey(e.charAt(0)),e.slice(1))};returnc(this.root,b)}};returnf}();Lunr.Index=function(c){this.name=c;this.refName="id";this.fields={};this.trie=newLunr.Trie};Lunr.Index.prototype={add:function(c){(newLunr.Document(c,this.refName,this.fields)).words().forEach(function(c){this.trie.set(c.id,c.docs[0])},this)},field:function(c,f){this.fields[c]=f||{multiplier:1}},ref:function(c){this.refName=c},search:function(c){if(!c)return[];c=c.split(" ").map(function(c){c=newLunr.Word(c);if(!c.isStopWord())returnc.toString()}).filter(function(c){returnc}).map(function(c){returnthis.trie.get(c).sort(function(b,a){if(b.exact&&a.exact===void0)return-1;if(a.exact&&b.exact===void0)return1;if(b.score<a.score)return1;if(b.score>a.score)return-1;return0}).map(function(b){returnb.documentId})},this);returnLunr.utils.intersect.apply(Lunr.utils,c)}};Lunr.Document=function(c,f,b){this.original=c;this.fields=b;this.ref=c[f]};Lunr.Document.prototype={asJSON:function(){return{id:this.ref,words:this.words().map(function(c){returnc.id}),original:this.original}},words:function(){varc=this,f={};Object.keys(this.fields).forEach(function(b){c.original[b].split(/\b/g).filter(function(a){return!!a.match(/\w/)}).map(function(a){a=newLunr.Word(a);if(!a.isStopWord())returna.toString()}).filter(function(a){returna}).forEach(function(a){f[a]||(f[a]={score:0,ref:c.ref});f[a].score+=c.fields[b].multiplier})});returnObject.keys(f).map(function(b){return{id:b,docs:[{score:f[b].score,documentId:c.ref}]}})}};Lunr.Word=function(c){this.raw=c;this.out=this.raw.replace(/^\W+/,"").replace(/\W+$/,"").toLowerCase()};Lunr.Word.stopWords=["the","of","to","and","a","in","is","it","you","that","this"];Lunr.Word.prototype={isStopWord:function(){returnLunr.Word.stopWords.indexOf(this.raw.toLowerCase())!==-1},toString:function(){if(!this.isStopWord())returnthis.stem(),this.out},stem:function(){varc={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},f={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""};returnfunction(){varb,a,g,d=g=this.out;if(g.length<3)returng;vare,h;g=g.substr(0,1);g=="y"&&(d=g.toUpperCase()+d.substr(1));e=/^(.+?)(ss|i)es$/;a=/^(.+?)([^s])s$/;e.test(d)?d=d.replace(e,"$1$2"):a.test(d)&&(d=d.replace(a,"$1$2"));e=/^(.+?)eed$/;a=/^(.+?)(ed|ing)$/;e.test(d)?(a=e.exec(d),e=/^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*/,e.test(a[1])&&(e=/.$/,d=d.replace(e,""))):a.test(d)&&(a=a.exec(d),b=a[1],a=/^([^aeiou][^aeiouy]*)?[aeiouy]/,a.test(b)&&(d=b,a=/(at|bl|iz)$/,h=/([^aeiouylsz])\1$/,b=/^[^aeiou][^aeiouy]*[aeiouy][^aeiouwxy]$/,a.test(d)?d+="e":h.test(d)?(e=/.$/,d=d.replace(e,"")):b.test(d)&&(d+="e")));e=/^(.+?)y$/;e.test(d)&&(a=e.exec(d),b=a[1],e=/^([^aeiou][^aeiouy]*)?[aeiouy]/,e.test(b)&&(d=b+"i"));e=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/;e.test(d)&&(a=e.exec(d),b=a[1],a=a[2],e=/^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*/,e.test(b)&&(d=b+c[a]));e=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/;e.test(d)&&(a=e.exec(d),b=a[1],a=a[2],e=/^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*/,e.test(b)&&(d=b+f[a]));e=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/;a=/^(.+?)(s|t)(ion)$/;e.test(d)?(a=e.exec(d),b=a[1],e=/^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*[aeiouy][aeiou]*[^aeiou][^aeiouy]*/,e.test(b)&&(d=b)):a.test(d)&&(a=a.exec(d),b=a[1]+a[2],a=/^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*[aeiouy][aeiou]*[^aeiou][^aeiouy]*/,a.test(b)&&(d=b));e=/^(.+?)e$/;if(e.test(d)&&(a=e.exec(d),b=a[1],e=/^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*[aeiouy][aeiou]*[^aeiou][^aeiouy]*/,a=/^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*([aeiouy][aeiou]*)?$/,h=/^[^aeiou][^aeiouy]*[aeiouy][^aeiouwxy]$/,e.test(b)||a.test(b)&&!h.test(b)))d=b;e=/ll$/;a=/^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*[aeiouy][aeiou]*[^aeiou][^aeiouy]*/;e.test(d)&&a.test(d)&&(e=/.$/,d=d.replace(e,""));g=="y"&&(d=g.toLowerCase()+d.substr(1));this.out=d}}()};</script><scripttype="text/javascript" charset="utf-8">varidx=Lunr('methods',function(){this.ref('id')this.field('name',{multiplier: 10})this.field('parent',{multiplier: 5})this.field('full_description')})varmethods=raw.reduce(function(memo,module){returnmemo.concat(module.methods)},[])methods.forEach(function(method){idx.add(method)})$(document).ready(function(){varsearch=function(term){returnidx.search(term).map(function(id){returnmethods.filter(function(method){returnmethod.id===id})[0]})}varsearchResults=$('#search-results')$('#search-input').keyup(function(){varquery=$(this).val(),results=search(query)if(!results.length){searchResults.empty()return};varresultsList=results.reduce(function(ul,result){varli=$('<li>').append($('<a>',{href: '#'+result.name,text: result.name}))ul.append(li)returnul},$('<ul>'))searchResults.html(resultsList)})})</script><styletype="text/css" media="screen">body {
font-family:'Helvetica Neue';
color:#333;
}
a {
color:#0f4bf0;
}
headerh1 {
border-top:4px solid #333;
font-size:2.6em;
}
header .version {
font-size:0.6em;
}
.main>header {
margin-bottom:40px;
}
article {
margin-bottom:10px;
padding-bottom:30px;
}
articleheaderh2 {
border-top:3px solid #333;
font-size:2em;
padding-top:5px;
}
article>section {
margin-bottom:30px;
}
articlesectionh3 {
font-size:1em;
}
articlesectionheaderh3 {
padding-top:2px;
font-size:1.2em;
margin-bottom:5px;
border-top:2px solid #333;
}
articlesectionheaderh4 {
font-size:0.9em;
font-family: courier;
margin:2px05px0;
}
@-webkit-keyframes highlight {
from {
background-color:#Ffff66;
}
to {
background-color: white;
}
}
section.method:target {
-webkit-animation-duration:1s;
-webkit-animation-name: highlight;
}
sectionheader .type,sectionheader .related {
margin-top:0px;
font-size:0.8em;
}
section.paramsh4,section.sourceh4 {
margin-top:5px;
margin-bottom:2px;
font-size:0.9em;
}
section.paramsul {
margin-top:2px;
}
a.show-source {
font-size:0.8em;
}
.wrap {
width:960px;
margin:0 auto;
}
.main {
width:760px;
float: left;
}
.search {
margin-top:10px;
float: right;
}
#search-input {
width:200px;
}
#search-results {
position: relative;
}
#search-resultsul {
width:200px;
position: absolute;
top:0px;
left:0px;
background-color: white;
border:1px solid #ccc;
list-style: none;
padding:0;
margin-top:0;
font-size:0.9em;
}
#search-resultsli {
padding:5px;
}
#search-resultsli:hover {
background-color:#eee;
cursor: pointer;
}
#search-resultslia {
text-decoration: none;
width:200px;
display: block;
}
p {
line-height:1.4em;
}
nav {
padding-top:15px;
float: left;
width:165px;
margin-right:30px;
text-align: right;
font-size:0.8em;
}
navul {
list-style: none;
margin:0;
padding:0;
}
navulh3 {
margin-bottom:5px;
border-top:2px solid #CCC;
padding-top:2px;
}
navululli {
padding:2px0;
}
pre {
background-color:rgba(0,0,0,0.1);
padding:8px;
}
code .keyword,code .special {
font-weight: bold;
color: black;
}
code .string,code .regexp {
color: green
}
code .class {
color: blue
}
code .number {
color: red
}
code .comment {
color: grey;
font-style: italic;
}
</style></head><body><divclass='wrap'><nav><ul></ul></nav><divclass='main'><header><divclass='search'><inputtype="search" id="search-input" placeholder="Search"></input><divid="search-results"></div></div><h1>dox-template <spanclass='version'>0.1.1</span></h1></header></div></div><script>(function(hijs){//// hijs - JavaScript Syntax Highlighter//// Copyright (c) 2010 Alexis Sellier//// All elements which match this will be syntax highlighted.varselector=hijs||'code';varkeywords=('var function if else for while break switch case do new null in with void '+'continue delete return this true false throw catch typeof with instanceof').split(' '),special=('eval window document undefined NaN Infinity parseInt parseFloat '+'encodeURI decodeURI encodeURIComponent decodeURIComponent').split(' ');// Syntax definition// The key becomes the class name of the <span>// around the matched block of code.varsyntax=[['comment',/(\/\*(?:[^*\n]|\*+[^\/*])*\*+\/)/g],['comment',/(\/\/[^\n]*)/g],['string',/("(?:(?!")[^\\\n]|\\.)*"|'(?:(?!')[^\\\n]|\\.)*')/g],['regexp',/(\/.+\/[mgi]*)(?!\s*\w)/g],['class',/\b([A-Z][a-zA-Z]+)\b/g],['number',/\b([0-9]+(?:\.[0-9]+)?)\b/g],['keyword',new(RegExp)('\\b('+keywords.join('|')+')\\b','g')],['special',new(RegExp)('\\b('+special.join('|')+')\\b','g')]];varnodes,table={};if(/^[a-z]+$/.test(selector)){nodes=document.getElementsByTagName(selector);}elseif(/^\.[\w-]+$/.test(selector)){nodes=document.getElementsByClassName(selector.slice(1));}elseif(document.querySelectorAll){nodes=document.querySelectorAll(selector);}else{nodes=[];}for(vari=0,children;i<nodes.length;i++){children=nodes[i].childNodes;for(varj=0,str;j<children.length;j++){code=children[j];if(code.length>=0){// It's a text node// Don't highlight command-line snippetsif(!/^\$/.test(code.nodeValue.trim())){syntax.forEach(function(s){vark=s[0],v=s[1];code.nodeValue=code.nodeValue.replace(v,function(_,m){return'\u00ab'+encode(k)+'\u00b7'+encode(m)+'\u00b7'+encode(k)+'\u00bb';});});}}}}for(vari=0;i<nodes.length;i++){nodes[i].innerHTML=nodes[i].innerHTML.replace(/\u00ab(.+?)\u00b7(.+?)\u00b7\1\u00bb/g,function(_,name,value){value=value.replace(/\u00ab[^\u00b7]+\u00b7/g,'').replace(/\u00b7[^\u00bb]+\u00bb/g,'');return'<span class="'+decode(name)+'">'+escape(decode(value))+'</span>';});}functionescape(str){returnstr.replace(/</g,'<').replace(/>/g,'>');}// Encode ASCII characters to, and from Braillefunctionencode(str,encoded){table[encoded=str.split('').map(function(s){if(s.charCodeAt(0)>127){returns}returnString.fromCharCode(s.charCodeAt(0)+0x2800);}).join('')]=str;returnencoded;}functiondecode(str){if(strintable){returntable[str];}else{returnstr.trim().split('').map(function(s){if(s.charCodeAt(0)-0x2800>127){returns}returnString.fromCharCode(s.charCodeAt(0)-0x2800);}).join('');}}})(window.hijs);</script></body>
The text was updated successfully, but these errors were encountered:
I was just trying dox-template and got the exact same situation (with my own lib though). Original dox output seems correct but template comes up empty (only header line and search box).
The reason that you aren't seeing anything in the html is because dox template is fairly opinionated about the input it is expecting. It expects your code to be grouped into modules, which are defined with a custom tag of @module. An example, from Davis.js, is https://github.com/olivernn/davis.js/blob/master/lib/davis.logger.js. This is a module that is similar to your example in that it is really just a function.
Hi,
I ran Dox on dox.js, which generated the JSON object below.
I then applied dox-template. As I'm stuck in a Windows environment running PowerShell which does not support the "<" redirect, I had to modify the shell command a bit, as follows:
cat ./dox.json | ./node_modules/.bin/dox-template -r 0.1.1 > dox.1.html
The resulting HTML file--also below--contains only a horizontal line, followed by the title of "Dox Template v0.1.1," and a search input. the rest of the page is blank.
In addition, why is there not a set of tags created in the resulting documentation page? In other words, why does the documentation begin with ?
tyvm
~Keith :^)
The text was updated successfully, but these errors were encountered: