diff options
Diffstat (limited to 'sandbox/code-block-directive/docs/myfunction.py.txt')
-rw-r--r-- | sandbox/code-block-directive/docs/myfunction.py.txt | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/sandbox/code-block-directive/docs/myfunction.py.txt b/sandbox/code-block-directive/docs/myfunction.py.txt index b9727e96f..cce27ea52 100644 --- a/sandbox/code-block-directive/docs/myfunction.py.txt +++ b/sandbox/code-block-directive/docs/myfunction.py.txt @@ -1,19 +1,43 @@ This is a test of the new "code" directive: -.. Translate this document to HTML with a pygments enhanced frontend, e.g. +.. Translate this document with a pygments enhanced frontend, e.g. - ../rst2html-highlight --stylesheet=../data/pygments-default.css + ../rst2html-highlight.py --stylesheet=../data/pygments-default.css + ../rst2latex-highlight.py --stylesheet=../data/pygments-docutilsroles.sty + + or via the test case in + + ../pygments_code_block_directive.py --traceback + - ../rst2latex-highlight --stylesheet=../data/pygments-docutilsroles.sty +The example from Docutils TODO list: + +.. code:: python + + print 'This is Python code.' + for i in range(10): + print i + +Numbered lines: + +.. code:: python + :number-lines: + + # This is Python code, + # that prints the integers from 0 to 9 + for i in range(10): + print i + +Another example: .. code:: python :class: silly + :name: my_function :number-lines: 7 def my_function(): """Test the lexer. - - just a test""" + """ # and now for something completely different print 8/2 |