这是一个简单的 reST 片段:
deleting this line causes all subheadings to be rendered as h1 tags
I should be an h1
=================
I should be an h2
-----------------
foo
I should also be an h2
----------------------
foo
这是它被渲染的演示:
带有初始行:http
://rst.ninjs.org/?n=ff67380d732a33c7844f350c240804d0
没有初始行:http ://rst.ninjs.org/?n=550ea2c1b4233affdce1d158c5dc4d99
我正在使用以下 Python 渲染 reST:
from docutils.core import publish_parts
parts = publish_parts(rest_content, writer_name="html")
html_snippet = parts['html_body']
如何在<h2>
没有初始行的情况下获得副标题(特别是标签)?是否在子标题之上提供了两个层次结构?天真地提供页眉并没有帮助:http ://rst.ninjs.org/?n=e874f6eaad17c8ae7fd565f9ecb2212b