Python sphinx Sphinx代码块在HTML中呈现得很奇怪

Python sphinx Sphinx代码块在HTML中呈现得很奇怪,python-sphinx,restructuredtext,Python Sphinx,Restructuredtext,我正在尝试使用Sphinx代码块,我在HTML中得到了奇怪的呈现。我的消息来源是: 这是页面的源代码 ************ Testing Page ************ Used for testing Sphinx constructs Why does the role get rendered in HTML? ..code-block:: python This is a code line and so is this. It is very co

我正在尝试使用Sphinx代码块,我在HTML中得到了奇怪的呈现。我的消息来源是:

这是页面的源代码

************
Testing Page
************

Used for testing Sphinx constructs

Why does the role get rendered in HTML?

..code-block:: python

    This is a code line
    and so is this.

It is very confused because it emits the following error::
   D:\Shared\WiseOldbird\Projects\Platform IndependentApplicationController\docs\source\Test.rst:12: WARNING: Block quote ends without a blank line; unexpected unindent

If I try it like this without the language specification it renders the role and displays the code block correctly -
note that it strips a single colon from the role directive

..code-block::

 This is a code line
 and so is this.

If I use a literal block.::

   I get a colon in the text that introduces the literal block

Heading
-------
要正确使用Sphinx代码块,我需要做什么?

  • 代码块
    中缺少空格

    .code block::python
    更改为
    。。代码块::python

  • 代码块
    指令必须具有指定语言的参数

  • 文字块前面段落中的冒号前面也缺少空格

    literal块:
    更改为
    literal块:
    删除渲染文本中的冒号


请将代码和标记显示为文本,而不是图像。我不知道如何将标记显示为StackOverflow上的文本。我正在尝试显示呈现的HTML输出。可以。但请以纯文本形式提供RST标记。缺少空格。将
.code block::python
更改为
。。代码块::python
。我将在
之间添加一条空行。。代码块::python
和实际代码(我有这个bug,在这里结束了,所以我添加了我的问题)。