2

In one of the sections of one technical document that I'm writing using reStructuredText I want to include a interactive session and this output.

Example:

>>> help(module)
    asdasd
    asdasd

    asdasd

When I process with sphinx-build to build a html output the output is not the expected because the blank line it breaks the block.

There is any way to fix the issue?

mzjn
  • 48,958
  • 13
  • 128
  • 248
ccarmona
  • 45
  • 5
  • What do you mean "it breaks the block"? This question is unclear. – Steve Piercy Mar 25 '20 at 12:40
  • @StevePiercy: When Sphinx renders that, it ends the "example" after the second line of asdasd and the next adasd is treated as the beginning of a new rST paragraph unrelated to the example. So it's not inside the nice box that code examples go in, any actual Python after that isn't syntax highlighted, etc. – jtniehof Jul 09 '20 at 20:43
  • Would `.. code-block:: pycon` do what you need? https://pygments.org/docs/lexers/#pygments.lexers.python.PythonConsoleLexer – Steve Piercy Jul 10 '20 at 01:58

0 Answers0