Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problem with blank line in interactive session

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?

like image 660
ccarmona Avatar asked Jun 28 '26 20:06

ccarmona


1 Answers

Doctest blocks are text blocks which begin with ">>> ", the Python interactive interpreter main prompt, and end with a blank line. --rST Markup Specification

You may use an indented literal block or a "code" or "code-block" directive.

.. code:: pycon

   >>> help(module)
       asdasd
       asdasd

       asdasd
like image 137
G. Milde Avatar answered Jul 01 '26 16:07

G. Milde