(recipes)=
# Recipes
```{rst-class} lead
Copy common integration patterns for GFM, tables of contents, heading IDs,
custom renderers, AST JSON output, and migration planning.
```
---
This page collects common tasks that are one step beyond the quick start.
## Enable GitHub-flavored Markdown
Use the `github` preset when you want tables, task list items, strikethrough,
bare URL autolinks, footnotes, and GFM disallowed HTML handling.
```python
from wenmode import Wenmode
from wenmode.presets import github
wenmode = Wenmode(github)
text = '''
- [x] done
| A | B |
| --- | --- |
| **x** | https://example.com |
'''
html = wenmode.render(text)
assert '' in html
assert '
' in html
assert 'https://example.com' in html
```
## Render a table of contents
Use heading rules with `id_transform=True` and register the built-in
`TableOfContents` directive renderer.
```python
from wenmode import Wenmode
from wenmode.directives import TableOfContents
from wenmode.rules import AtxHeading, LeafDirective
wenmode = Wenmode(
[AtxHeading(id_transform=True), LeafDirective],
directives=[TableOfContents()],
)
text = '''
::toc{min=2 max=3}
# Title
## Usage
'''
html = wenmode.render(text)
assert '