Conversion to markdown based API docs.
With help from Matt Ranney <mjr@ranney.com>
This commit is contained in:
Родитель
6ecdeada49
Коммит
179f718d62
18
Makefile
18
Makefile
|
@ -41,30 +41,22 @@ benchmark: all
|
|||
|
||||
doc: doc/node.1 doc/api.html doc/index.html doc/changelog.html
|
||||
|
||||
doc/api.html: doc/api.txt
|
||||
asciidoc --unsafe \
|
||||
-a theme=pipe \
|
||||
-a toc \
|
||||
-a toclevels=1 \
|
||||
-a linkcss \
|
||||
-o doc/api.html doc/api.txt
|
||||
doc/api.html: doc/api.markdown
|
||||
ronn --html doc/api.markdown > doc/api.html
|
||||
|
||||
doc/changelog.html: ChangeLog
|
||||
echo '<html><head><title>Node.js ChangeLog</title> <link rel="stylesheet" href="./pipe.css" type="text/css" /> <link rel="stylesheet" href="./pipe-quirks.css" type="text/css" /> <body><h1>Node.js ChangeLog</h1> <pre>' > doc/changelog.html
|
||||
cat ChangeLog >> doc/changelog.html
|
||||
echo '</pre></body></html>' >> doc/changelog.html
|
||||
|
||||
doc/api.xml: doc/api.txt
|
||||
asciidoc -b docbook -d manpage -o doc/api.xml doc/api.txt
|
||||
|
||||
doc/node.1: doc/api.xml
|
||||
xsltproc --output doc/node.1 --nonet doc/manpage.xsl doc/api.xml
|
||||
doc/node.1: doc/api.markdown
|
||||
ronn --roff doc/api.markdown > doc/node.1
|
||||
|
||||
website-upload: doc
|
||||
scp doc/* ryan@nodejs.org:~/tinyclouds/node/
|
||||
|
||||
docclean:
|
||||
@-rm -f doc/node.1 doc/api.xml doc/api.html doc/changelog.html
|
||||
@-rm -f doc/node.1 doc/api.html doc/changelog.html
|
||||
|
||||
clean:
|
||||
@$(WAF) clean
|
||||
|
|
3
README
3
README
|
@ -10,8 +10,7 @@ To run the tests:
|
|||
|
||||
make test
|
||||
|
||||
To build the documentation and install it, you will need asciidoc and
|
||||
xsltproc:
|
||||
To build the documentation and install it, you will need ronn:
|
||||
|
||||
make doc install
|
||||
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
2033
doc/api.txt
2033
doc/api.txt
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,167 +0,0 @@
|
|||
var asciidoc = { // Namespace.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
// Table Of Contents generator
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
|
||||
/* Author: Mihai Bazon, September 2002
|
||||
* http://students.infoiasi.ro/~mishoo
|
||||
*
|
||||
* Table Of Content generator
|
||||
* Version: 0.4
|
||||
*
|
||||
* Feel free to use this script under the terms of the GNU General Public
|
||||
* License, as long as you do not remove or alter this notice.
|
||||
*/
|
||||
|
||||
/* modified by Troy D. Hanson, September 2006. License: GPL */
|
||||
/* modified by Stuart Rackham, 2006, 2009. License: GPL */
|
||||
|
||||
// toclevels = 1..4.
|
||||
toc: function (toclevels) {
|
||||
|
||||
function getText(el) {
|
||||
var text = "";
|
||||
for (var i = el.firstChild; i != null; i = i.nextSibling) {
|
||||
if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
|
||||
text += i.data;
|
||||
else if (i.firstChild != null)
|
||||
text += getText(i);
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
function TocEntry(el, text, toclevel) {
|
||||
this.element = el;
|
||||
this.text = text;
|
||||
this.toclevel = toclevel;
|
||||
}
|
||||
|
||||
function tocEntries(el, toclevels) {
|
||||
var result = new Array;
|
||||
var re = new RegExp('[hH]([2-'+(toclevels+1)+'])');
|
||||
// Function that scans the DOM tree for header elements (the DOM2
|
||||
// nodeIterator API would be a better technique but not supported by all
|
||||
// browsers).
|
||||
var iterate = function (el) {
|
||||
for (var i = el.firstChild; i != null; i = i.nextSibling) {
|
||||
if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
|
||||
var mo = re.exec(i.tagName);
|
||||
if (mo)
|
||||
result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
|
||||
iterate(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
iterate(el);
|
||||
return result;
|
||||
}
|
||||
|
||||
var toc = document.getElementById("toc");
|
||||
var entries = tocEntries(document.getElementById("content"), toclevels);
|
||||
for (var i = 0; i < entries.length; ++i) {
|
||||
var entry = entries[i];
|
||||
if (entry.element.id == "")
|
||||
entry.element.id = "_toc_" + i;
|
||||
var a = document.createElement("a");
|
||||
a.href = "#" + entry.element.id;
|
||||
a.appendChild(document.createTextNode(entry.text));
|
||||
var div = document.createElement("div");
|
||||
div.appendChild(a);
|
||||
div.className = "toclevel" + entry.toclevel;
|
||||
toc.appendChild(div);
|
||||
}
|
||||
if (entries.length == 0)
|
||||
toc.parentNode.removeChild(toc);
|
||||
},
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
// Footnotes generator
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
|
||||
/* Based on footnote generation code from:
|
||||
* http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
|
||||
*/
|
||||
|
||||
footnotes: function () {
|
||||
var cont = document.getElementById("content");
|
||||
var noteholder = document.getElementById("footnotes");
|
||||
var spans = cont.getElementsByTagName("span");
|
||||
var refs = {};
|
||||
var n = 0;
|
||||
for (i=0; i<spans.length; i++) {
|
||||
if (spans[i].className == "footnote") {
|
||||
n++;
|
||||
// Use [\s\S] in place of . so multi-line matches work.
|
||||
// Because JavaScript has no s (dotall) regex flag.
|
||||
note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
|
||||
noteholder.innerHTML +=
|
||||
"<div class='footnote' id='_footnote_" + n + "'>" +
|
||||
"<a href='#_footnoteref_" + n + "' title='Return to text'>" +
|
||||
n + "</a>. " + note + "</div>";
|
||||
spans[i].innerHTML =
|
||||
"[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
|
||||
"' title='View footnote' class='footnote'>" + n + "</a>]";
|
||||
var id =spans[i].getAttribute("id");
|
||||
if (id != null) refs["#"+id] = n;
|
||||
}
|
||||
}
|
||||
if (n == 0)
|
||||
noteholder.parentNode.removeChild(noteholder);
|
||||
else {
|
||||
// Process footnoterefs.
|
||||
for (i=0; i<spans.length; i++) {
|
||||
if (spans[i].className == "footnoteref") {
|
||||
var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
|
||||
href = href.match(/#.*/)[0]; // Because IE return full URL.
|
||||
n = refs[href];
|
||||
spans[i].innerHTML =
|
||||
"[<a href='#_footnote_" + n +
|
||||
"' title='View footnote' class='footnote'>" + n + "</a>]";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
(function() {
|
||||
var includes = ['sh_main.js', 'sh_javascript.min.js', 'sh_vim-dark.css'];
|
||||
var head = document.getElementsByTagName("head")[0];
|
||||
|
||||
for (var i = 0; i < includes.length; i ++) {
|
||||
var ext = includes[i].match(/\.([^.]+)$/);
|
||||
switch (ext[1]) {
|
||||
case 'js':
|
||||
var element = document.createElement('script');
|
||||
element.type = 'text/javascript';
|
||||
element.src = includes[i];
|
||||
break;
|
||||
case 'css':
|
||||
var element = document.createElement('link');
|
||||
element.type = 'text/css';
|
||||
element.rel = 'stylesheet';
|
||||
element.media = 'screen';
|
||||
element.href = includes[i];
|
||||
break;
|
||||
}
|
||||
|
||||
head.appendChild(element);
|
||||
}
|
||||
var i = setInterval(function () {
|
||||
if (window["sh_highlightDocument"]) {
|
||||
sh_highlightDocument();
|
||||
|
||||
try {
|
||||
var pageTracker = _gat._getTracker("UA-10874194-2");
|
||||
pageTracker._trackPageview();
|
||||
} catch(err) {}
|
||||
|
||||
clearInterval(i);
|
||||
}
|
||||
}, 100);
|
||||
|
||||
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
|
||||
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
|
||||
})();
|
|
@ -1,61 +0,0 @@
|
|||
<!--
|
||||
Inlcuded in xhtml.xsl, xhtml.chunked.xsl, htmlhelp.xsl.
|
||||
Contains common XSL stylesheets parameters.
|
||||
Output documents styled by docbook.css.
|
||||
-->
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
||||
<xsl:param name="html.stylesheet" select="'./docbook-xsl.css'"/>
|
||||
|
||||
<xsl:param name="htmlhelp.chm" select="'htmlhelp.chm'"/>
|
||||
<xsl:param name="htmlhelp.hhc.section.depth" select="5"/>
|
||||
|
||||
<xsl:param name="suppress.navigation" select="0"/>
|
||||
<xsl:param name="navig.graphics.extension" select="'.png'"/>
|
||||
<xsl:param name="navig.graphics" select="0"/>
|
||||
<xsl:param name="navig.graphics.path">./images/icons/</xsl:param>
|
||||
<xsl:param name="navig.showtitles">0</xsl:param>
|
||||
|
||||
<xsl:param name="shade.verbatim" select="0"/>
|
||||
<xsl:attribute-set name="shade.verbatim.style">
|
||||
<xsl:attribute name="border">0</xsl:attribute>
|
||||
<xsl:attribute name="bgcolor">#E0E0E0</xsl:attribute>
|
||||
</xsl:attribute-set>
|
||||
|
||||
<xsl:param name="admon.graphics" select="1"/>
|
||||
<xsl:param name="admon.graphics.path">./images/icons/</xsl:param>
|
||||
<xsl:param name="admon.graphics.extension" select="'.png'"/>
|
||||
<xsl:param name="admon.style">
|
||||
<xsl:text>margin-left: 0; margin-right: 10%;</xsl:text>
|
||||
</xsl:param>
|
||||
<xsl:param name="admon.textlabel" select="1"/>
|
||||
|
||||
<xsl:param name="callout.defaultcolumn" select="'60'"/>
|
||||
<xsl:param name="callout.graphics.extension" select="'.png'"/>
|
||||
<xsl:param name="callout.graphics" select="'1'"/>
|
||||
<xsl:param name="callout.graphics.number.limit" select="'10'"/>
|
||||
<xsl:param name="callout.graphics.path" select="'./images/icons/callouts/'"/>
|
||||
<xsl:param name="callout.list.table" select="'1'"/>
|
||||
|
||||
<xsl:param name="base.dir" select="'./xhtml/'"/>
|
||||
<xsl:param name="chunk.first.sections" select="0"/>
|
||||
<xsl:param name="chunk.quietly" select="0"/>
|
||||
<xsl:param name="chunk.section.depth" select="1"/>
|
||||
<xsl:param name="chunk.toc" select="''"/>
|
||||
<xsl:param name="chunk.tocs.and.lots" select="0"/>
|
||||
|
||||
<xsl:param name="html.cellpadding" select="'4px'"/>
|
||||
<xsl:param name="html.cellspacing" select="''"/>
|
||||
|
||||
<xsl:param name="table.borders.with.css" select="1"/>
|
||||
<xsl:param name="table.cell.border.color" select="''"/>
|
||||
|
||||
<xsl:param name="table.cell.border.style" select="'solid'"/>
|
||||
<xsl:param name="table.cell.border.thickness" select="'1px'"/>
|
||||
<xsl:param name="table.footnote.number.format" select="'a'"/>
|
||||
<xsl:param name="table.footnote.number.symbols" select="''"/>
|
||||
<xsl:param name="table.frame.border.color" select="'#527bbd'"/>
|
||||
<xsl:param name="table.frame.border.style" select="'solid'"/>
|
||||
<xsl:param name="table.frame.border.thickness" select="'2px'"/>
|
||||
<xsl:param name="tablecolumns.extension" select="'1'"/>
|
||||
|
||||
</xsl:stylesheet>
|
109
doc/toc.js
109
doc/toc.js
|
@ -1,109 +0,0 @@
|
|||
/* Author: Mihai Bazon, September 2002
|
||||
* http://students.infoiasi.ro/~mishoo
|
||||
*
|
||||
* Table Of Content generator
|
||||
* Version: 0.4
|
||||
*
|
||||
* Feel free to use this script under the terms of the GNU General Public
|
||||
* License, as long as you do not remove or alter this notice.
|
||||
*/
|
||||
|
||||
/* modified by Troy D. Hanson, September 2006. License: GPL */
|
||||
/* modified by Stuart Rackham, October 2006. License: GPL */
|
||||
|
||||
function getText(el) {
|
||||
var text = "";
|
||||
for (var i = el.firstChild; i != null; i = i.nextSibling) {
|
||||
if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
|
||||
text += i.data;
|
||||
else if (i.firstChild != null)
|
||||
text += getText(i);
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
function TocEntry(el, text, toclevel) {
|
||||
this.element = el;
|
||||
this.text = text;
|
||||
this.toclevel = toclevel;
|
||||
}
|
||||
|
||||
function tocEntries(el, toclevels) {
|
||||
var result = new Array;
|
||||
var re = new RegExp('[hH]([2-'+(toclevels+1)+'])');
|
||||
// Function that scans the DOM tree for header elements (the DOM2
|
||||
// nodeIterator API would be a better technique but not supported by all
|
||||
// browsers).
|
||||
var iterate = function (el) {
|
||||
for (var i = el.firstChild; i != null; i = i.nextSibling) {
|
||||
if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
|
||||
var mo = re.exec(i.tagName)
|
||||
if (mo)
|
||||
result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
|
||||
iterate(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
iterate(el);
|
||||
return result;
|
||||
}
|
||||
|
||||
// This function does the work. toclevels = 1..4.
|
||||
function generateToc(toclevels) {
|
||||
var toc = document.getElementById("toc");
|
||||
var entries = tocEntries(document.getElementsByTagName("body")[0], toclevels);
|
||||
for (var i = 0; i < entries.length; ++i) {
|
||||
var entry = entries[i];
|
||||
if (entry.element.id == "")
|
||||
entry.element.id = "toc" + i;
|
||||
var a = document.createElement("a");
|
||||
a.href = "#" + entry.element.id;
|
||||
a.appendChild(document.createTextNode(entry.text));
|
||||
var div = document.createElement("div");
|
||||
div.appendChild(a);
|
||||
div.className = "toclevel" + entry.toclevel;
|
||||
toc.appendChild(div);
|
||||
}
|
||||
if (entries.length == 0)
|
||||
document.getElementById("header").removeChild(toc);
|
||||
}
|
||||
|
||||
(function() {
|
||||
var includes = ['sh_main.js', 'sh_javascript.min.js', 'sh_vim-dark.css'];
|
||||
var head = document.getElementsByTagName("head")[0];
|
||||
|
||||
for (var i = 0; i < includes.length; i ++) {
|
||||
var ext = includes[i].match(/\.([^.]+)$/);
|
||||
switch (ext[1]) {
|
||||
case 'js':
|
||||
var element = document.createElement('script');
|
||||
element.type = 'text/javascript';
|
||||
element.src = includes[i];
|
||||
break;
|
||||
case 'css':
|
||||
var element = document.createElement('link');
|
||||
element.type = 'text/css';
|
||||
element.rel = 'stylesheet';
|
||||
element.media = 'screen';
|
||||
element.href = includes[i];
|
||||
break;
|
||||
}
|
||||
|
||||
head.appendChild(element);
|
||||
}
|
||||
var i = setInterval(function () {
|
||||
if (window["sh_highlightDocument"]) {
|
||||
sh_highlightDocument();
|
||||
|
||||
try {
|
||||
var pageTracker = _gat._getTracker("UA-10874194-2");
|
||||
pageTracker._trackPageview();
|
||||
} catch(err) {}
|
||||
|
||||
clearInterval(i);
|
||||
}
|
||||
}, 100);
|
||||
|
||||
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
|
||||
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
|
||||
})();
|
Загрузка…
Ссылка в новой задаче