File: example.rst

package info (click to toggle)
python-sybil 9.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,148 kB
  • sloc: python: 4,510; makefile: 90
file content (27 lines) | stat: -rw-r--r-- 620 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Sample Documentation
====================

Let's put something in the Sybil document's namespace:

.. invisible-code-block: python

  remember_me = b'see how namespaces work?'

Suppose we define a function, convoluted and pointless but shows stuff nicely:

.. code-block:: python

  import sys

  def prefix_and_print(message):
      print('prefix:', message.decode('ascii'))

Now we can use a doctest REPL to show it in action:

>>> prefix_and_print(remember_me)
prefix: see how namespaces work?

The namespace carries across from example to example, no matter what parser:

>>> remember_me
b'see how namespaces work?'