restructuredText built-in literal that can be wrapped to the next line (for PDF output)

I am using restructuredText to create a report that includes the output of the Tom log file.

I have several sections with numbered lists of literals. It looks like this:

#. ''some log file output''
#. ''more output''

Now the problem is that when I convert from this PDF file to the rst2pdf file, literals can sometimes be quite long and leak from the page.

I would like to mark a section of text as literal code that can go to the next line, like plain text.

I want this because if I do not mark the output of the log file as a literal, sometimes there is some fuzziness in the output of the log file, which the first interprets as built-in markup or other commands related to the first.

Any other suggestions on how to do this best?

I know that I can make sure that in the original first file there are only lines of a certain width, but this will make the source file horrible and make it cumbersome to edit.

I tried the following 2 things that do not help:

I found the rst2pdf option:

--fit-literal-mode=MODE
                What to do when a literal is too wide.
                One of error,overflow,shrink,truncate. 
                Default="shrink"

After some research, I found a mention of a wrapper for literals. I got rst2pdf for uploading the default stylesheet using:

rst2pdf --print-stylesheetwhich I then saved and changed so that the wordWrapunder option literalwas changed to CJK.

+4
source share

Source: https://habr.com/ru/post/1547202/


All Articles