removed old doc gen stuff from Makefile
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by TJ Holowaychuk · committed by TJ Holowaychuk · parent c483dab · Browse files · 2 files·+1 added−67 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
2 files+1 added−67 removed
- other:+1 added−67 removed
Provenance
- Commit
36bab54- Tree
748c884- Author
TJ Holowaychuk <tj@vision-media.ca>- Committer
TJ Holowaychuk <tj@vision-media.ca>- Parent
c483dab
2 files changed+1 added−67 removed
deleted:support/toc.js-44 removed
1234567891011121314151617181920212223242526272829303132333435363738394041424344#!/usr/bin/env node
var fs = require('fs'), file = process.argv[2];
if (file) { var html = fs.readFileSync(file, 'utf8') , toc = ['<ul id="toc">'] , sections = {};
html = html.replace(/<h3>(.*?)<\/h3>/g, function(_, title){ var id = title.toLowerCase().replace(' ', '-').replace(/\(.*?\)/, '()'); if (~title.indexOf('.')) { var parts = title.split('.') , recv = parts.shift() , method = parts.shift().replace(/\(.*?\)/, '()'); if (recv == 'app') recv = 'Server'; if (recv == 'req') recv = 'Request'; if (recv == 'res') recv = 'Response'; sections[recv] = sections[recv] || []; sections[recv].push('<li><a href="#' + id + '">' + method + '</a></li>'); } else { toc.push('<li><a href="#' + id + '">' + title + '</a></li>'); } return '<h3 id="' + id + '">' + title + '</h3>'; });
toc.push(renderSections()); toc.push('</ul>'); html = html.replace('<div id="container">', '<div id="container">' + toc.join('\n')); fs.writeFileSync(file, html);}
function renderSections() { var buf = []; Object.keys(sections).forEach(function(section){ var methods = sections[section], a = '<a href="#" class="toggle">+</a> <a class="section-title" href="#">' + section + '</a>'; buf.push('<li>' + a + '<ul class="section" id="section-' + section + '">'); buf.push(methods.join('\n')); buf.push('</ul></li>'); }); return buf.join('\n');}No newline at end of filemodified:Makefile+1 added-23 removed
1 2-DOCS = docs/*.md3-HTMLDOCS = $(DOCS:.md=.html)2 REPORTER = dot3 4 test:5 @NODE_ENV=test ./node_modules/.bin/mocha \3 unmodified lines9 @NODE_ENV=test ./node_modules/.bin/mocha \10 --reporter spec \11 test/acceptance/*.js12 15-docs: $(HTMLDOCS)16- @ echo "... generating TOC"17- @./support/toc.js docs/guide.html18-19-%.html: %.md20- @echo "... $< -> $@"21- @markdown $< \22- | cat docs/layout/head.html - docs/layout/foot.html \23- > $@24-13 test-cov: lib-cov14 @EXPRESS_COV=1 $(MAKE) test REPORTER=html-cov > coverage.html15 16 lib-cov:17 @jscoverage lib lib-cov18 31-site:32- rm -fr /tmp/docs \33- && cp -fr docs /tmp/docs \34- && git checkout gh-pages \35- && cp -fr /tmp/docs/* . \36- && echo "done"37-19 benchmark:20 @./support/bench21 41-docclean:42- rm -f docs/*.{1,html}43-44-.PHONY: site test benchmark docs docclean test-acceptance22+.PHONY: site test benchmark test-acceptance