diff options
| author | shimizukawa <shimizukawa@gmail.com> | 2014-01-18 20:41:43 +0900 |
|---|---|---|
| committer | shimizukawa <shimizukawa@gmail.com> | 2014-01-18 20:41:43 +0900 |
| commit | dc62e8d7ea844a4b2ac7bd880d2d3966deebb207 (patch) | |
| tree | 76ea87ca4e9a71f1262724673d1654f03e08c117 /doc/markup/code.rst | |
| parent | 22bff8279d4d2d0096152337ae2b6b3951f92e29 (diff) | |
| parent | 39287f95535866e2d4d1544f8688ce22fd19a69a (diff) | |
| download | sphinx-dc62e8d7ea844a4b2ac7bd880d2d3966deebb207.tar.gz | |
merge heads
Diffstat (limited to 'doc/markup/code.rst')
| -rw-r--r-- | doc/markup/code.rst | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/doc/markup/code.rst b/doc/markup/code.rst index c0e7e8eb..6e707e00 100644 --- a/doc/markup/code.rst +++ b/doc/markup/code.rst @@ -62,8 +62,8 @@ installed) and handled in a smart way: * ``c`` * ... and any other lexer name that Pygments supports. -* If highlighting with the selected language fails, the block is not highlighted - in any way. +* If highlighting with the selected language fails (i.e. Pygments emits an + "Error" token), the block is not highlighted in any way. Line numbers ^^^^^^^^^^^^ @@ -86,6 +86,14 @@ on line numbers for the individual block:: Some more Ruby code. +The first line number can be selected with the ``lineno-start`` option. If +present, ``linenos`` is automatically activated as well. + + .. code-block:: ruby + :lineno-start: 10 + + Some more Ruby code, with line numbering starting at 10. + Additionally, an ``emphasize-lines`` option can be given to have Pygments emphasize particular lines:: @@ -101,6 +109,9 @@ emphasize particular lines:: .. versionchanged:: 1.1 ``emphasize-lines`` has been added. +.. versionchanged:: 1.3 + ``lineno-start`` has been added. + Includes ^^^^^^^^ @@ -121,10 +132,11 @@ Includes Tabs in the input are expanded if you give a ``tab-width`` option with the desired tab width. - The directive also supports the ``linenos`` flag option to switch on line - numbers, the ``emphasize-lines`` option to emphasize particular lines, and - a ``language`` option to select a language different from the current - file's standard language. Example with options:: + Like :rst:dir:`code-block`, the directive supports the ``linenos`` flag + option to switch on line numbers, the ``lineno-start`` option to select the + first line number, the ``emphasize-lines`` option to emphasize particular + lines, and a ``language`` option to select a language different from the + current file's standard language. Example with options:: .. literalinclude:: example.rb :language: ruby |
