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
0
votes
1 answer

How to pass options via Rake to Yard to Kramdown to use GFM

I've a gem that I've produced with some docs written with Github Flavoured markdown (GFM) to take advantage of their syntax highlighting. Unfortunately, Github decided to use their own syntax for code block fencing (three backticks) so to get Yardoc…
ian
  • 12,003
  • 9
  • 51
  • 107
0
votes
0 answers

Configure nginx to serve static files in Rails

I've generated YARD documentation, and it lives in /gem/doc/. I'd like to be able to serve that in my Rails app at /api/. I'd like to avoid symlinking to it in the /public directory, so I'm trying to configure nginx to serve these files. Here's what…
elstgav
  • 1,001
  • 7
  • 20
0
votes
3 answers

Silence a specific guard plugin?

I´m using guard-yard to automatically run YARD. However the output it has is really annoying and makes it hard to read the RSpec output (which is more interresting). guard 'yard' do watch(%r{app/.+\.rb}) watch(%r{lib/.+\.rb}) …
max
  • 96,212
  • 14
  • 104
  • 165
0
votes
3 answers

In a Ruby / an IRB, how can I use the yard documentation gem to interact with the code's stats and parsed information?

The yard gem is a tool for generating docs of ruby code. It's done via the command line, and the docs get generated. However I was wondering if it's possible to interact with the parsed code and statistic via an IRB. You can go into the IRB and call…
CafeHey
  • 5,699
  • 19
  • 82
  • 145
0
votes
1 answer

How to document a function that returns a specific object defined by the app in yard?

I have a function that returns a User or nil if it can't find the user. It looks like this: # Given an access token in the HTTP headers, it returns the User who owns the token # # @return [User] the user who owns the access token def…
Hommer Smith
  • 26,772
  • 56
  • 167
  • 296
0
votes
1 answer

Correct way to document multiple couses of an error

I am using yardto generate documentation for some Ruby classes. We can document some errors which can be raised by a method like this: # @raise [ArgumentError] Cause 1 # @raise [ArgumentError] Cause 2 # @raise [ArgumentError] Cause 3 # @raise…
Israel
  • 3,252
  • 4
  • 36
  • 54
0
votes
1 answer

Yard: incompatible marshal file format (can't be read)

I'm getting this when running Yard and then clicking on a file link: incompatible marshal file format (can't be read) format version 4.8 required; 114.101 given…
Snowcrash
  • 80,579
  • 89
  • 266
  • 376
0
votes
1 answer

Is there a counterpart to @!method tag for class methods?

Yard has a tag @!method to describe documentation for instance methods that are created dynamically. Is there a similar tag for class methods?
Sergey Potapov
  • 3,819
  • 3
  • 27
  • 46
0
votes
1 answer

YARD ⇒ how to add custom output to several methods descriptions basing on one DSL statement in YARD plugin

I have the problem writing YARD plugin for the following DSL: class MyClass my_dsl :do_it, :do_other def do_it # do it end def do_other # do other end def do_unrelated # do unrelated end end Now I want to add notes to…
Aleksei Matiushkin
  • 119,336
  • 10
  • 100
  • 160
0
votes
2 answers

YARD Cucumber leaves comments in ouput documentation

In order to localize my Gherkin scripts, I added #language:ru comment at the very top of each .feature file and started using localized names for steps and scenarios. However, this comments lingers(and it is visible right under feature name) in…
Anton
  • 3,006
  • 3
  • 26
  • 37
0
votes
1 answer

How to remove inheritance info (and other sections) from Yardoc output

I want to produce some documentation that is available publicly, and hence I wish to remove certain aspects of the output that Yard generates by default. Already I've managed to remove the source code and its link, but I'd also like to remove: The…
ian
  • 12,003
  • 9
  • 51
  • 107
0
votes
1 answer

Parser error on installing the remotipart gem

I am using RVM, Ruby v1.9.3-p125 and Ruby on Rails v3.2.2. On my Ubuntu server I am trying to install the remotipart v1.0.2 gem but I get the following error: $ gem install remotipart -v 1.0.2 Successfully installed remotipart-1.0.2 1 gem…
Backo
  • 18,291
  • 27
  • 103
  • 170
0
votes
1 answer

Omit magic comment from YARD docs

I have the magic comment # -*- encoding : utf-8 -*- at the top of every ruby file in my Rails app. Thing is, it shows up in my YARD docs in the Overview section of each class definition: Overview -*- encoding : utf-8 -*- The Book model contains a…
snowangel
  • 3,452
  • 3
  • 29
  • 72
0
votes
1 answer

How do I retrieve the tags on a class using YARD filters?

I'm really new to this, and I've been going through the YARD docs, and haven't really been able to figure out a solution to my problem. Here is the code I'm starting with: https://github.com/spape/yard-rest-plugin which works great, but I'm trying…
NullVoxPopuli
  • 61,906
  • 73
  • 206
  • 352
0
votes
1 answer

Iterating over the registers of a Yardoc `@macro`

I am looking for way to iterate over the registers of a yardoc @macro. I know you are able to use them in something like as follows: class Post include DataMapper::Resource # @macro dm.property # @return [$2] the $1 $0 of the post property…
rudolph9
  • 8,021
  • 9
  • 50
  • 80
1 2 3
12
13