File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -87,3 +87,37 @@ class Highlighter extends Component
8787
8888export default Highlighter ;
8989```
90+
91+ ### Marp
92+
93+ To use in [ marp] ( https://marp.app )
94+
95+ First create file ` engine.js `
96+
97+ ``` js
98+ const { Marp } = require (' @marp-team/marp-core' )
99+ const hljs = require (' highlight.js' )
100+ const iecst = require (' highlightjs-structured-text' )
101+ hljs .registerLanguage (" ices" , iecst)
102+
103+ module .exports = (opts ) => {
104+ const marp = new Marp (opts)
105+
106+ marp .highlighter = (code , lang ) => {
107+ if (lang) {
108+ return hljs .getLanguage (lang)
109+ ? hljs .highlight (lang, code, true ).value
110+ : ' '
111+ }
112+ return hljs .highlightAuto (code).value
113+ }
114+
115+ return marp
116+ }
117+ ```
118+
119+ And now when you build with CLI add engine parameter,
120+
121+ ``` bash
122+ npx marp --engine ./enjine.js ./slides.md
123+ ```
You can’t perform that action at this time.
0 commit comments