aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@gmail.com>2014-01-07 14:48:07 -0800
committerWaylan Limberg <waylan@gmail.com>2014-01-07 14:48:07 -0800
commit809195fb900c8e8bd3ff65a2e69de78075224096 (patch)
tree210eb67b03202906ab375b27d40744365b294fd4 /docs
parent3e03dd14b3f47f1482e91da155834afc25d6458f (diff)
parentf6b4f7c74dc4215847008cb8a59c03e63b9268e0 (diff)
downloadmarkdown-809195fb900c8e8bd3ff65a2e69de78075224096.tar.gz
markdown-809195fb900c8e8bd3ff65a2e69de78075224096.tar.bz2
markdown-809195fb900c8e8bd3ff65a2e69de78075224096.zip
Merge pull request #274 from ajdavis/highlight-lines
Add feature for emphasizing some lines in a code block.
Diffstat (limited to 'docs')
-rw-r--r--docs/extensions/code_hilite.txt11
-rw-r--r--docs/extensions/fenced_code_blocks.txt25
2 files changed, 36 insertions, 0 deletions
diff --git a/docs/extensions/code_hilite.txt b/docs/extensions/code_hilite.txt
index ab09742..92f60f8 100644
--- a/docs/extensions/code_hilite.txt
+++ b/docs/extensions/code_hilite.txt
@@ -91,6 +91,17 @@ block contains and each one has a different result.
# Code goes here ...
+ Certain lines can be selected for emphasis with the colon syntax. By
+ default, emphasized lines have a yellow background. This is useful to
+ direct the reader's attention.
+
+ :::python hl_lines="1 3"
+ # This line is emphasized
+ # This line isn't
+ # This line is emphasized
+
+ (`hl_lines` is named for Pygments' "highlighted lines" option.)
+
* ###When No Language is Defined
CodeHilite is completely backward compatible so that if a code block is
diff --git a/docs/extensions/fenced_code_blocks.txt b/docs/extensions/fenced_code_blocks.txt
index c54c5bd..0148c80 100644
--- a/docs/extensions/fenced_code_blocks.txt
+++ b/docs/extensions/fenced_code_blocks.txt
@@ -35,6 +35,8 @@ 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
+
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
@@ -66,6 +68,29 @@ The above will output:
[Github]: http://github.github.com/github-flavored-markdown/
+### 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:
+
+ ~~~~{.python hl_lines="1 3"}
+ # This line is emphasized
+ # This line isn't
+ # This line is emphasized
+
+... or with GitHub's:
+
+ ```python hl_lines="1 3"
+ # This line is emphasized
+ # This line isn't
+ # This line is emphasized
+
+(`hl_lines` is named for Pygments' "highlighted lines" option.)
+
+[Pygments]: http://pygments.org/
+
Usage
-----