mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
Added a single page version, moved index to be standard page.
This commit is contained in:
1 parent
c032350f64
commit
d4f1e6a023
3 files changed
+41
-4
No files matched your search
@@ -0,0 +1,33 @@
|
||||
|
||||
@include synopsis
|
||||
@include globals
|
||||
@include timers
|
||||
@include modules
|
||||
@include addons
|
||||
@include process
|
||||
@include constants
|
||||
@include util
|
||||
@include freelist
|
||||
@include events
|
||||
@include buffers
|
||||
@include streams
|
||||
@include crypto
|
||||
@include securepair
|
||||
@include string_decoder
|
||||
@include fs
|
||||
@include path
|
||||
@include net
|
||||
@include dns
|
||||
@include dgram
|
||||
@include http
|
||||
@include url
|
||||
@include querystring
|
||||
@include readline
|
||||
@include repl
|
||||
@include script
|
||||
@include child_processes
|
||||
@include assert
|
||||
|
||||
# Appendixes
|
||||
@include appendix_1
|
||||
@include appendix_2
|
||||
File renamed without changes.
@@ -31,12 +31,13 @@ var step = function(){
|
||||
};
|
||||
|
||||
|
||||
var includeExpr = /^@include\s+([A-Za-z0-9-_]+).([a-zA-Z]+)$/gmi;
|
||||
var includeExpr = /^@include\s+([A-Za-z0-9-_]+)(?:\.)?([a-zA-Z]*)$/gmi;
|
||||
function convertData(data){
|
||||
// Allow including other pages in the data.
|
||||
data = data.replace(includeExpr, function(src, name, ext){
|
||||
try {
|
||||
return fs.readFileSync(path.join(doc_root, name+"."+ext), "utf8");
|
||||
var inc_path = path.join(doc_root, name+"."+(ext || "markdown"));
|
||||
return fs.readFileSync(inc_path, "utf8");
|
||||
} catch(e) {
|
||||
return "";
|
||||
}
|
||||
@@ -100,7 +101,10 @@ function convertFiles(next){
|
||||
if(err) throw err;
|
||||
|
||||
files.filter(function(file){
|
||||
return path.extname(file) == ".markdown";
|
||||
var basename = path.basename(file, ".markdown");
|
||||
return path.extname(file) == ".markdown" &&
|
||||
basename != "index" &&
|
||||
basename != "_toc";
|
||||
}).forEach(function(file){
|
||||
var filename = path.basename(file, '.markdown')
|
||||
, build_path = path.join(build_root, filename+".html")
|
||||
@@ -126,7 +130,7 @@ function convertFiles(next){
|
||||
};
|
||||
|
||||
function createIndex(next){
|
||||
fs.readFile(path.join(doc_root, "_index.markdown"), "utf8", function(err, data){
|
||||
fs.readFile(path.join(doc_root, "index.markdown"), "utf8", function(err, data){
|
||||
if(err) throw err;
|
||||
|
||||
// do conversion stuff.
|
||||
|
||||
Reference in new issue
Block a user