pyweb.py test/test_rst.w generate wrong ReST
Literate Programming in pure Python
Brought to you by:
slott56
$ cd pyweb-2.1
$ python ../pyweb.py test_rst.w
The generated test_rst.rst contain something like this:
.. _`1`:
.. rubric:: test.py (1)
.. parsed-literal::
|srarr| Import the os module (`3`_)
|srarr| Get the OS description (`4`_)
|srarr| Construct the message with Concatenation (`5`_)
|srarr| Print the message (`7`_)
which is wrong. The correct is like (indent |srarr|):
.. _`1`:
.. rubric:: test.py (1)
.. parsed-literal::
|srarr| Import the os module (`3`_)
|srarr| Get the OS description (`4`_)
|srarr| Construct the message with Concatenation (`5`_)
|srarr| Print the message (`7`_)
spaces got lost when rendered by tracker. In face the correct ReSt
should be like this, with '4spaces' replaced by 4 spaces:
.. _`1`:
.. rubric:: test.py (1)
.. parsed-literal::
4spaces|srarr| Import the os module (`3`_)
4spaces|srarr| Get the OS description (`4`_)
4spaces|srarr| Construct the message with Concatenation (`5`_)
4spaces|srarr| Print the message (`7`_)
Confirmed. It seems to be some problem in the emitter class. Adding a code_indent=0 and setting the context with
self.context= [self.code_indent]
seems to fix the problem.