基本语法风格的标记扩展。
mdxflavours的Python项目详细描述
可用扩展名
目前提供两个扩展:
- autobr - for converting line breaks to br-tags
- autolink - for automatically converting urls to links
安装
从GitHub:
$ git clone git://github.com/05bit/python-mdxflavours.git
并将mdxflavours添加到pythonpath:
$ export PYTHONPATH=$PYTHONPATH:$(pwd)/mdxflavours/
或:
$ cd mdxflavours $ python setup.py install
注意:导入包mdxflavours将自动添加所需的 系统路径的路径。
用法
自动换行示例:
>>> import markdown >>> markdown.markdown(u'And may the force \nbe with you!') # no extension >>> u'<p>And may the force<br />\nbe with you!</p>' >>> markdown.markdown(u'And may the force\nbe with you!', extensions=['autobr']) >>> u'<p>And may the force<br />\nbe with you!</p>'