Skip to content

Commit

Permalink
Add docs on new parse_text function
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjsewell committed Feb 28, 2020
1 parent c5b3b95 commit d37c12d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions docs/using/use_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,24 @@ MyST-Parser may be used as an API *via* the `myst_parser` package.
The raw text is first parsed to syntax 'tokens',
then these are converted to other formats using 'renderers'.

The simplest way to parse text is using:

```python
from myst_parser import parse_text
parse_text("some *text*", "html")
```

```html
'<p>some <em>text</em></p>\n'
```

The output type can be one of:

- `dict` (a.k.a ast)
- `html`
- `docutils`
- `sphinx`

## Convert Text to Tokens

To convert some text to tokens:
Expand Down

0 comments on commit d37c12d

Please sign in to comment.