如何在内联格式中使用替换?

2024-04-24 09:41:06 发布

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

我想添加一个™ 粗体文本末尾的符号。到目前为止,niether内联格式和:strong:角色的显式使用都不起作用:

.. include:: <isonum.txt>

`something original\ |trade|`:strong:

**something original\ |trade|**

我知道我可以将|something original (TM)|定义为replace:: unicode:: something original U+02122,但它是不可组合的。我不想为每种用法定义一个™. 你知道吗

有没有办法让restructedText在内联格式中进行替换?你知道吗

我正在使用:

Sphinx==1.2.3
Tinkerer==1.4.2
docutils==0.12

Tags: 文本txt角色定义include格式符号something
1条回答
网友
1楼 · 发布于 2024-04-24 09:41:06

为什么不直接粘贴unicode字符呢?就像我在这里贴的一样:™ 你知道吗

顺便说一句,斯芬克斯的文档是这样说的:

Since the easiest way to include special characters like em dashes or copyright signs in reST is to directly write them as Unicode characters, one has to specify an encoding. Sphinx assumes source files to be encoded in UTF-8 by default

相关问题 更多 >