Skip to content

Commit

Permalink
chore: fix building docs
Browse files Browse the repository at this point in the history
  • Loading branch information
UziTech committed Nov 13, 2021
1 parent 0cc7676 commit 66f30b5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions scripts/build-docs.js
Expand Up @@ -7,7 +7,7 @@ const { highlight } = require('highlight.js')
marked.use({
highlight: (code, lang) => {
if (lang) {
return highlight(lang, code).value
return highlight(code, { language: lang }).value
}

return code
Expand Down Expand Up @@ -100,7 +100,13 @@ async function createDocs () {
const branding = path.join(docs, 'branding')
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)

const highlightjsStyles = path.resolve(__dirname, '..', 'node_modules', 'highlight.js', 'styles')
Expand Down

0 comments on commit 66f30b5

Please sign in to comment.