Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/csharp-4.0/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python sphinx 重构文本换行符打断代码块_Python Sphinx_Restructuredtext - Fatal编程技术网

Python sphinx 重构文本换行符打断代码块

Python sphinx 重构文本换行符打断代码块,python-sphinx,restructuredtext,Python Sphinx,Restructuredtext,嗨,谢谢你关注我的问题!所以我使用StructuredText和Sphinx来生成一组文档。每个页面必须符合PEP8,因此每行最多有80个字符。这是一个新的要求,并且正在打破好几页 当我们过去有: .. code-block:: bash really really long line of code that I would want a new user to copy and paste into a terminal 我们现在有: .. code-block:: bash

嗨,谢谢你关注我的问题!所以我使用StructuredText和Sphinx来生成一组文档。每个页面必须符合PEP8,因此每行最多有80个字符。这是一个新的要求,并且正在打破好几页

当我们过去有:

.. code-block:: bash
    really really long line of code that I would want a new user to copy and paste into a terminal
我们现在有:

.. code-block:: bash
    really really long line of code that
    I would want a new user to copy and
    paste into a terminal
这是一个问题,因为粘贴到终端时,每一行都被视为单独的命令。阅读我看到的文档,我可以做如下事情:

| really really long line of code that I 
  would want a new user to copy and paste
  into a terminal

使我的文本适合一行,但这不会保持我想要的块样式或语法高亮显示。有人知道实现我所追求的目标的方法吗?提前感谢您的所有反馈

您应该能够使用反斜杠来指示该行继续。它转义换行符

.. code-block:: bash

   really really long line of code that \
   I would want a new user to copy and \
   paste into a terminal
当粘贴到端子中时,该命令被解释为一条长线


看。

这就是我最后不得不做的事。这将以不同的方式显示,并涉及编辑以前过长的每个实例。。。。