Skip to content

Commit

Permalink
Markdown fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
JrMasterModelBuilder committed Oct 25, 2023
1 parent 763d389 commit 8193bea
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Bohrok Animations -- README
# Bohrok Animations README

Makuta has been defeated, but the danger is not past. The insect-like Bohrok swarms have awakened, bringing chaos and destruction everywhere they go. To stop them, the Toa must travel deep underground and be forever transformed.

Expand Down
17 changes: 17 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"archiver": "^6.0.1",
"innosetup": "^6.0.5",
"marked": "^9.1.2",
"marked-gfm-heading-id": "^3.1.0",
"tar": "^6.2.0"
}
}
4 changes: 3 additions & 1 deletion util/doc.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {readdir, readFile, stat, writeFile} from 'fs/promises';
import {pathToFileURL} from 'url';

import {marked} from 'marked';
import {gfmHeadingId} from 'marked-gfm-heading-id';

import {templateStrings} from './string.mjs';

Expand Down Expand Up @@ -35,12 +36,13 @@ export async function docs(src, dst) {
breaks: true,
smartypants: true
};
const ext = [gfmHeadingId({})];
await Promise.all(
(await readdir(src))
.filter(f => /^[^\.].*\.md$/i.test(f))
.sort()
.map(f => readFile(`${src}/${f}`, 'utf8').then(md => {
const body = marked(md, options).trim();
const body = marked.use(...ext)(md, options).trim();
const title = firstHeader(body);
return writeFile(
`${dst}/${f}`.replace(/\.md$/i, '.html'),
Expand Down

0 comments on commit 8193bea

Please sign in to comment.