如何引用以单数定义但以复数表示的词汇表术语?

How to refer a glossary term defined in singular but expressed in plural?

如果我定义了一个 glossary 和一个名为 foobar 的词条,我就可以将文本中的该词条用作

This is a ref to the :term:`foobar` term.

这将使 foobar 成为可点击的参考,带我进入词汇表。

但是,如果我想引用一个术语但以不同方式显示它怎么办,例如,复数形式,例如 "I have many foobars",其中 foobar 被识别为术语并 linked 到词汇表?

以下将不起作用,因为紧跟在结束反勾之后的字符会把它弄乱,以至于根本无法将其识别为术语 link。

I have many :term:`foobar`s

在 s 前加一个 space 显然不好看。如果可以将整个单词 "foobars" 标记为术语 foobar 的 link 就好了。这可能吗?

参见例如https://sublime-and-sphinx-guide.readthedocs.io/en/latest/glossary.html:

You can link to a term in the glossary while showing different text in the topic by including the term in angle brackets. For example:

:term:`reStructuredText<RST>`

The term in angle brackets must exactly match a term in the glossary. The text before the angle brackets is what users see on the page.

你的情况:

I have many :term:`foobars<foobar>`

如果您不喜欢重复,请参阅 Writing terms in plural without the redundancy