Commits

Jonathan Eunice  committed 3b2ef3a

simplified example

  • Participants
  • Parent commits 673145a

Comments (0)

Files changed (6)

 Installation
 ============
 
-Use::
+::
 
     pip install mdx_smartypants
     
-Or::
+Failing that, fall back to the older approach::
 
     easy_install mdx_smartypants
     
 Usage
 =====
 
-To use::
-
+::
+  
     import markdown
     import mdx_smartypants
     
-    md = markdown.Markdown(extensions=['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.
     
-    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!
+    Huzzah!
     """
+    
+    print markdown.markdown(text, extensions=['smartypants'])
 
-    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, which is easier on the eyes and more readily comprehended::
 
-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&rsquo;s pretty nice, and simple. But&mdash;it could
-    really use some typographic &ldquo;prettification.&rdquo; That&hellip; That would
-    be sweet. Definitely 7&ndash;8 on a &lsquo;10-point scale&rsquo;.</p>
+    <p>Markdown makes HTML from simple text files. But&mdash;it lacks
+    typographic &ldquo;prettification.&rdquo; That&hellip; That&rsquo;d be
+    sweet. Definitely 7&ndash;8 on a &lsquo;10-point scale&rsquo;. Now it has
+    it.</p>
     <p>Huzzah!</p>
 Installation
 ============
 
-Use::
+::
 
     pip install mdx_smartypants
     
-Or::
+Failing that, fall back to the older approach::
 
     easy_install mdx_smartypants
     
 Usage
 =====
 
-To use::
-
+::
+  
     import markdown
     import mdx_smartypants
     
-    md = markdown.Markdown(extensions=['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.
     
-    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!
+    Huzzah!
     """
+    
+    print markdown.markdown(text, extensions=['smartypants'])
 
-    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, which is easier on the eyes and more readily comprehended::
 
-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&rsquo;s pretty nice, and simple. But&mdash;it could
-    really use some typographic &ldquo;prettification.&rdquo; That&hellip; That would
-    be sweet. Definitely 7&ndash;8 on a &lsquo;10-point scale&rsquo;.</p>
+    <p>Markdown makes HTML from simple text files. But&mdash;it lacks
+    typographic &ldquo;prettification.&rdquo; That&hellip; That&rsquo;d be
+    sweet. Definitely 7&ndash;8 on a &lsquo;10-point scale&rsquo;. Now it has
+    it.</p>
     <p>Huzzah!</p>
 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'.
+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 md.convert(md_text)
-
+print markdown.markdown(text, extensions=['smartypants'])
 
 # Expected output:
 
-# <p>This is some Markdown. It&rsquo;s pretty nice, and simple. But&mdash;it could
-# really use some typographic &ldquo;prettification.&rdquo; That&hellip; That would
-# be sweet. Definitely 7&ndash;8 on a &lsquo;10-point scale&rsquo;.</p>
-# <p>Huzzah!</p>
+# <p>Markdown makes HTML from simple text files. But&mdash;it lacks typographic
+# &ldquo;prettification.&rdquo; That&hellip; That&rsquo;d be sweet. Definitely
+# 7&ndash;8 on a &lsquo;10-point scale&rsquo;. Now it has it.</p>
+# <p>Huzzah!</p>

File mdx_smartypants.egg-info/PKG-INFO

 Metadata-Version: 1.0
 Name: mdx-smartypants
-Version: 1.0.1
+Version: 1.0.2
 Summary: Python-Markdown extension that uses smartypants to provide typographically nicer ("curly") quotes, proper ("em" and "en") dashes, etc.
 Home-page: http://bitbucket.org/jeunice/mdx_smartypants
 Author: Jonathan Eunice
             really use some typographic &ldquo;prettification.&rdquo; That&hellip; That would
             be sweet. Definitely 7&ndash;8 on a &lsquo;10-point scale&rsquo;.</p>
             <p>Huzzah!</p>
-            
-        Which renders as:
         
-        .. raw:: html
-        
-        <p>This is some Markdown. It&rsquo;s pretty nice, and simple. But&mdash;it could
-        really use some typographic &ldquo;prettification.&rdquo; That&hellip; That would
-        be sweet. Definitely 7&ndash;8 on a &lsquo;10-point scale&rsquo;.</p>
-        <p>Huzzah!</p>
 Platform: UNKNOWN
 Classifier: Development Status :: 4 - Beta
 Classifier: Operating System :: OS Independent

File mdx_smartypants.py

     def extendMarkdown(self, md, md_globals):
         md.postprocessors.add('smartypants', SmartypantsPost(md), '_end')
 
-
 def makeExtension(configs=None):
-    return SmartypantsExt(configs=configs)
+    return SmartypantsExt(configs=configs)
 README_TEXT = readme.read()
 readme.close()
 
-
 setup(
     name='mdx_smartypants',
-    version='1.0.1',
+    version='1.0.2',
     author='Jonathan Eunice',
     author_email='jonathan.eunice@gmail.com',
     description='Python-Markdown extension that uses smartypants to provide typographically nicer ("curly") quotes, proper ("em" and "en") dashes, etc.',