Browse Source

Fix docs generator

pull/979/head
Vitaly Puzrin 1 year ago
parent
commit
4f3bb4916e
  1. 2
      package.json
  2. 8
      support/build_doc.mjs

2
package.json

@ -19,7 +19,7 @@
"test": "npm run lint && c8 mocha && node support/specsplit.mjs", "test": "npm run lint && c8 mocha && node support/specsplit.mjs",
"coverage": "npm run test && c8 report --reporter html", "coverage": "npm run test && c8 report --reporter html",
"report-coveralls": "c8 --reporter=lcov mocha", "report-coveralls": "c8 --reporter=lcov mocha",
"doc": "node support/build_doc.js", "doc": "node support/build_doc.mjs",
"gh-doc": "npm run doc && gh-pages -d apidoc -f", "gh-doc": "npm run doc && gh-pages -d apidoc -f",
"demo": "npm run lint && node support/build_demo.js", "demo": "npm run lint && node support/build_demo.js",
"gh-demo": "npm run demo && gh-pages -d demo -f -b master -r git@github.com:markdown-it/markdown-it.github.io.git", "gh-demo": "npm run demo && gh-pages -d demo -f -b master -r git@github.com:markdown-it/markdown-it.github.io.git",

8
support/build_doc.js → support/build_doc.mjs

@ -1,10 +1,6 @@
#!/usr/bin/env node #!/usr/bin/env node
'use strict'; import shell from 'shelljs';
/* eslint-env es6 */
const shell = require('shelljs');
shell.rm('-rf', 'apidoc'); shell.rm('-rf', 'apidoc');
@ -12,4 +8,4 @@ const head = shell.exec('git show-ref --hash HEAD').stdout.slice(0, 6);
const link_format = `https://github.com/{package.repository}/blob/${head}/{file}#L{line}`; const link_format = `https://github.com/{package.repository}/blob/${head}/{file}#L{line}`;
shell.exec(`node node_modules/.bin/ndoc --link-format "${link_format}"`); shell.exec(`node node_modules/.bin/ndoc --alias mjs:js --link-format "${link_format}"`);
Loading…
Cancel
Save