Skip to content

Commit 4cc50e4

Browse files
author
Filippo Conti
committed
Merged documentation branch
2 parents 9ee09e6 + 33df5e4 commit 4cc50e4

File tree

263 files changed

+76491
-4825
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

263 files changed

+76491
-4825
lines changed

.babelrc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"presets": [
3-
"es2015",
4-
"stage-2"
3+
"es2015"
54
]
6-
}
5+
}

.jsdoc.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"tags": {
3+
"allowUnknownTags": true
4+
},
5+
"source": {
6+
"include": ["src"],
7+
"includePattern": ".+\\.js(doc|x)?$",
8+
"excludePattern": "(^|\\/|\\\\)_"
9+
},
10+
"plugins": ["plugins/markdown"],
11+
"markdown": {
12+
"idInHeadings": true
13+
},
14+
"templates": {
15+
"cleverLinks": true,
16+
"monospaceLinks": true,
17+
"default": {
18+
"outputSourceFiles": true
19+
}
20+
},
21+
"opts": {
22+
"template": "node_modules/jsdoc-template",
23+
"tutorials": "tutorials",
24+
"destination": "docs",
25+
"readme": "README.md",
26+
"recurse": true
27+
}
28+
}

build-docs.js

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
'use strict';
2+
3+
const fs = require('fs');
4+
const path = require('path');
5+
const documentation = require('documentation');
6+
7+
const config = [
8+
{
9+
files: './src/index.js',
10+
format: "md",
11+
filename: "README.md",
12+
destination: path.resolve(__dirname, 'docs'),
13+
options: {
14+
shallow: true
15+
}
16+
},
17+
{
18+
files: ["./src/ast.js", "./src/ast"],
19+
format: "md",
20+
filename: "AST.md",
21+
destination: path.resolve(__dirname, 'docs'),
22+
options: {
23+
shallow: false
24+
}
25+
},
26+
{
27+
files: ["./src/parser.js", "./src/parser"],
28+
format: "md",
29+
filename: "parser.md",
30+
destination: path.resolve(__dirname, 'docs'),
31+
options: {
32+
shallow: false
33+
}
34+
},
35+
{
36+
files: ["./src/lexer.js", "./src/lexer"],
37+
format: "md",
38+
filename: "lexer.md",
39+
destination: path.resolve(__dirname, 'docs'),
40+
options: {
41+
shallow: false
42+
}
43+
}
44+
];
45+
46+
config.reduce((p, obj) => {
47+
return p.then(() => {
48+
return documentation.build(obj.files, obj.options)
49+
.then(documentation.formats[obj.format])
50+
.then(output => {
51+
console.log(`File ${obj.filename} has been written.`);
52+
fs.writeFileSync(path.join(obj.destination, obj.filename), output);
53+
});
54+
})
55+
}, Promise.resolve()).then(() => {
56+
console.log('All files has been written.');
57+
}).catch(err => {
58+
console.error(err);
59+
})

docs/AST.html

Lines changed: 606 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)