From: Guenter M. <mi...@us...> - 2018-08-15 07:45:18
|
On 2018-08-09, Glyn Davies wrote: > Hi Folks, > I am looking for a a way to include linux commandline output into my > RST/Sphinx documentation. > The issue is with random indentation and line length and while I can > trim the lines it spoils the readability of the output and removing the > indentation completely screws the context. Below is an example of the > kind of thing I would like to include if possible. The usual way to do this would be a `literal block`__. If the content resides in an external file, use `include`__ with the "literal" option. This keeps the formatting as-is and uses a fixed-width font. As a downside, you will evt. see very long lines (overrunning the page in LaTeX output, requiring scrolling in HTML). If this is a one-off, you could manually break overfull lines in the rST source. In HTML, you may solve this via CSS (separate side-scrolling for a fixed-width literal-block element). __ http://docutils.sf.net/docs/user/rst/quickref.html#literal-blocks __ http://docutils.sf.net/docs/ref/rst/directives.html#including-an-external-document-fragment `Class arguments`__ may be used to scale down the font size of blocks with too long lines. http://docutils.sf.net/docs/ref/rst/directives.html#class Your example contains line breaks that are probably from the terminal. Maybe using a full-screen terminal to capture the output helps. Hope this gets you started, Günter |