Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

yard and links to classes/modules in the doc

Tags:

ruby

rdoc

yard

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

like image 397
devlearn Avatar asked Sep 16 '10 08:09

devlearn


1 Answers

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
##
like image 199
Jörg W Mittag Avatar answered Nov 03 '22 22:11

Jörg W Mittag