yard and links to classes/modules in the doc
Asked Answered
D

1

30

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

Degradable answered 16/9, 2010 at 8:55 Comment(0)
D
42

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
##
Dispensation answered 16/9, 2010 at 12:36 Comment(1)
Thank you ! Did you dig in the code for this or have you a better reference doc then rubydoc.info/docs/yard/file/docs/GettingStarted.md ?Degradable

© 2022 - 2024 — McMap. All rights reserved.