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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file MarkdownSubscript-1.0.1.zip.
File metadata
- Download URL: MarkdownSubscript-1.0.1.zip
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae973a7e9572dda5c600f2071d659e30a1f916cc4c1604b7d09ab0a915901923
|
|
| MD5 |
b9b6ffd3743da70d8179c8bb8bdae056
|
|
| BLAKE2b-256 |
da9cba895de2f4f9d7f052bda1a9c304f227920740e1495b05e0625bcdfdbe1a
|
File details
Details for the file MarkdownSubscript-1.0.1.tar.gz.
File metadata
- Download URL: MarkdownSubscript-1.0.1.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e55dcfdc55cc6c614d809a6b89b3627672d1b4d2d467fdda31d9531270bb6677
|
|
| MD5 |
e9fed3ff67419db178671a19979d449b
|
|
| BLAKE2b-256 |
297fc8ab8631967d3c2caaa5c9967545073624d8bfefde2550a916db91133b2a
|
File details
Details for the file MarkdownSubscript-1.0.1-py2.py3-none-any.whl.
File metadata
- Download URL: MarkdownSubscript-1.0.1-py2.py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb12a5cd1223fb8e99b818755a06a608dfe5eb7284d190cc643076fcaeb19519
|
|
| MD5 |
0b5a5bbfbec58cc5258caf021d80ca13
|
|
| BLAKE2b-256 |
f90e024dd27ee6a0f54d7f649d1c36f8540428ca20835ae688eeebd00ea24fa3
|