Skip to content

Commit

Permalink
Fix docs generator
Browse files Browse the repository at this point in the history
  • Loading branch information
puzrin committed Nov 21, 2023
1 parent 1c49695 commit 4f3bb49
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"test": "npm run lint && c8 mocha && node support/specsplit.mjs",
"coverage": "npm run test && c8 report --reporter html",
"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",
"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",
Expand Down
8 changes: 2 additions & 6 deletions support/build_doc.js → support/build_doc.mjs
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
#!/usr/bin/env node

'use strict';

/* eslint-env es6 */

const shell = require('shelljs');
import shell from 'shelljs';

shell.rm('-rf', 'apidoc');

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}`;

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}"`);

0 comments on commit 4f3bb49

Please sign in to comment.