java 在 doxygen 中使用 @see 或 @link
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11991616/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Use of @see or @link in doxygen
提问by FredFloete
I documented with Javadoc before and used the tags @see
, @link
or {@see foo}
and {link foo}
in my description to link to other classes. Now I tried doxygen and it seems that these tags are incompatible. If I run doxygen the complete tags are simply be interpreted as normal text.
我之前使用 Javadoc 进行了记录@see
,并在我的描述中使用了标签, @link
or{@see foo}
和{link foo}
来链接到其他类。现在我尝试了 doxygen,似乎这些标签不兼容。如果我运行 doxygen,完整的标签会被简单地解释为普通文本。
Are there any alternative tags which I can use to get the same features?
是否有任何替代标签可以用来获得相同的功能?
采纳答案by Chris
To link to other classes you should use the ref
command. You can use the \link
command, but you must end your link text with the \endlink
command, which I suspect is your problem (although without example documentation I can't be sure).
要链接到其他类,您应该使用该ref
命令。您可以使用该\link
命令,但您必须使用该命令结束链接文本\endlink
,我怀疑这是您的问题(尽管没有示例文档,我无法确定)。
From the doxygen manual section on automatic linking, which I suggest you read, there is a paragraph on links to classes:
我建议您阅读有关自动链接的 doxygen 手册部分,其中有一段关于类的链接:
All words in the documentation that correspond to a documented class and contain at least one non-lower case character will automatically be replaced by a link to the page containing the documentation of the class. If you want to prevent that a word that corresponds to a documented class is replaced by a link you should put a
%
in front of the word. To link to an all lower case symbol, use\ref
.
文档中与文档类对应并包含至少一个非小写字符的所有单词将自动替换为指向包含类文档的页面的链接。如果您想防止与文档类对应的单词被链接替换,您应该
%
在单词前面放一个。要链接到全小写符号,请使用\ref
。
Some further points to consider:
需要考虑的其他几点:
Doxygen does accept the
\see
(which is synonymous to\sa
) and\link
commands. If these are not working as expected the OP should include some example documentation you we can try and work out which this is not working as expected.The notation
{\command description}
, with the enclosing{
and}
is not common in doxygen documentation, I'm not sure how the program will treat these so it is probably best to not use this style.
Doxygen 确实接受
\see
(与 同义\sa
)和\link
命令。如果这些没有按预期工作,OP 应该包含一些示例文档,您可以尝试找出哪些没有按预期工作。{\command description}
带有封闭{
和的符号}
在 doxygen 文档中并不常见,我不确定程序将如何处理这些,因此最好不要使用这种样式。
回答by Chris Dargis
I suspect you are commenting with //
我怀疑你在评论 //
Doxygen will catch the tags this way:
Doxygen 会以这种方式捕获标签:
/**
* @KEYWORD DESCRIPTION
*/
You can also just add a third /
to make each comment line begin with ///
as doxygen will catch this also.
你也可以只添加第三个/
来让每个注释行开始,///
因为 doxygen 也会捕捉到这一点。