Python-Markdown extension to allow for subscript text.
Project description
Read Me
An extension to the Python Markdown project which adds the ability to
subscript text. To do so, the character ~
becomes a Markdown tag
for text meant to be subscripted, and is replaced with the HTML
sub
tag.
For example, given the text:
The molecular composition of water is H~2~O.
… using Markdown with this extension will output:
<p>The molecular composition of water is H<sub>2</sub>O.</p>
This project is provided under the Simplified (2 Clause) BSD license, provided in full in the LICENSE file.
Installation
Dependencies:
Python 2.7, 3.3+
Markdown 2.5+ (Tested against latest patch version of Markdown 2.5 and 2.6)
To install the latest stable release (recommended):
pip install MarkdownSubscript
To install the development version:
pip install git+git://github.com/jambonrose/markdown_subscript_extension.git
Basic Usage
Python
>>> from markdown import markdown
>>> text = "The molecular composition of water is H~2~O."
>>> markdown(text, ['subscript'])
'<p>The molecular composition of water is H<sub>2</sub>O.</p>'
Command Line
$ echo 'The molecular composition of water is H~2~O.' > text.md
$ python -m markdown -o html5 -x 'subscript' -f text.html text.md
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for MarkdownSubscript-2.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d5acd3edcd276102d78b5e5875202f9e9fa009c28a651bf829478b0cce6daca |
|
MD5 | e8c7d902bcbfc0aa2f11971c954129cd |
|
BLAKE2b-256 | 550481998c05cc5e0773564e32111469eb972f3e59b296f6de833d1e5566412e |