Skip to content

Commit

Permalink
Merge pull request #1417 from mido-app/update-doc-about-extending-ren…
Browse files Browse the repository at this point in the history
…derer

Update documentation about extending Renderer
  • Loading branch information
styfle authored Feb 13, 2019
2 parents c77a224 + c3cc6a2 commit d9d6758
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions docs/USING_PRO.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,30 @@ console.log(myMarked('# heading+', { renderer: renderer }));

### Block level renderer methods

- code(*string* code, *string* language, *boolean* escaped)
- code(*string* code, *string* infostring, *boolean* escaped)
- blockquote(*string* quote)
- html(*string* html)
- heading(*string* text, *number* level, *string* rawtext)
- heading(*string* text, *number* level, *string* raw, *Slugger* slugger)
- hr()
- list(*string* body, *boolean* ordered, *number* start)
- listitem(*string* text)
- checkbox(*boolean* checked)
- paragraph(*string* text)
- table(*string* header, *string* body)
- tablerow(*string* content)
- tablecell(*string* content, *object* flags)

`slugger` has the `slug` method to create an unique id from value:

```js
slugger.slug('foo') // foo
slugger.slug('foo') // foo-1
slugger.slug('foo') // foo-2
slugger.slug('foo 1') // foo-1-1
slugger.slug('foo-1') // foo-1-2
...
```

`flags` has the following properties:

```js
Expand Down

0 comments on commit d9d6758

Please sign in to comment.