add autostructify section to main readme

This commit is contained in:
Chris Ewald 2016-03-10 15:36:12 -05:00
parent ee2c52035d
commit 1a52eba1c7

View file

@ -34,6 +34,36 @@ source_suffix = ['.rst', '.md']
This allows you to write both `.md` and `.rst` files inside of the same project.
### AutoStructify
To use the advanced markdown to rst transformations you must add `AutoStructify` to your Sphinx conf.py.
```python
# At top on conf.py (with other import statements)
import recommonmark
from recommonmark.transform import AutoStructify
# At the bottom of conf.py
def setup(app):
app.add_config_value('recommonmark_config', {
'url_resolver': lambda url: github_doc_root + url,
'auto_toc_tree_section': 'Contents',
}, True)
app.add_transform(AutoStructify)
```
See https://github.com/rtfd/recommonmark/blob/master/docs/conf.py for a full example.
AutoStructify comes with the following options. See http://recommonmark.readthedocs.org/en/latest/auto_structify.html for more information about the specific features.
* enable_auto_toc_tree: enable the Auto Toc Tree feature.
* auto_toc_tree_section: when True, Auto Toc Tree will only be enabled on section that matches the title.
* enable_auto_doc_ref: enable the Auto Doc Ref feature.
* enable_math: enable the Math Formula feature.
* enable_inline_math: enable the Inline Math feature.
* enable_eval_rst: enable the evaluate embedded reStructuredText feature.
* url_resolver: a function that maps a existing relative position in the document to a http link
## Development
You can run the tests by running `tox` in the top-level of the project.