如何格式化由插件创建的标题?

2024-10-02 00:31:27 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一个小sphinx插件,它可以创建带有标题的代码块。 现在我想格式化这些标题,但我不知道如何才能做到这一点

我曾尝试通过reST指令直接添加格式,但它不起作用

nodes.caption(text='*Example*') # literally shows "*Example*" instead of "Example" in italic

如何修改此行以添加格式属性

nodes.caption(text='Example')

Tags: of代码text插件rest标题example格式

热门问题