Python-Markdown extension to allow for subscript text.
Project description
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.
Installation
pip install MarkdownSubscript
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 Distributions
MarkdownSubscript-1.0c1.zip
(5.2 kB
view hashes)
Built Distribution
Close
Hashes for MarkdownSubscript-1.0c1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d403a24ee797aeeb763f4a9f1b00a8aaff9a0176196c201f4e19a6fcb03436e2 |
|
MD5 | 96332a6af3ec4ea4f1fe41da73a22a7d |
|
BLAKE2b-256 | 27d0c96aa6e1ac48616fc1ec1d7dde25a8954634697407d21e30da85b6e94952 |