gitwtfhub

wtf is yard?

edward/yard — explained in plain English

Analysis updated 2026-07-17 · repo last pushed 2008-06-22

3RubyAudience · developerComplexity · 2/5DormantSetup · easy

TL;DR

YARD auto-generates HTML documentation for Ruby code from structured comments like @param and @return in your source files.

Mindmap

mindmap
  root((repo))
    What it does
      Reads code comments
      Generates docs
      Builds diagrams
    Tech stack
      Ruby
      yardoc CLI
      Rake
    Use cases
      Gem documentation
      API references
      Terminal lookups
    Audience
      Ruby developers
      Library authors

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Generate searchable HTML documentation for a Ruby gem straight from code comments.

REASON 2

Add @param and @return tags to methods so other developers know what to expect without reading the code.

REASON 3

Look up documentation for your own code from the terminal using the yri tool.

REASON 4

Draw class relationship diagrams for a Ruby project with yard-graph.

What's in the stack?

RubyRake

How it stacks up

edward/yardburningtyger/farhang-appjordansissel/node-packaging
Stars333
LanguageRubyRubyRuby
Last pushed2008-06-222019-05-082010-12-31
MaintenanceDormantDormantDormant
Setup difficultyeasyhardmoderate
Complexity2/53/52/5
Audiencedeveloperdeveloperops devops

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · easy Time to first run · 5min

Wtf does this do

YARD is a tool that automatically generates documentation for Ruby code. Instead of writing documentation in a separate file or wiki, you write special comments directly in your code, and YARD reads those comments and creates clean, organized HTML documentation that you can share with other developers. The way it works is straightforward. You add structured comments to your Ruby methods and classes using a simple tag system, things like @param to describe what inputs a method takes, @return to say what it gives back, and @deprecated to warn that something shouldn't be used anymore. YARD reads your code and these comments, understands the structure, and generates a website or command-line reference. It's designed to feel familiar if you've used documentation tools in other languages like Python or Java, since it borrows their tagging style. You'd use YARD if you're building a Ruby library or application and want to give your users (or your team) a way to understand your code without digging through it. For example, if you wrote a gem that other developers would install, YARD creates searchable documentation showing every method, what parameters it expects, what type of values it returns, and what can go wrong. You can run YARD from the command line by just typing yardoc in your project folder, or integrate it into your build process with a Rake task. The tool also includes a few bonus features: yri lets you quickly look up documentation about your code from the terminal, and yard-graph can draw diagrams showing how your classes relate to each other. What sets YARD apart is its flexibility. It can handle not just simple methods and classes, but also custom Ruby code constructs that you define yourself, like special class-level declarations used by popular frameworks. It also stores its findings in a cache file so you can regenerate documentation with different styles without re-parsing your code. The README doesn't go into detail on what output formats it currently supports, but it mentions plans for HTML, command-line text, and XML.

Yoink these prompts

Prompt 1
Show me how to run yardoc on my Ruby project to generate HTML documentation.
Prompt 2
Help me add @param and @return tags to this Ruby method so YARD documents it correctly.
Prompt 3
Walk me through integrating YARD into my project's Rake build task.
Prompt 4
Explain how to use yri to look up documentation for a class from the terminal.

Frequently asked questions

wtf is yard?

YARD auto-generates HTML documentation for Ruby code from structured comments like @param and @return in your source files.

What language is yard written in?

Mainly Ruby. The stack also includes Ruby, Rake.

Is yard actively maintained?

Dormant — no commits in 2+ years (last push 2008-06-22).

How hard is yard to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is yard for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.