Skip to content

Commit

Permalink
Merge branch 'develop' into polish-prism
Browse files Browse the repository at this point in the history
  • Loading branch information
Koooooo-7 authored Aug 22, 2024
2 parents c8c733f + e204ac6 commit 04b7f5f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions docs/markdown.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Markdown configuration

**docsify** uses [marked](https://github.com/markedjs/marked) as its Markdown parser. You can customize how it renders your Markdown content to HTML by customizing `renderer`:
**docsify** uses [marked v13+](https://github.com/markedjs/marked) as its Markdown parser. You can customize how it renders your Markdown content to HTML by customizing `renderer`:

```js
window.$docsify = {
Expand Down Expand Up @@ -31,23 +31,24 @@ window.$docsify = {

## Supports mermaid

!> Currently, docsify doesn't support the async mermaid render (the latest mermaid version supported is `v9.3.0`).

```js
// Import mermaid
// <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.css">
// <script src="//cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
// <script src="//cdn.jsdelivr.net/npm/mermaid@9.3.0/dist/mermaid.min.js"></script>

let num = 0;
mermaid.initialize({ startOnLoad: false });

window.$docsify = {
markdown: {
renderer: {
code(code, lang) {
code({ text, lang }) {
if (lang === 'mermaid') {
return /* html */ `
<div class="mermaid">${mermaid.render(
'mermaid-svg-' + num++,
code,
text,
)}</div>
`;
}
Expand Down

0 comments on commit 04b7f5f

Please sign in to comment.