Clean up code-block-directive sandbox project.
[docutils/kirr.git] / sandbox / code-block-directive / docs / myfunction.py.txt
blob7d632a7d5c25e6c8686e8645eef81b5034209206
1 This is a test of the new "code" directive:
3 .. Translate this document with a pygments enhanced frontend, e.g.
5     ../rst2html-highlight.py --stylesheet=../data/pygments-default.css
6     ../rst2latex-highlight.py --stylesheet=../data/pygments-docutilsroles.sty
7     
8    or via the test case in
9    
10     ../pygments_code_block_directive.py --traceback
11     
13 The example from Docutils TODO list:
15 .. code:: python
17   print 'This is Python code.'
18   for i in range(10):
19       print i
21 Numbered lines:
23 .. code:: python
24   :number-lines:
26   # This is Python code,
27   # that prints the integers from 0 to 9
28   for i in range(10):
29       print i
31 Another example:
33 .. code:: python
34   :class: silly
35   :name: my_function
36   :number-lines: 7
38   def my_function():
39       """Test the lexer.
40       """
42       # and now for something completely different
43       print 8/2
45 Inline code :code:`$\alpha = \int_0^\infty f(x) dx$`.
47 .. role:: python(code)
48    :language: python
49    :class: testclass
51 Python code :python:`print("The end.")`