diff options
author | Waylan Limberg <waylan@gmail.com> | 2014-02-16 08:53:16 -0500 |
---|---|---|
committer | Waylan Limberg <waylan@gmail.com> | 2014-02-16 08:53:16 -0500 |
commit | 9a03243ff51ce2e868cfd2de713d7de6ae84140e (patch) | |
tree | 9c81612ef756024dd205022d250fc65e2e11eb3a /docs/extensions/fenced_code_blocks.txt | |
parent | fefe904ca9175ab390a8a0868e810a41945cdd8f (diff) | |
parent | aff7cabd5fa16daff866c06e056804d3f6f42500 (diff) | |
download | markdown-9a03243ff51ce2e868cfd2de713d7de6ae84140e.tar.gz markdown-9a03243ff51ce2e868cfd2de713d7de6ae84140e.tar.bz2 markdown-9a03243ff51ce2e868cfd2de713d7de6ae84140e.zip |
Merge pull request #288 from lahwaacz/master
docs: improved documentation
Diffstat (limited to 'docs/extensions/fenced_code_blocks.txt')
-rw-r--r-- | docs/extensions/fenced_code_blocks.txt | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/docs/extensions/fenced_code_blocks.txt b/docs/extensions/fenced_code_blocks.txt index 0148c80..206f6da 100644 --- a/docs/extensions/fenced_code_blocks.txt +++ b/docs/extensions/fenced_code_blocks.txt @@ -1,5 +1,5 @@ -title: Fenced Code Block Extension -prev_title: Definition List Extension +title: Fenced Code Blocks Extension +prev_title: Definition Lists Extension prev_url: definition_lists.html next_title: Footnotes Extension next_url: footnotes.html @@ -10,8 +10,8 @@ Fenced Code Blocks Summary ------- -This extension adds a secondary way to define code blocks which overcomes a few -limitations of the indented code blocks. +The Fenced Code Blocks 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. @@ -35,7 +35,7 @@ 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. -### Language +### Language ### 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 @@ -60,7 +60,7 @@ The above will output: <pre><code class="html"><p>HTML Document</p> </code></pre> -[Github][]'s tilde (`\``) syntax is also supported: +[Github][]'s backtick (`\``) syntax is also supported: ```python # more python code @@ -68,17 +68,23 @@ The above will output: [Github]: http://github.github.com/github-flavored-markdown/ -### Emphasized Lines +### Emphasized Lines ### -If [Pygments][] is installed, this extension can emphasize certain lines of -code. By default, emphasized lines have a yellow background. This is useful to -direct the reader's attention. The lines can be specified with PHP Extra's -syntax: +If you would like to have your fenced code blocks highlighted with the +[CodeHilite][] extension, simply enable that extension (remember that +[Pygments][] is its dependency) and the language of your fenced code blocks +will be passed in and highlighted appropriately. + +Similar to the [colon][] syntax of the CodeHilite extension, fenced code blocks +can also have emphasized certain lines of code. + +The lines can be specified with PHP Extra's syntax: ~~~~{.python hl_lines="1 3"} # This line is emphasized # This line isn't # This line is emphasized + ~~~~ ... or with GitHub's: @@ -86,22 +92,16 @@ syntax: # This line is emphasized # This line isn't # This line is emphasized + ``` -(`hl_lines` is named for Pygments' "highlighted lines" option.) - +[CodeHilite]: code_hilite.html [Pygments]: http://pygments.org/ +[colon]: code_hilite.html#colons Usage ----- -From the Python interpreter: - - >>> html = markdown.markdown(text, ['fenced_code']) - -If you would like to have your fenced code blocks highlighted with the -[CodeHilite][] extension, simply include that extension and the language -of your fenced code blocks will be passed in and highlighted appropriately. - - >>> html = markdown.markdown(text, ['fenced_code', 'codehilite']) +See [Extensions](index.html) for general extension usage, specify `fenced_code` +as the name of the extension. -[CodeHilite]: code_hilite.html +This extension does not accept any special configuration options. |