chore: fix building docs

This commit is contained in:
Tony Brix 2021-11-13 01:08:01 -06:00
parent 0cc7676897
commit 66f30b566e
1 changed files with 8 additions and 2 deletions

View File

@ -7,7 +7,7 @@ const { highlight } = require('highlight.js')
marked.use({ marked.use({
highlight: (code, lang) => { highlight: (code, lang) => {
if (lang) { if (lang) {
return highlight(lang, code).value return highlight(code, { language: lang }).value
} }
return code return code
@ -100,7 +100,13 @@ async function createDocs () {
const branding = path.join(docs, 'branding') const branding = path.join(docs, 'branding')
const src = path.join(branding, 'public') const src = path.join(branding, 'public')
await fs.rmdir(dist, { recursive: true }) try {
await fs.rm(dist, { recursive: true })
} catch (ex) {
if (ex.code !== 'ENOENT') {
throw ex
}
}
await copyRecursive(src, dist) await copyRecursive(src, dist)
const highlightjsStyles = path.resolve(__dirname, '..', 'node_modules', 'highlight.js', 'styles') const highlightjsStyles = path.resolve(__dirname, '..', 'node_modules', 'highlight.js', 'styles')