用容器替换狮身人面像
如何替换容器指令?以下不起作用:
.. |sub| container::
Some text here
.. image:: img/some_image.png
Some other text here
错误消息是
WARNING: Substitution definition "sub" empty or invalid.
How can I substitute a container directive ? The following doesn't work:
.. |sub| container::
Some text here
.. image:: img/some_image.png
Some other text here
The error message is
WARNING: Substitution definition "sub" empty or invalid.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是不可能的。 ReST 替换适用于内联文本(单个段落),但容器是块元素。
如果您尝试,
您会得到
您可以通过将容器放入单独的文件中并使用
.. include::
将其拉入主文件来解决此问题。This is not possible. ReST substitutions apply to inline text (single paragraphs), but a container is a block element.
And if you try
you will get
You could work around this by putting the container in a separate file and pull it in to the master file using
.. include::
.