码以及文档中类/模块的链接

发布于 2024-09-24 03:39:00 字数 486 浏览 5 评论 0原文

我目前正在从 rdoc 切换到yard 来保存我的 ruby​​ 软件文档。

在我的文档中,我经常从注释中引用一些类/模块,例如:

## == Provides various utility features
##
## == Features
##
## Logging : logging is provided by the Mysoft::Mypackage::Utility::Logger class
##

Rdoc 正确创建了指向 Mysoft::Mypackage::Utility::Logger 类文档页面的链接,而yard忽略标签并认为类名很简单细绳。

我知道yard有@see标签,但是这将在文档中创建一个单独的“另请参阅”部分,而我需要在描述文本中引用类/模块。

我肯定错过了一些东西,但是如果您有任何关于如何使用yard 完成此操作的示例,我将非常感激。

感谢您的建议,

dl

I'm currently switching from rdoc to yard for my ruby software documentaion.

In my doc I often reference some classes/modules from the comments, for instance :

## == Provides various utility features
##
## == Features
##
## Logging : logging is provided by the Mysoft::Mypackage::Utility::Logger class
##

Rdoc correctly creates a link to the Mysoft::Mypackage::Utility::Logger class documentation page, while yard ignores the tag and considers the class name as simple string.

I know that yard has the @see tag, however this will create a separate "See Also" section in the documentation, while I need to reference the class/modules with inside my description text.

I'm surely missing something, but if you have any examples on how this should be done with yard, I'd realy appreciate.

Thanks per advace,

dl

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

难如初 2024-10-01 03:39:00

引用文档

YARD 支持特殊语法来链接到其他代码对象或文件。语法为{ObjectName#method OPTIONAL_TITLE}。此语法在文档中的任何位置都可以接受,但 @see 标记除外,该标记会自动链接其数据。

所以,你想要

## == Provides various utility features
##
## == Features
##
## Logging: logging is provided by the {Mysoft::Mypackage::Utility::Logger} class
##

Quoth the documentation:

YARD supports a special syntax to link to other code objects or files. The syntax is {ObjectName#method OPTIONAL_TITLE}. This syntax is acceptable anywhere in documentation with the exception of the @see tag, which automatically links its data.

So, you want

## == Provides various utility features
##
## == Features
##
## Logging: logging is provided by the {Mysoft::Mypackage::Utility::Logger} class
##
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文