私は自分のプロジェクトのドキュメントを生成するためにSphinxを使用しています。
このプロジェクトでは、使用可能なコマンドのリストをyamlファイルに記述します。このファイルが読み込まれると、次のような形式の辞書が作成さ{command-name : command-description}れます。
commands = {"copy" : "Copy the highlighted text in the clipboard",
"paste" : "Paste the clipboard text to cursor location",
...}
私が知りたいのは、サイクル中にyamlファイルをロードし、python辞書をreStructuredText形式(定義リストなど)に変換し、html出力に含める方法がsphinxにある場合です。make html
私の.rstファイルは次のようになると思います:
Available commands
==================
The commands available in bla-bla-bla...
.. magic-directive-that-execute-python-code::
:maybe python code or name of python file here:
内部で次のように変換されます。
Available commands
==================
The commands available in bla-bla-bla...
copy
Copy the highlighted text in the clipboard
paste
Paste the clipboard text to cursor location
HTMLに変換される前。