您可以在reStructuredText中显示带有文件名的框架源代码吗?

问题描述 投票:0回答:1

我正在寻找一种在显示文件名的框中显示源代码的方法。

例如,像这样:

enter image description here

有什么方法可以用 reStructuredText 做到这一点吗?

restructuredtext
1个回答
0
投票

标准 rST 中没有现成的指令。 您可以使用合适的块级元素并为其设计样式,例如,

.. admonition:: myfile.py

   .. include:: myfile.py
      :code: python
© www.soinside.com 2019 - 2024. All rights reserved.