2.0.0-alpha.11 • Published 9 months ago
@yozora/html-admonition v2.0.0-alpha.11
This component is for rendering the Yozora Markdown AST node IAdmonition
produced by @yozora/tokenizer-admonition into HTML string.
This component has been built into @yozora/html-markdown, you can use it directly.
Install
npm
npm install --save @yozora/html-admonition
yarn
yarn add @yozora/html-admonition
Usage
Basic:
import type { Admonition, Node } from '@yozora/ast' import { createNodeRendererContext } from '@yozora/core-html-renderer' import renderAdmonition from '@yozora/html-admonition' const context = createNodeRendererContext( {}, // definitionMap {}, // footnoteDefinitionMap ) const admonition = { "type": "admonition", "keyword": "note", "title": [ { "type": "text", "value": "optional title" } ], "children": [ { "type": "paragraph", "children": [ { "type": "text", "value": "some content" } ] } ] } renderAdmonition(admonition as Admonition, context) // => <div class="yozora-admonition yozora-admonition--default"><div class="yozora-admonition__heading"><h5><span class="yozora-text">optional title</span></h5></div><div class="yozora-admonition__body"><p class="yozora-paragraph"><span class="yozora-text">some content</span></p></div></div>
Related
2.0.0-alpha.11
9 months ago
2.0.0-alpha.10
10 months ago
2.0.0-alpha.9
2 years ago
2.0.0-alpha.7
2 years ago
2.0.0-alpha.8
2 years ago
2.0.0-alpha.6
2 years ago
2.0.0-alpha.3
3 years ago
2.0.0-alpha.4
3 years ago
2.0.0-alpha.5
3 years ago
2.0.0-alpha.0
4 years ago
2.0.0-alpha.1
3 years ago
2.0.0-alpha.2
3 years ago
1.0.0-alpha.4
4 years ago
1.0.0-alpha.3
4 years ago
1.0.0-alpha.2
4 years ago
1.0.0-alpha.1
4 years ago
1.0.0-alpha.0
4 years ago