Questions tagged [yard]

YARD stands for "Yay! A Ruby Documentation tool". It is considered an alternative to the rdoc tool with more features.

YARD stands for "Yay! A Ruby Documentation tool". It is considered an alternative to the rdoc tool with more features. The YARD website says:

YARD is a documentation generation tool for the Ruby programming language. It enables the user to generate consistent, usable documentation that can be exported to a number of formats very easily, and also supports extending for custom Ruby constructs such as custom class level definitions.

YARD's notable features include:

  • Preview as you document
  • Easily customize templates
  • Support your own DSL
  • Extend, extend, extend!

And of course YARD comes with much more functionality, including the ability to serve documentation for gems, the ability to group methods into logical sections, and much more.

195 questions
6
votes
1 answer

Warning in yard with @param tag

I was trying to document some Ruby code using yardand even though I am doing exactly what is described here or here # @param [Integer] the number of trials (>= 0) # @param [Float] success probability in each trial def initialize(n, p) #…
kmikael
  • 4,962
  • 3
  • 32
  • 34
5
votes
2 answers

How can I refer to a parameter ('@param' tag) from another parameter?

I am using Ruby on Rails 3.1.0 and the YARD 0.7.4 gem for documentation purposes. I would like to refer to a parameter (@param tag) from another parameter. That is, I have: # ... # # @param [String] argument_1 # Here I would like to have a…
user12882
  • 4,702
  • 9
  • 39
  • 54
5
votes
1 answer

Using Ruby's Yard doc tool, can I configure Yard to *not* put methods in alphabetical order?

I'm developing a Ruby programming tutorial which I'd like to document with Yard. By default, Yard puts all methods in a module/class into alphabetical order. However, since the methods in each module in the tutorial build upon one another, I'd like…
Doug
  • 3,119
  • 3
  • 27
  • 30
5
votes
0 answers

Document a method returning a lambda

I have an object with a method returning a lambda: class Book def mark_page(marker_color) lambda do |page| page.mark(marker_color) end end end And I want to document this Book#mark_page method using yardoc syntax. However, I…
Ulysse BN
  • 10,116
  • 7
  • 54
  • 82
5
votes
1 answer

How to document an inherited constructor using Yard

Having classes, such as: class Foo def initialize(data) end end class Bar < Foo end Each subclass that inherits from Foo has its own unique attributes, passed in via the data options hash. The yard output for Bar states: Constructor…
Kimmo Lehto
  • 5,910
  • 1
  • 23
  • 32
5
votes
1 answer

Does Ruby Yard have a feature comparable to RDoc :include: tag?

RDoc has the :include: tag (see the bottom of this page) that will take in an arbitrary text file and format as if it was indented wherever the include begins. This is a great way to pull in source code for documentation examples. Does Yard have a…
Luke Bayes
  • 3,234
  • 2
  • 25
  • 20
5
votes
1 answer

YARD - @param tag has unknown parameter name

I'm trying to document my code using YARD, however I'm having hard time figuring out how to get rid of following warning: $ ~/.gem/ruby/2.3.0/bin/yard [warn]: @param tag has unknown parameter name: val in file…
graywolf
  • 7,092
  • 7
  • 53
  • 77
5
votes
2 answers

YARD for keyword arguments with default hash

I have a method that looks like this: def get_endpoint(params: {}) end I want the caller of this method to be able to pass in a few optional parameters. I want to write YARD documentation to support this and if I wasn't using keyword arguments I'd…
Anthony
  • 15,435
  • 4
  • 39
  • 69
5
votes
0 answers

Combining yard docs for multiple gems

I'm using YARD to generate docs for a couple projects that I'm working on. In one, I'm co-developing a gem that hosts a lot of redundant and shared resources that will be used by other projects. What'd I'd like is for references from the first…
Paul Alexander
  • 31,970
  • 14
  • 96
  • 151
5
votes
1 answer

Making custom YARD markdown

I have the following method that I would like to document using YARDoc. # Here is my method # @arg woop [Woop] *dangerous* this parameter is output to the screen def shoop(woop) puts woop end This generates HTML where dangerous is in bold.…
Seanny123
  • 8,776
  • 13
  • 68
  • 124
5
votes
2 answers

Documentation Rails projects with Yard

I'm generating documentation with Yard but i can't find any example documentations for ruby on rails projects. I have found only short getting started tutorial, and some github projects on rubydoc.info, but they are not documented at all. please…
Aydar Omurbekov
  • 2,047
  • 4
  • 27
  • 53
5
votes
2 answers

How do I create an arbitrary link in YARD documentation?

I'm trying to create some links in my YARD documentation. I can get an HTTP link: # I like {http://stackoverflow.com Stackoverflow} renders as

I like Stackoverflow

But an email link: # You can email…
James A. Rosen
  • 64,193
  • 61
  • 179
  • 261
5
votes
1 answer

How to document use of Rails' url_helpers using YARD?

When trying to generate YARD documentation for a service implemented with Rails, I get the following warning: $ yardoc [warn]: in YARD::Handlers::Ruby::MixinHandler: Undocumentable mixin: YARD::Parser::UndocumentableError for class…
otto.poellath
  • 4,129
  • 6
  • 45
  • 60
5
votes
2 answers

Is there an equivalent of Ruby's Yard in Python?

I use both Python and Ruby and I really love the Ruby's Yard documentation server : http://yardoc.org/ , I would like to know if there is an equivalent in the Python world ? The "pydoc -p" is really old, ugly and not comfortable to use at all, and…
Kedare
  • 1,289
  • 16
  • 31
4
votes
1 answer

How to document more files other than the `README` file?

I am using Ruby on Rails 3.1.0 and the YARD 0.7.4 gem for documentation purposes. I would like to add more files other than the README file on the top of the generated documentation as made here (see README, What's New?, Getting Started Guide,…
user12882
  • 4,702
  • 9
  • 39
  • 54