Login
or
register
Overview
Introduction
Features
Credits
License
This Wiki
Status
News
Releases
Change Log
Recent Wiki Edits
User Guide
Installation
Command Line
Using as a Module
Integration
Reporting Bugs
Advanced
Mailing List
Source Code
Test Suite
Extensions
Extensions
Writing Extensions
Available Extensions
Related Projects
Fenced_Code_Blocks
Fenced Code Blocks
Anonymous users must enter
captcha
below.
Don't put anything here
Page Content
### Summary This extension adds a secondary way to define code blocks which overcomes a few limitations of the indented code blocks. This extension is included in the standard Markdown library. ### Syntax Fenced Code Blocks are defined using the syntax established in [PHP Markdown Extra][php]. [php]: http://www.michelf.com/projects/php-markdown/extra/#fenced-code-blocks Thus, the following text (taken from the above referenced PHP documentation): This is a paragraph introducing: ~~~~~~~~~~~~~~~~~~~~ a one-line code block ~~~~~~~~~~~~~~~~~~~~ Fenced code blocks can have a blank line as the first and/or last line of a code block and they can also come immediately after a list item without becoming part of the list. In addition to PHP Extra's syntax, you can define the language of the code block for use by syntax highlighters etc. The language will be assigned as a class attribute of the ``<code>`` element in the output. Therefore, you should define the language as you would a css class - ``.language``. For consistency with other markdown syntax, the language can *optionally* be wrapped in curly brackets: ~~~~{.python} # python code ~~~~ ~~~~.html <p>HTML Document</p> ~~~~ The above will output: <pre><code class="python"># python code </code></pre> <pre><code class="html"><p>HTML Document</p> </code></pre> ### Usage From the Python interpreter: >>> html = markdown.markdown(text, ['fenced_code'])
Don't put anything here
Advanced Fields
Page Name (for URL)
Page Title
Breadcrumb Text
Category
Available Extensions
Change Log
Command Line
Credits
Extensions
Features
Installation
Integration
Introduction
License
Mailing List
News
Recent Wiki Edits
Related Projects
Releases
Reporting Bugs
Source Code
Test Suite
This Wiki
Using as a Module
Writing Extensions
Don't put anything here
Don't put anything here
About This Edit
Minor Edit
Edit Summary
Don't put anything here
Don't put anything here
save
preview
cancel
Powered by
Sputnik
|
XHTML 1.1