mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-20 04:05:52 +00:00
Add table of contents to docs
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
'use strict';
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const execSync = require('child_process').execSync;
|
||||
const ejs = require('ejs');
|
||||
const renderFromPaths =
|
||||
require('json-schema-to-markdown-table').renderFromPaths;
|
||||
@@ -39,9 +40,9 @@ function main() {
|
||||
console.error(error);
|
||||
process.exit(1);
|
||||
} else {
|
||||
const outputPath = process.argv.length > 2 ? process.argv[2] :
|
||||
path.join(ROOT, 'docs', 'index.md');
|
||||
const outputPath = path.join(ROOT, 'docs', 'index.md');
|
||||
fs.writeFileSync(outputPath, output);
|
||||
execSync('npm run doctoc', {cwd: ROOT});
|
||||
process.exit(0);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -37,7 +37,10 @@ integrationtest() {
|
||||
}
|
||||
|
||||
doctest() {
|
||||
node --harmony scripts/build_docs.js docs/index.md.test
|
||||
mv docs/index.md docs/index.md.save
|
||||
npm run docgen
|
||||
mv docs/index.md docs/index.md.test
|
||||
mv docs/index.md.save docs/index.md
|
||||
cmp docs/index.md docs/index.md.test
|
||||
rm docs/index.md.test
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user