aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/extensions/code_hilite.txt25
-rw-r--r--docs/release-2.3.txt9
2 files changed, 28 insertions, 6 deletions
diff --git a/docs/extensions/code_hilite.txt b/docs/extensions/code_hilite.txt
index fbf05b3..31ecfbb 100644
--- a/docs/extensions/code_hilite.txt
+++ b/docs/extensions/code_hilite.txt
@@ -41,6 +41,13 @@ blocks, with one exception. The hiliter needs to know what language to use for
the code block. There are three ways to tell the hiliter what language the code
block contains and each one has a different result.
+!!! Note
+The format of the language identifier only effects the display of line numbers
+if `linenums` is set to `None` (the default). If set to `True` or `False`
+(see [Usage](#usage) below) the format of the identifier has no effect on the
+display of line numbers -- it only serves as a means to define the language
+of the code block.
+
[syntax]: http://daringfireball.net/projects/markdown/syntax#precode
###SheBang (with path)
@@ -107,19 +114,25 @@ Usage
From the Python interpreter:
- >>> html = markdown.markdown(text, ['codehilite'])
+ >>> html = markdown.markdown(text, extensions=['codehilite'])
+
+If you want to force every code block to have line numbers, even when using
+colons (`:::`) for language identification, set `linenums` to `True`.
+
+ >>> html = markdown.markdown(text,
+ ... extensions=['codehilite(linenums=True)']
+ ... )
-If you want every code block to have line numbers, even when using colons
-(`:::`) for language identification, the setting `force_linenos` is available
-to do so.
+If you do **not** want any code block to have line numbers, even when using
+SheBangs (`#!`) for language identification, set `linenums` to `False`.
>>> html = markdown.markdown(text,
- ... ['codehilite(force_linenos=True)']
+ ... extensions=['codehilite(linenums=False)']
... )
If you want to prevent Pygments from guessing the language, only highlighting
blocks when you explicitly request it, set the `guess_lang` setting to 'False'.
>>> html = markdown.markdown(text,
- ... ['codehilite(guess_lang=False)']
+ ... extensions=['codehilite(guess_lang=False)']
... )
diff --git a/docs/release-2.3.txt b/docs/release-2.3.txt
index e7a6414..e8a6257 100644
--- a/docs/release-2.3.txt
+++ b/docs/release-2.3.txt
@@ -29,6 +29,15 @@ reference to those ids in your JavaScript or CSS and using the HTML5 output,
you will need to update your code accordingly. No changes are necessary if
you are outputing XHTML (the default) or HTML4.
+* The "force_linenos" config setting of the CodeHilite extension has been
+marked as Pending Deprecation and a new setting "linenums" has been added to
+replace it. See documentation for the [CodeHilite Extension] for an explaination
+of the new "linenums" setting. The new setting will honor the old "force_linenos"
+if it is set, but it will raise a PendingDeprecationWarning and will likely be
+removed in a future version of Python-Markdown.
+
+[CodeHilite Extension]: extensions/codehilite.html
+
* The "RSS" extension has been removed and no longer ships with Python-Markdown.
If you would like to continue using the extension (not recomended), it is archived
on [Github](https://gist.github.com/waylan/4773365).