Home | History | Annotate | Download | only in extensions
      1 Abbreviations
      2 -------------
      3 
      4 Summary
      5 -------
      6 
      7 The Markdown Abbreviation Extension adds the ability to define abbreviations. 
      8 Specifically, any defined abbreviation is wrapped in  an `<abbr>` tag.
      9 
     10 The Abbreviation extension is included in the standard Markdown library.
     11 
     12 Syntax
     13 ------
     14 
     15 Abbreviations are defined using the syntax established in 
     16 [PHP Markdown Extra][php].
     17 
     18 [php]: http://www.michelf.com/projects/php-markdown/extra/#abbr
     19 
     20 Thus, the following text (taken from the above referenced PHP documentation):
     21 
     22     The HTML specification 
     23     is maintained by the W3C.
     24         
     25     *[HTML]: Hyper Text Markup Language
     26     *[W3C]:  World Wide Web Consortium
     27 
     28 will be rendered like so:
     29 
     30     <p>The <abbr title="Hyper Text Markup Language">HTML</abbr> specification 
     31     is maintained by the <abbr title="World Wide Web Consortium">W3C</abbr>.</p>
     32 
     33 Usage
     34 -----
     35 
     36 From the Python interpreter:
     37 
     38     >>> import markdown
     39     >>> text = """
     40     ... Some text with an ABBR.
     41     ...
     42     ... *[ABBR]: Abbreviation
     43     ... """
     44     >>> html = markdown.markdown(text, ['abbr'])
     45 
     46 To use with other extensions, just add them to the list, like this:
     47 
     48     >>> html = markdown.markdown(text, ['abbr', 'footnotes'])
     49 
     50 Abbreviations can also be called from the command line using Markdown's `-x` 
     51 parameter, like so:
     52 
     53     markdown.py -x abbr source.txt > output.html
     54