Skip to content

Commit

Permalink
add marked.use section to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
UziTech committed Apr 20, 2020
1 parent 1050460 commit d5de6af
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/USING_PRO.md
Expand Up @@ -2,6 +2,16 @@

To champion the single-responsibility and open/closed principles, we have tried to make it relatively painless to extend marked. If you are looking to add custom functionality, this is the place to start.

<h2 id="use">marked.use()</h2>

`marked.use(options)` is the recommended way to extend marked. The options object can contain any [option](#/USING_ADVANCED.md#options) available in marked.

The `renderer` and `tokenizer` options can be an object with functions that will be merged into the `renderer` and `tokenizer` respectively.

The `renderer` and `tokenizer` functions can return false to fallback to the previous function.

All other options will overwrite previously set options.

<h2 id="renderer">The renderer</h2>

The renderer defines the output of the parser.
Expand Down
1 change: 1 addition & 0 deletions docs/index.html
Expand Up @@ -154,6 +154,7 @@ <h1>Marked.js Documentation</h1>
<li>
<a href="#/USING_PRO.md">Extensibility</a>
<ul>
<li><a href="#/USING_PRO.md#use">marked.use()</a></li>
<li><a href="#/USING_PRO.md#renderer">Renderer</a></li>
<li><a href="#/USING_PRO.md#tokenizer">Tokenizer</a></li>
<li><a href="#/USING_PRO.md#lexer">Lexer</a></li>
Expand Down

0 comments on commit d5de6af

Please sign in to comment.