Comparing version 1.0.1 to 1.0.2
@@ -0,1 +1,9 @@ | ||
1.0.2 / 2011-12-13 | ||
------------------ | ||
* Fixed highlight of last menu item after scroll, closes #17 | ||
* Fixed boilerplate layout | ||
* Fixed missed slash in links to source code, closes #19 | ||
1.0.1 / 2011-12-07 | ||
@@ -2,0 +10,0 @@ ------------------ |
454
lib/index.js
@@ -6,18 +6,14 @@ 'use strict'; | ||
// | ||
// export ndoc | ||
// | ||
module.exports = NDoc; | ||
// | ||
// create and load parser | ||
// | ||
var parser; | ||
try { | ||
var parser = require('./parser'); | ||
} catch(err) { | ||
(function(){ | ||
var Jison = require('jison'); | ||
var grammar = require('jison/lib/jison/bnf').parse(Util.read(Util.join(__dirname, 'parser.y'))); | ||
Util.write(Util.join(__dirname, 'parser.js'), (new Jison.Parser(grammar)).generate()); | ||
})(); | ||
var parser = require('./parser'); | ||
parser = require('./parser'); | ||
} catch (err) { | ||
(function () { | ||
var Jison = require('jison'), | ||
grammar = require('jison/lib/jison/bnf').parse(Util.read(Util.join(__dirname, 'parser.y'))); | ||
Util.write(Util.join(__dirname, 'parser.js'), (new Jison.Parser(grammar)).generate()); | ||
}()); | ||
parser = require('./parser'); | ||
} | ||
@@ -29,5 +25,15 @@ | ||
function extend(o, plus) { | ||
var r = {}; | ||
for (var i in o) r[i] = o[i]; | ||
if (plus) for (var i in plus) r[i] = plus[i]; | ||
var r = {}, i; | ||
for (i in o) { | ||
if (o.hasOwnProperty(i)) { | ||
r[i] = o[i]; | ||
} | ||
} | ||
if (plus) { | ||
for (i in plus) { | ||
if (plus.hasOwnProperty(i)) { | ||
r[i] = plus[i]; | ||
} | ||
} | ||
} | ||
return r; | ||
@@ -53,3 +59,3 @@ } | ||
this.options = extend({ | ||
}, options) | ||
}, options); | ||
@@ -65,80 +71,54 @@ // documentation tree consists of sections, which are populated with documents | ||
} | ||
}; | ||
}, t, parted, len, i, id, idx, p, pid, d, g, tree, children; | ||
// parse specified source files | ||
files.forEach(function(file) { | ||
files.forEach(function (file) { | ||
console.log('Compiling file', file); | ||
// parse file | ||
var text, ndocs, id, d, d1; | ||
try { | ||
var text = Util.read(file); | ||
text = Util.read(file); | ||
// TODO: consider amending failing document inplace. | ||
// Say, if it doesn't parse, insert a fake '*' line at failing `line` and retry | ||
if (false) { | ||
var ok = true; | ||
do { | ||
try { | ||
var ndocs = parser.parse(text); | ||
} catch(err) { | ||
err.message.replace(/.*Parse error on line (\d+):.*/, function(all, line) { | ||
line = Number(line); | ||
var lines = text.split('\n'); | ||
console.error('Missing separator line at', line, lines.slice(line-1, line+1)); | ||
lines = lines.slice(0, line).concat(['*']).concat([lines[line]]).concat(['*']).concat(lines.slice(line+1)); | ||
text = lines.join('\n'); | ||
console.error('Trying with', lines.slice(line-2, line+2)); | ||
try { | ||
ndocs = parser.parse(text); | ||
} catch(err) { | ||
lines = lines.slice(0, line-1).concat(['*']).concat([lines[line-1]]).concat(['*']).concat(lines.slice(line)); | ||
text = lines.join('\n'); | ||
console.error('Retrying with', lines.slice(line-2, line+2)); | ||
try { | ||
ndocs = parser.parse(text); | ||
} catch(err) { | ||
ok = false; | ||
ndocs = parser.parse(text); | ||
// do pre-distribute early work | ||
for (id in ndocs) { | ||
if (ndocs.hasOwnProperty(id)) { | ||
d = ndocs[id]; | ||
// assign hierarchy helpers | ||
d.aliases = []; | ||
d.children = []; | ||
if (d.type === 'class') { | ||
d.subclasses = []; | ||
} | ||
// collect sections | ||
if (d.type === 'section') { | ||
list[d.id] = d; | ||
// collect flat list | ||
} else { | ||
// elements with undefined section get '' section, | ||
// and will be resolved later, when we'll have full | ||
// element list | ||
list[(d.section || '') + '.' + d.id] = d; | ||
// bound methods produce two methods with the same description but different signatures | ||
// E.g. Element.foo(@element, a, b) becomes | ||
// Element.foo(element, a, b) and Element#foo(a, b) | ||
if (d.type === 'method' && d.bound) { | ||
d1 = extend(d); | ||
d1.id = d.id.replace(/(.+)\.(.+)/, '$1#$2'); | ||
// link to methods | ||
d.bound = d1.id; | ||
d1.bound = d.id; | ||
// insert bound method clone | ||
list[(d.section || '') + '.' + d1.id] = d1; | ||
} | ||
} | ||
}); | ||
} | ||
} while(!ok); | ||
} | ||
var ndocs = parser.parse(text); | ||
// do pre-distribute early work | ||
for (var id in ndocs) { | ||
var d = ndocs[id]; | ||
// assign hierarchy helpers | ||
d.aliases = []; | ||
d.children = []; | ||
if (d.type === 'class') { | ||
d.subclasses = []; | ||
} | ||
// collect sections | ||
if (d.type === 'section') { | ||
list[d.id] = d; | ||
// collect flat list | ||
} else { | ||
// elements with undefined section get '' section, | ||
// and will be resolved later, when we'll have full | ||
// element list | ||
list[(d.section || '') + '.' + d.id] = d; | ||
// bound methods produce two methods with the same description but different signatures | ||
// E.g. Element.foo(@element, a, b) becomes | ||
// Element.foo(element, a, b) and Element#foo(a, b) | ||
if (d.type === 'method' && d.bound) { | ||
var d1 = extend(d); | ||
d1.id = d.id.replace(/(.+)\.(.+)/, '$1#$2'); | ||
// link to methods | ||
d.bound = d1.id; | ||
d1.bound = d.id; | ||
// insert bound method clone | ||
list[(d.section || '') + '.' + d1.id] = d1; | ||
// compose links to source files | ||
if (options.formatLink) { | ||
d.href = options.formatLink(file, d.line); | ||
} | ||
} | ||
// compose links to source files | ||
if (options.formatLink) { | ||
d.href = options.formatLink(file, d.line); | ||
} | ||
} | ||
} catch(err) { | ||
} catch (err) { | ||
console.error('FATAL:', file, err.message || err); | ||
@@ -150,3 +130,3 @@ process.exit(1); | ||
// TODO: section.related_to should mark related element as belonging to the section | ||
/*for (var id in list) { | ||
/*for (id in list) { | ||
var d = list[id]; | ||
@@ -164,22 +144,23 @@ if (d.type === 'section' && d.related_to && list['.' + d.related_to]) { | ||
// If found, rename ".Ajax.Updater" to "SECTION.Ajax.Updater" | ||
var t = Object.keys(list).sort(); | ||
var parted = t.map(function(id) { | ||
t = Object.keys(list).sort(); | ||
parted = t.map(function (id) { | ||
return id.split(/[.#]/); | ||
}); | ||
var len = parted.length; | ||
len = parted.length; | ||
// N.B. starting with 1 we skip "" section | ||
for (var idx = 1; idx < len; ++idx) { | ||
if (parted[idx][0] !== '') continue; | ||
for (var i = idx + 1; i < len; ++i) { | ||
if (parted[idx][1] === parted[i][1] && parted[i][0] !== '') { | ||
var p = t[idx]; | ||
// prefix with guessed section | ||
t[idx] = parted[i][0] + t[idx]; | ||
//if (!p) console.log('RENAME [%s] -> [%s]', p, t[idx], parted[idx], parted[i]); | ||
// update flat list element, since key and value's id has been changed | ||
var g = list[p]; | ||
delete list[p]; | ||
g.id = p = t[idx]; | ||
list[p] = g; | ||
break; | ||
for (idx = 1; idx < len; idx += 1) { | ||
if (parted[idx][0] === '') { | ||
for (i = idx + 1; i < len; i += 1) { | ||
if (parted[idx][1] === parted[i][1] && parted[i][0] !== '') { | ||
p = t[idx]; | ||
// prefix with guessed section | ||
t[idx] = parted[i][0] + t[idx]; | ||
//if (!p) console.log('RENAME [%s] -> [%s]', p, t[idx], parted[idx], parted[i]); | ||
// update flat list element, since key and value's id has been changed | ||
g = list[p]; | ||
delete list[p]; | ||
g.id = p = t[idx]; | ||
list[p] = g; | ||
break; | ||
} | ||
} | ||
@@ -190,4 +171,4 @@ } | ||
// sort elements in case-insensitive manner | ||
var tree = {}; | ||
t = t.sort(function(a, b) { | ||
tree = {}; | ||
t = t.sort(function (a, b) { | ||
a = a.toLowerCase(); | ||
@@ -197,3 +178,3 @@ b = b.toLowerCase(); | ||
}); | ||
t.forEach(function(id) { | ||
t.forEach(function (id) { | ||
tree[id] = list[id]; | ||
@@ -206,18 +187,20 @@ }); | ||
// the parent of any element. | ||
for (var i = t.length; --i >= 1; ) { | ||
var id = t[i]; | ||
for (i = t.length - 1; i >= 1; i -= 1) { | ||
id = t[i]; | ||
// parent name is this element's name without portion after the last '.' or '#' | ||
var idx = Math.max(id.lastIndexOf('.'), id.lastIndexOf('#')); | ||
idx = Math.max(id.lastIndexOf('.'), id.lastIndexOf('#')); | ||
// no '.' or '#' found? this is top level section. just skip it | ||
if (idx < 0) continue; | ||
// extract parent name | ||
var pid = id.substring(0, idx); | ||
// get parent element | ||
var p = tree[pid]; | ||
// no parent element? skip this | ||
if (!p) continue; | ||
// parent element found. move this element to parent's children list, maintaing order | ||
p.children.unshift(tree[id]); | ||
//tree[id].parent = pid; | ||
delete tree[id]; | ||
if (idx >= 0) { | ||
// extract parent name | ||
pid = id.substring(0, idx); | ||
// get parent element | ||
p = tree[pid]; | ||
// no parent element? skip this | ||
if (p) { | ||
// parent element found. move this element to parent's children list, maintaing order | ||
p.children.unshift(tree[id]); | ||
//tree[id].parent = pid; | ||
delete tree[id]; | ||
} | ||
} | ||
} | ||
@@ -227,21 +210,22 @@ | ||
// to which sections every element belongs | ||
for (var id in list) { | ||
var d = list[id]; | ||
delete list[id]; | ||
// compose new id | ||
d.id = id.replace(/^[^.]*\./, ''); | ||
d.name = d.id.replace(/^.*[.#]/, ''); | ||
// sections have lowercased ids, to not clash with other elements | ||
if (d.type === 'section') { | ||
d.id = d.id.toLowerCase(); | ||
for (id in list) { | ||
if (list.hasOwnProperty(id)) { | ||
d = list[id]; | ||
delete list[id]; | ||
// compose new id | ||
d.id = id.replace(/^[^.]*\./, ''); | ||
d.name = d.id.replace(/^.*[.#]/, ''); | ||
// sections have lowercased ids, to not clash with other elements | ||
if (d.type === 'section') { | ||
d.id = d.id.toLowerCase(); | ||
} | ||
// prototype members have different paths | ||
d.path = d.id.replace(/#/g, '.prototype.'); | ||
delete d.section; | ||
// prune sections from list | ||
if (d.type !== 'section') { | ||
//delete d.children; | ||
list[d.id] = d; | ||
} | ||
} | ||
// prototype members have different paths | ||
d.path = d.id.replace(/#/g, '.prototype.'); | ||
delete d.section; | ||
// prune sections from list | ||
if (d.type === 'section') { | ||
continue; | ||
} | ||
//delete d.children; | ||
list[d.id] = d; | ||
} | ||
@@ -251,33 +235,34 @@ | ||
// correct method types (class or entity) | ||
for (var id in list) { | ||
var d = list[id]; | ||
for (id in list) { | ||
if (list.hasOwnProperty(id)) { | ||
d = list[id]; | ||
// aliases | ||
if (d.alias_of && list[d.alias_of]) { | ||
list[d.alias_of].aliases.push(d.id); | ||
} | ||
// aliases | ||
if (d.alias_of && list[d.alias_of]) { | ||
list[d.alias_of].aliases.push(d.id); | ||
} | ||
// classes hierarchy | ||
if (d.type === 'class') { | ||
//if (d.superclass) console.log('SUPER', id, d.superclass) | ||
if (d.superclass && list[d.superclass]) { | ||
list[d.superclass].subclasses.push(d.id); | ||
// classes hierarchy | ||
if (d.type === 'class') { | ||
//if (d.superclass) console.log('SUPER', id, d.superclass) | ||
if (d.superclass && list[d.superclass]) { | ||
list[d.superclass].subclasses.push(d.id); | ||
} | ||
} | ||
} | ||
// methods and properties | ||
if (d.type === 'method' || d.type === 'property') { | ||
if (d.id.match(/^\$/)) { | ||
d.type = 'utility'; | ||
// methods and properties | ||
if (d.type === 'method' || d.type === 'property') { | ||
if (d.id.match(/^\$/)) { | ||
d.type = 'utility'; | ||
} | ||
if (d.id.indexOf('#') >= 0) { | ||
d.type = 'instance ' + d.type; | ||
} else if (d.id.indexOf('.') >= 0) { | ||
d.type = 'class ' + d.type; | ||
} | ||
// constructor | ||
} else if (d.type === 'constructor') { | ||
d.id = 'new ' + d.id.replace(/\.new$/, ''); | ||
} | ||
if ((~d.id.indexOf('#'))) { | ||
d.type = 'instance ' + d.type; | ||
} else if ((~d.id.indexOf('.'))) { | ||
d.type = 'class ' + d.type; | ||
} | ||
// constructor | ||
} else if (d.type === 'constructor') { | ||
d.id = 'new ' + d.id.replace(/\.new$/, ''); | ||
} | ||
} | ||
@@ -287,10 +272,12 @@ | ||
// convert sections to uniform children array of tree top level | ||
var children = []; | ||
for (var id in tree) { | ||
if (id === '') { | ||
children = children.concat(tree[id].children); | ||
} else { | ||
children.push(tree[id]); | ||
children = []; | ||
for (id in tree) { | ||
if (tree.hasOwnProperty(id)) { | ||
if (id === '') { | ||
children = children.concat(tree[id].children); | ||
} else { | ||
children.push(tree[id]); | ||
} | ||
delete tree[id]; | ||
} | ||
delete tree[id]; | ||
} | ||
@@ -309,14 +296,16 @@ tree.children = children; | ||
**/ | ||
NDoc.prototype.toJSON = function(options) { | ||
var list = {}; | ||
for (var id in this.list) { | ||
var d = this.list[id]; | ||
list[id] = { | ||
id: d.id, | ||
type: d.type, | ||
name: d.name, | ||
path: d.path, | ||
parent: d.parent, | ||
section: d.section, | ||
}; | ||
NDoc.prototype.toJSON = function (options) { | ||
var list = {}, id, d; | ||
for (id in this.list) { | ||
if (this.list.hasOwnProperty(id)) { | ||
d = this.list[id]; | ||
list[id] = { | ||
id: d.id, | ||
type: d.type, | ||
name: d.name, | ||
path: d.path, | ||
parent: d.parent, | ||
section: d.section, | ||
}; | ||
} | ||
} | ||
@@ -326,3 +315,3 @@ return JSON.stringify(extend(options, { | ||
tree: this.tree, | ||
date: (new Date).toUTCString(), | ||
date: (new Date()).toUTCString(), | ||
})); | ||
@@ -336,24 +325,30 @@ }; | ||
**/ | ||
NDoc.prototype.toHTML = function(options) { | ||
NDoc.prototype.toHTML = function (options) { | ||
var Jade = require('jade'); | ||
var md2html = require('marked'); | ||
//var highlight = require('highlight').Highlight; | ||
var Jade = require('jade'), | ||
md2html = require('marked'), | ||
// prepare rendering function | ||
// TODO: store it for further reuse, and get rid of jade dependency? | ||
var path = Util.join(options.skin, 'templates', 'layout.jade'); | ||
var str = Util.read(path); | ||
var fn = Jade.compile(str, { | ||
filename: path, | ||
pretty: false | ||
}); | ||
path = Util.join(options.skin, 'templates', 'layout.jade'), | ||
str = Util.read(path), | ||
fn = Jade.compile(str, { | ||
filename: path, | ||
pretty: false | ||
}), | ||
// it's illegal to have slashes in HTML elements ids. | ||
// replace them with dashes | ||
var list = this.list; | ||
for (var i in list) { | ||
var obj = list[i]; | ||
// path should be HTML valid id | ||
obj.path = obj.path.replace(/\//g, '-'); | ||
list = this.list, | ||
id, | ||
obj, | ||
vars, | ||
html; | ||
for (id in list) { | ||
if (list.hasOwnProperty(id)) { | ||
obj = list[id]; | ||
// path should be HTML valid id | ||
obj.path = obj.path.replace(/\//g, '-'); | ||
} | ||
} | ||
@@ -365,3 +360,5 @@ | ||
function link(obj, short, classes) { | ||
if (typeof obj === 'string') obj = list[obj] || {id: obj}; | ||
if (typeof obj === 'string') { | ||
obj = list[obj] || {id: obj}; | ||
} | ||
// broken link. `options.brokenLinks` define action | ||
@@ -377,3 +374,3 @@ if (!obj.path) { | ||
var r = '<a href="#' + obj.path | ||
+ '" class="' + (classes||[]).join(' ') | ||
+ '" class="' + (classes || []).join(' ') | ||
+ '" title="' + obj.id + (obj.type ? ' (' + obj.type + ')' : '') | ||
@@ -388,3 +385,4 @@ + '" data-id="' + obj.id + '">'; | ||
function markdown(text, inline) { | ||
var r = text; | ||
var r = text, | ||
codes; | ||
// render markdown | ||
@@ -394,3 +392,3 @@ r = md2html(r); | ||
// restore &entities; | ||
r = r.replace(/&(\w+);/g, function(all, entity) { | ||
r = r.replace(/&(\w+);/g, function (all, entity) { | ||
return '&' + entity + ';'; | ||
@@ -401,3 +399,3 @@ }); | ||
// trim content in <pre><code> CONTENT </code></pre> | ||
r = r.replace(/<pre><code>([\s\S]*?)<\/code><\/pre>/g, function(all, content) { | ||
r = r.replace(/<pre><code>([\s\S]*?)<\/code><\/pre>/g, function (all, content) { | ||
return '<pre><code>' + content.trim() + '</code></pre>'; | ||
@@ -407,3 +405,3 @@ }); | ||
// FIXME: highlight code | ||
/*r = r.replace(/<code>([\s\S]*?)<\/code>/g, function(all, content) { | ||
/*r = r.replace(/<code>([\s\S]*?)<\/code>/g, function (all, content) { | ||
return '<code>' + highlight(content) + '</code>'; | ||
@@ -418,4 +416,4 @@ });*/ | ||
// we first store replace code blocks with nonces | ||
var codes = {}; | ||
r = r.replace(/(<code>[\s\S]*?<\/code>)/g, function(all, def) { | ||
codes = {}; | ||
r = r.replace(/(<code>[\s\S]*?<\/code>)/g, function (all, def) { | ||
var nonce = Math.random().toString().substring(2); | ||
@@ -426,5 +424,5 @@ codes[nonce] = def; | ||
// convert [[link]] to links | ||
r = r.replace(/\[\[([\s\S]+?)\]\]/g, function(all, def) { | ||
var def = def.split(/\s+/); | ||
var id = def.shift(); | ||
r = r.replace(/\[\[([\s\S]+?)\]\]/g, function (all, def) { | ||
def = def.split(/\s+/); | ||
id = def.shift(); | ||
// invalid references don't produce links | ||
@@ -444,3 +442,3 @@ if (!list[id]) { | ||
// restore code blocks, given previously stored nonces | ||
r = r.replace(/@-=@=-@(\d+)@-=@=-@/g, function(all, nonce) { | ||
r = r.replace(/@-=@=-@(\d+)@-=@=-@/g, function (all, nonce) { | ||
return codes[nonce]; | ||
@@ -454,16 +452,29 @@ }); | ||
function signature(obj, sig) { | ||
if (typeof obj === 'string') obj = list[obj]; | ||
if (typeof obj === 'string') { | ||
obj = list[obj]; | ||
} | ||
var r = obj.id; | ||
if (sig.args) { | ||
r += '('; | ||
sig.args.forEach(function(arg, idx, args) { | ||
sig.args.forEach(function (arg, idx, args) { | ||
var skip_first, a; | ||
// skip the first bound argument for prototype methods | ||
var skip_first = obj.bound && ~obj.id.indexOf('#'); | ||
var a = arg.name; | ||
if (!idx && skip_first) return; //a = '@' + a; | ||
if (arg.default_value) a = a + ' = ' + arg.default_value; | ||
skip_first = obj.bound && obj.id.indexOf('#') >= 0; | ||
a = arg.name; | ||
if (!idx && skip_first) { | ||
return; //a = '@' + a; | ||
} | ||
if (arg.default_value) { | ||
a = a + ' = ' + JSON.stringify(arg.default_value); | ||
} | ||
// compensate for possibly skipped first argument | ||
if (idx > (skip_first ? 1 : 0)) a = ', ' + a; | ||
if (arg.ellipsis) a += '...'; | ||
if (arg.optional) a = '[' + a + ']'; | ||
if (idx > (skip_first ? 1 : 0)) { | ||
a = ', ' + a; | ||
} | ||
if (arg.ellipsis) { | ||
a += '...'; | ||
} | ||
if (arg.optional) { | ||
a = '[' + a + ']'; | ||
} | ||
r += a; | ||
@@ -477,6 +488,6 @@ }); | ||
// collect context for rendering function | ||
var vars = extend(options, { | ||
vars = extend(options, { | ||
list: this.list, | ||
tree: this.tree, | ||
date: (new Date).toUTCString(), | ||
date: (new Date()).toUTCString(), | ||
//-- | ||
@@ -489,4 +500,9 @@ link: link, | ||
// render HTML | ||
var html = fn(vars); | ||
html = fn(vars); | ||
return html; | ||
}; | ||
// | ||
// export ndoc | ||
// | ||
module.exports = NDoc; |
@@ -273,3 +273,3 @@ /* Jison generated parser */ | ||
return token; | ||
}; | ||
} | ||
@@ -292,2 +292,3 @@ var symbol, preErrorSymbol, state, action, a, r, yyval={},p,len,newState, expected; | ||
// handle parse error | ||
_handle_error: | ||
if (typeof action === 'undefined' || !action.length || !action[0]) { | ||
@@ -303,3 +304,3 @@ | ||
if (this.lexer.showPosition) { | ||
errStr = 'Parse error on line '+(yylineno+1)+":\n"+this.lexer.showPosition()+'\nExpecting '+expected.join(', ') + ", got '" + this.terminals_[symbol]+ "'"; | ||
errStr = 'Parse error on line '+(yylineno+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+expected.join(', ') + ", got '" + this.terminals_[symbol]+ "'"; | ||
} else { | ||
@@ -532,2 +533,8 @@ errStr = 'Parse error on line '+(yylineno+1)+": Unexpected " + | ||
return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules; | ||
}, | ||
topState:function () { | ||
return this.conditionStack[this.conditionStack.length-2]; | ||
}, | ||
pushState:function begin(condition) { | ||
this.begin(condition); | ||
}}); | ||
@@ -588,80 +595,78 @@ lexer.performAction = function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { | ||
break; | ||
case 25:return 'NL' | ||
case 25:/* skip whitespaces */ | ||
break; | ||
case 26:/* skip whitespaces */ | ||
case 26:this.begin('arg'); return 43 | ||
break; | ||
case 27:this.begin('arg'); return 43 | ||
case 27:return 39 | ||
break; | ||
case 28:return 39 | ||
case 28:return 29 | ||
break; | ||
case 29:return 29 | ||
case 29:return 27 | ||
break; | ||
case 30:return 27 | ||
case 30:/*return '*'*/ | ||
break; | ||
case 31:/*return '*'*/ | ||
case 31:yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2); return 51 | ||
break; | ||
case 32:yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2); return 51 | ||
break; | ||
case 33:yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2); return 51 | ||
case 33:return 16 | ||
break; | ||
case 34:return 16 | ||
case 34:return 53 | ||
break; | ||
case 35:return 53 | ||
case 35:return 52 | ||
break; | ||
case 36:return 52 | ||
break; | ||
case 37:return 52 | ||
case 37:return 47 | ||
break; | ||
case 38:return 47 | ||
case 38:return 76 | ||
break; | ||
case 39:return 76 | ||
case 39:return 48 | ||
break; | ||
case 40:return 48 | ||
case 40:return 57 | ||
break; | ||
case 41:return 57 | ||
case 41:return 46 | ||
break; | ||
case 42:return 46 | ||
case 42:return 13 | ||
break; | ||
case 43:return 13 | ||
case 43:return 68 | ||
break; | ||
case 44:return 68 | ||
case 44:return 63 | ||
break; | ||
case 45:return 63 | ||
case 45:return 71 | ||
break; | ||
case 46:return 71 | ||
case 46:return 65 | ||
break; | ||
case 47:return 65 | ||
case 47:return 15 | ||
break; | ||
case 48:return 15 | ||
case 48:return 40 | ||
break; | ||
case 49:return 40 | ||
case 49:return 42 | ||
break; | ||
case 50:return 42 | ||
case 50:return 54 | ||
break; | ||
case 51:return 54 | ||
case 51:return 56 | ||
break; | ||
case 52:return 56 | ||
case 52:return 58 | ||
break; | ||
case 53:return 58 | ||
case 53:return 60 | ||
break; | ||
case 54:return 60 | ||
case 54:return 49 | ||
break; | ||
case 55:return 49 | ||
case 55:return 64 | ||
break; | ||
case 56:return 64 | ||
case 56:return 66 | ||
break; | ||
case 57:return 66 | ||
case 57:return 74 | ||
break; | ||
case 58:return 74 | ||
case 58:return 45 | ||
break; | ||
case 59:return 45 | ||
case 59:this.popState(); return 31 | ||
break; | ||
case 60:this.popState(); return 31 | ||
case 60:this.popState(); console.log('LEFTCOMM'); return 31 | ||
break; | ||
case 61:this.popState(); console.log('LEFTCOMM'); return 31 | ||
break; | ||
} | ||
}; | ||
lexer.rules = [/^$/,/^\s+/,/^\/\*\*(?=([^/]))/,/^.*/,/^\*\*\//,/^\s*[\n]/,/^, /,/^: /,/^\.\./,/^#/,/^\./,/^\s+/,/^-?(?:[0-9]|[1-9][0-9]+)(?:\.[0-9]+)?(?:[eE][-+]?[0-9]+)?\b/,/^deprecated\b/,/^read-only\b/,/^internal\b/,/^chainable\b/,/^section\b/,/^alias of\b/,/^alias\b/,/^related to\b/,/^belongs to\b/,/^(?:[$_a-zA-Z][$_a-zA-Z0-9]*)/,/^\*\*\//,/^\*\s*?[\n][\s\S]*?(?=\*\*\/)/,/^\*\s*[\n]123123123\b/,/^\s+/,/^\)\s*:/,/^\*\s*-/,/^\*\s*fires\b/,/^\*\s*includes\b/,/^\*/,/^"(?:\\["bfnrt/\\]|\\u[a-fA-F0-9]{4}|[^"\\])*"/,/^'(?:\\["bfnrt/\\]|\\u[a-fA-F0-9]{4}|[^'\\])*'/,/^-?(?:[0-9]|[1-9][0-9]+)(?:\.[0-9]+)?(?:[eE][-+]?[0-9]+)?\b/,/^\/(?:[^\/]|\\\/)*\//,/^true\b/,/^false\b/,/^#/,/^@/,/^\?/,/^\.\.\./,/^\./,/^,/,/^->/,/^==/,/^=/,/^</,/^:/,/^\(/,/^\)/,/^\[/,/^\]/,/^\{/,/^\}/,/^\|/,/^class\b/,/^mixin\b/,/^new\b/,/^(?:[$_a-zA-Z][$_a-zA-Z0-9]*)/,/^[\s\S]*?(?=(\*\s*[-\n]))/,/^[\s\S]*?(?=\*\*\/)/]; | ||
lexer.conditions = {"INITIAL":{"rules":[0,1,2,3],"inclusive":true},"tags":{"rules":[0,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22],"inclusive":false},"def":{"rules":[0,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59],"inclusive":false},"arg":{"rules":[0,60],"inclusive":false},"comment":{"rules":[0,61],"inclusive":false}};return lexer;})() | ||
lexer.rules = [/^$/,/^\s+/,/^\/\*\*(?=([^/]))/,/^.*/,/^\*\*\//,/^\s*[\n]/,/^, /,/^: /,/^\.\./,/^#/,/^\./,/^\s+/,/^-?(?:[0-9]|[1-9][0-9]+)(?:\.[0-9]+)?(?:[eE][-+]?[0-9]+)?\b/,/^deprecated\b/,/^read-only\b/,/^internal\b/,/^chainable\b/,/^section\b/,/^alias of\b/,/^alias\b/,/^related to\b/,/^belongs to\b/,/^(?:[$_a-zA-Z][$_a-zA-Z0-9]*)/,/^\*\*\//,/^\*\s*?[\n][\s\S]*?(?=\*\*\/)/,/^\s+/,/^\)\s*:/,/^\*\s*-/,/^\*\s*fires\b/,/^\*\s*includes\b/,/^\*/,/^"(?:\\["bfnrt/\\]|\\u[a-fA-F0-9]{4}|[^"\\])*"/,/^'(?:\\["bfnrt/\\]|\\u[a-fA-F0-9]{4}|[^'\\])*'/,/^-?(?:[0-9]|[1-9][0-9]+)(?:\.[0-9]+)?(?:[eE][-+]?[0-9]+)?\b/,/^\/(?:[^\/]|\\\/)*\//,/^true\b/,/^false\b/,/^#/,/^@/,/^\?/,/^\.\.\./,/^\./,/^,/,/^->/,/^==/,/^=/,/^</,/^:/,/^\(/,/^\)/,/^\[/,/^\]/,/^\{/,/^\}/,/^\|/,/^class\b/,/^mixin\b/,/^new\b/,/^(?:[$_a-zA-Z][$_a-zA-Z0-9]*)/,/^[\s\S]*?(?=(\*\s*[-\n]))/,/^[\s\S]*?(?=\*\*\/)/]; | ||
lexer.conditions = {"INITIAL":{"rules":[0,1,2,3],"inclusive":true},"tags":{"rules":[0,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22],"inclusive":false},"def":{"rules":[0,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58],"inclusive":false},"arg":{"rules":[0,59],"inclusive":false},"comment":{"rules":[0,60],"inclusive":false}};return lexer;})() | ||
parser.lexer = lexer; | ||
@@ -668,0 +673,0 @@ return parser; |
{ | ||
"name" : "ndoc", | ||
"version" : "1.0.1", | ||
"version" : "1.0.2", | ||
"description" : "JavaScript API documentor with simple syntax that generates human-friendly documentation.", | ||
@@ -32,3 +32,4 @@ "keywords" : [ | ||
"jison" : "0.2.12", | ||
"stylus" : "0.19.3" | ||
"stylus" : "0.19.3", | ||
"jslint" : "https://github.com/reid/node-jslint/tarball/6131ebf5713274871b89735105e3286131804771" | ||
}, | ||
@@ -35,0 +36,0 @@ |
@@ -70,3 +70,3 @@ $(function () { | ||
if ($active !== targets[i].article && scrollTop >= targets[i].offset | ||
&& (!targets[i + 1].offset || scrollTop <= targets[i + 1].offset)) { | ||
&& (!targets[i + 1] || scrollTop <= targets[i + 1].offset)) { | ||
activate(targets[i].article, expandParents) | ||
@@ -73,0 +73,0 @@ return; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
761145
16667
3