File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -184,3 +184,23 @@ markedWorker.onmessage = (e) => {
184
184
185
185
markedWorker .postMessage (markdownString);
186
186
```
187
+ <h2 id =" cli-extensions " >CLI Extensions</h2 >
188
+
189
+ You can use extensions in the CLI by creating a new CLI that imports marked and the marked binary.
190
+
191
+ ``` js
192
+ // file: myMarked
193
+ #! / usr/ bin/ node
194
+
195
+ import { marked } from ' marked' ;
196
+ import customHeadingId from ' marked-custom-heading-id' ;
197
+
198
+ marked .use (customHeadingId ());
199
+
200
+ import ' marked/bin/marked' ;
201
+ ```
202
+
203
+ ``` sh
204
+ $ ./myMarked -s " # heading {#custom-id}"
205
+ < h1 id=" custom-id" > heading< /h1>
206
+ ```
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ <h1>Marked Documentation</h1>
43
43
< li > < a href ="/using_advanced#inline "> Inline Markdown</ a > </ li >
44
44
< li > < a href ="/using_advanced#highlight "> Highlighting</ a > </ li >
45
45
< li > < a href ="/using_advanced#workers "> Workers</ a > </ li >
46
+ < li > < a href ="/using_advanced#cli-extensions "> CLI Extensions</ a > </ li >
46
47
</ ul >
47
48
</ li >
48
49
< li >
You can’t perform that action at this time.
0 commit comments