簡単な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>
最初の行なしで小見出し(具体的にはタグ)を取得するにはどうすればよいですか?小見出しの上に2つのレベルの階層を提供していますか?ページヘッダーを単純に提供しても役に立ちません:http://rst.ninjs.org/?n = e874f6eaad17c8ae7fd565f9ecb2212b