mdx_smartypants iconmdx_smartypants 1.2

Python-Markdown extension using smartypants to emit typographically nicer ("curly") quotes, proper ("em" and "en") dashes, etc
mdx_smartypants is a Markdown extension using smartypants to emit typographically nicer ("curly") quotes, proper ("em" and "en") dashes, etc.

Installation

pip install mdx_smartypants

Failing that, fall back to the older approach:

easy_install mdx_smartypants

(You may need to begin these with "sudo " to authorize installation.)

Usage

import markdown
import mdx_smartypants

text = """
Markdown makes HTML from simple text files. But--it lacks typographic
"prettification." That... That'd be sweet. Definitely 7---8 on a '10-point
scale'. Now it has it.

Huzzah!
"""


print markdown.markdown(text, extensions=['smartypants'])


This produces nice HTML output, including typographically "pretty" quotes and other punctuation. It also renders HTML entites in their named rather than numeric form, which is easier on the eyes and more readily comprehended:

< p >Markdown makes HTML from simple text files. But—it lacks
typographic “prettification.” That… That’d be
sweet. Definitely 7–8 on a ‘10-point scale’. Now it has
it.< /p >
< p >Huzzah!< /p >

last updated on:
June 6th, 2012, 10:59 GMT
price:
FREE!
developed by:
Jonathan Eunice
license type:
BSD License 
category:
ROOT \ Text Editing&Processing \ Markup

FREE!

In a hurry? Add it to your Download Basket!

user rating

UNRATED
0.0/5
 

0/5

Add your review!

SUBMIT