【问题标题】:Using " 's " after a Doxygen identifier在 Doxygen 标识符之后使用“'s”
【发布时间】:2017-09-13 11:47:02
【问题描述】:

我正在使用 Doxygen 编写 C 项目的文档。 在函数的文档中,可以使用\p 引用函数的参数。我想在我的文本中使用“'s”所有格习语,例如写the object's name。以下是触发问题的代码示例:

/**
 * @file
 * @brief Main C entry point
 * @author Vincent Siles
 */
#include <stdio.h>

typedef struct {
    int foo;
    int bar;
} foobar;

/**
 * @brief blabla
 *
 * toto \p in's field foo.
 * toto \p in 's field foo.
 *
 * @param in    input
 */
void test(foobar *in)
{
    printf("%d %d\n", in->foo, in->bar);
}

int main(void)
{
    foobar xxx = { .foo = 0, .bar = 0};

    test(&xxx);
    return 0;
}

生成的 HTML 特征:

<p>blabla </p>
<p>toto <code>in's</code> field foo. toto <code>in</code> 's field foo.</p>

如您所见,&lt;code&gt; 的两个部分都不尽人意:第一个里面有“'s”,感觉不对,第二个有额外的空间。

在这种情况下,我可以改写为the field of \p in,但这并不总是可行的。有没有办法输出&lt;code&gt;in&lt;/code&gt;'s field

为了记录,我使用的是 1.8.11 版本,我在默认配置中遇到了这个问题,由 doxywizard + 针对 C/PHP 优化创建。完整配置见here

【问题讨论】:

  • 你使用的是哪个版本的 doxygen?
  • 我用 doxygen 1.8.13 做了一个快速测试,这看起来不错,当您对此版本有问题时,请附上一个完整的小示例,包括您的配置文件 (Doxyfile) 和标准配置文件。
  • 谢谢@albert。我用更多信息更新了问题。
  • 我明白了,这是关于您想显示为代码的变量“in”。我发现最好的是 in

标签: doxygen


【解决方案1】:

\p 命令无法实现。
但是,作为一种解决方法,您可以使用 `in`'s 而不是 \p in's

但请注意,它可能看起来有点奇怪,因为 &lt;code&gt;in&lt;/code&gt; 部分将使用与 's 不同的字体,因此可能看起来更大或更小:

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-09-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多