A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://markdown-subscript-extension.readthedocs.io/en/latest/usage.html below:

Website Navigation


Usage — MarkdownSubscript 2.1.1 documentation

Usage Python
>>> from markdown import markdown
>>> from mdx_subscript import SubscriptExtension
>>> text = "The molecular composition of water is H~2~O."
>>> markdown(text, extensions=[SubscriptExtension()])
'<p>The molecular composition of water is H<sub>2</sub>O.</p>'

You may also refer to the extension by module name or short module name.

>>> markdown(text, extensions=['mdx_subscript'])
>>> markdown(text, extensions=['subscript'])

Note

In older versions of Markdown, you will need to refer to the module without the mdx prefix (the second line of code above).

Command Line
$ echo 'The molecular composition of water is H~2~O.' > text.md
$ python -m markdown -o html -x 'mdx_subscript' -f text.html text.md
$ cat text.html
<p>The molecular composition of water is H<sub>2</sub>O.</p>

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4