Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/16.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
Documentation rST:在表中插入代码块_Documentation_Restructuredtext - Fatal编程技术网

Documentation rST:在表中插入代码块

Documentation rST:在表中插入代码块,documentation,restructuredtext,Documentation,Restructuredtext,我需要使用与DVB规范使用的格式相同的格式在rST中创建一个表 syntax列类似于代码块,因为它需要有适当的缩进,但也需要与其他列对齐 我试过各种方法。。。问题似乎是引导空格对rST做了奇怪的事情 +-----------------------------+-----------------+------------+ | Syntax | Number of bits | Identifier | +=======================

我需要使用与DVB规范使用的格式相同的格式在rST中创建一个表

syntax列类似于代码块,因为它需要有适当的缩进,但也需要与其他列对齐

我试过各种方法。。。问题似乎是引导空格对rST做了奇怪的事情

+-----------------------------+-----------------+------------+
| Syntax                      | Number of bits  | Identifier |
+=============================+=================+============+
|``private_data_byte(){``     |                 |            |
+-----------------------------+-----------------+------------+
|``  magic_bit``              | 8               | uimsbf     |
+-----------------------------+-----------------+------------+
|``  version``                | 8               | uimsbf     |
+-----------------------------+-----------------+------------+
|``  if (a == 0x0F){``        |                 |            |
+-----------------------------+-----------------+------------+
|``    field_a``              | 16              | uimsbf     |
+-----------------------------+-----------------+------------+
|``  }``                      |                 |            |
+-----------------------------+-----------------+------------+
|``}``                        |                 |            |
+-----------------------------+-----------------+------------+

解决方法是使用由替换定义的非中断空间:

.. |_| unicode:: 0xA0 

+-----------------------------+-----------------+------------+
| Syntax                      | Number of bits  | Identifier |
+=============================+=================+============+
|``private_data_byte(){``     |                 |            |
+-----------------------------+-----------------+------------+
| |_| ``magic_bit``           | 8               | uimsbf     |
+-----------------------------+-----------------+------------+
| |_| ``version``             | 8               | uimsbf     |
+-----------------------------+-----------------+------------+
| |_| ``if (a == 0x0F){``     |                 |            |
+-----------------------------+-----------------+------------+
| |_| |_| ``field_a``         | 16              | uimsbf     |
+-----------------------------+-----------------+------------+
| |_| ``}``                   |                 |            |
+-----------------------------+-----------------+------------+
|``}``                        |                 |            |
+-----------------------------+-----------------+------------+