Python-Markdown extension that uses smartypants to provide typographically nicer ("curly") quotes, proper ("em" and "en") dashes, etc.
Project description
A Python-Markdown extension that uses smartypants to provide typographically nicer ("curly") quotes, proper ("em" and "en") dashes, etc.
Installation
============
Use::
pip install mdx_smartypants
Or::
easy_install mdx_smartypants
(You may need to begin these with "sudo ".)
Usage
=====
To use::
import markdown
import mdx_smartypants
md = markdown.Markdown(extensions=['smartypants'])
md_text = """
This is some Markdown. It's pretty nice, and simple. But--it could
really use some typographic "prettification." That... That would
be sweet. Definitely 7---8 on a '10-point scale'.
Huzzah!
"""
print md.convert(md_text)
This produces nice HTML output, including typographically "pretty" quotes and other
punctuation. It also renders HTML entites in their named rather than numeric form
for easier-on-the-eyes, more-rapidly-comprehended HTML::
<p>This is some Markdown. It’s pretty nice, and simple. But—it could
really use some typographic “prettification.” That… That would
be sweet. Definitely 7–8 on a ‘10-point scale’.</p>
<p>Huzzah!</p>
Which renders as:
.. raw:: html
<p>This is some Markdown. It’s pretty nice, and simple. But—it could
really use some typographic “prettification.” That… That would
be sweet. Definitely 7–8 on a ‘10-point scale’.</p>
<p>Huzzah!</p>
Installation
============
Use::
pip install mdx_smartypants
Or::
easy_install mdx_smartypants
(You may need to begin these with "sudo ".)
Usage
=====
To use::
import markdown
import mdx_smartypants
md = markdown.Markdown(extensions=['smartypants'])
md_text = """
This is some Markdown. It's pretty nice, and simple. But--it could
really use some typographic "prettification." That... That would
be sweet. Definitely 7---8 on a '10-point scale'.
Huzzah!
"""
print md.convert(md_text)
This produces nice HTML output, including typographically "pretty" quotes and other
punctuation. It also renders HTML entites in their named rather than numeric form
for easier-on-the-eyes, more-rapidly-comprehended HTML::
<p>This is some Markdown. It’s pretty nice, and simple. But—it could
really use some typographic “prettification.” That… That would
be sweet. Definitely 7–8 on a ‘10-point scale’.</p>
<p>Huzzah!</p>
Which renders as:
.. raw:: html
<p>This is some Markdown. It’s pretty nice, and simple. But—it could
really use some typographic “prettification.” That… That would
be sweet. Definitely 7–8 on a ‘10-point scale’.</p>
<p>Huzzah!</p>
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
mdx_smartypants-1.0.1.tar.gz
(2.8 kB
view hashes)