YARDOC(1)

πŸ’– YARDOC(1) πŸ’–

okay bestie, gather round, because today we're talking about yardoc β€” literally the Ruby documentation generator that eats and leaves no crumbs. this is the yardoc(1) manual page and i'm about to make it make sense. πŸŽ€


✨ NAME ✨

yardoc β€” Ruby tool to generate documentation for the Ruby programming language 🌸


✨ SYNOPSIS ✨

yarddoc [options] [source_files [- extra_files]]

yard doc [options] [source_files [- extra_files]]

✨ DESCRIPTION ✨

so yard(1) is this extensible documentation generation tool for the Ruby programming language, right? it lets you generate consistent, usable documentation that can be exported to a bunch of formats so easily, and it also supports extending for custom Ruby constructs like custom class level definitions. it's giving flexibility, it's giving range. πŸ’…

yardoc, which is a synonym for yard doc, generates the documentation from the list of source_files. and if you just… don't give it a list? no worries. it falls back to {lib,app}/**/*.rb ext/**/*.c. iconic behaviour honestly. ✨

and here's a lil cheat code: you can specify a base set of options by dropping a .yardopts file into your base path, with all your extra options separated by whitespace. set it and forget it. 🫢


✨ OPTIONS ✨

General Options 🧚

  • -b, --db FILE β€” use a specific .yardoc db to load from or save to (defaults to .yardoc)
  • --[no-]single-db β€” whether code objects should be stored to a single database file (this one is advanced, bestie, iykyk)
  • -n, --no-output β€” only generate the .yardoc database, no documentation at all. just the db, no vibes rendered.
  • -c, --use-cache [FILE] β€” use the cached .yardoc db to generate documentation (defaults to no cache)
  • --no-cache β€” clear the .yardoc db before parsing source. fresh start, clean slate. 🧼
  • --[no-]yardopts [FILE] β€” if arguments should be read from FILE (defaults to yes, and FILE defaults to .yardopts)
  • --[no-]document β€” if arguments should be read from the .document file (defaults to yes)
  • --no-save β€” do not save the parsed data to the yardoc db
  • --exclude REGEXP β€” ignores a file if it matches the path match (regexp)

Output options πŸŽ€

  • --one-file β€” generates output as a single file
  • --list β€” list objects to standard out (this implies -n, so heads up)
  • --no-public β€” don't show public methods. (default shows public)
  • --protected β€” show protected methods. (default hides protected)
  • --private β€” show private methods. (default hides private)
  • --no-private β€” hide objects with the @private tag
  • --[no-]api API β€” generates documentation for a given API (objects which define the correct @api tag). if --no-api is given, it displays objects with no @api tag.
  • --embed-mixins β€” embeds mixin methods into class documentation
  • --embed-mixin [MODULE] β€” embeds mixin methods from a particular module into class documentation
  • --no-highlight β€” don't highlight code blocks in output. (no rainbow code, tragic but valid)
  • --default-return TYPE β€” shown if the method has no return type. (defaults to 'Object')
  • --hide-void-return β€” hides return types specified as 'void'. (default is shown)
  • --query QUERY β€” only show objects that match a specific query
  • --title TITLE β€” add a specific title to HTML documents
  • -r, --readme, --main FILE β€” the readme file used as the title page of documentation
  • --files FILE1,FILE2,... β€” any extra comma separated static files to be included (eg. FAQ)
  • --asset FROM[:TO] β€” a file or directory to copy over to the output directory after generating
  • -o, --output-dir PATH β€” the output directory. (defaults to ./doc)
  • -m, --markup MARKUP β€” markup style used in documentation, like textile, markdown or rdoc (defaults to rdoc)
  • -M MARKUP_PROVIDER β€” overrides the library used to process markup
  • --markup-provider β€” formatting (specify the gem name) β€” yep, this is the continuation of the -M description up there, they just got separated in the original and i'm keeping them exactly as they are, no cap
  • --charset ENC β€” character set to use when parsing files (default is system locale)
  • -t, --template TEMPLATE β€” the template to use. (defaults to "default")
  • -p, --template-path PATH β€” the template path to look for templates in. (used with -t)
  • -f, --format FORMAT β€” the output format for the template (defaults to html)
  • --no-stats β€” don't print statistics
  • --locale LOCALE β€” the locale for generated documentation (defaults to en)
  • --po-dir DIR β€” the directory that has .po files (defaults to #{YARD::Registry.po_dir})

Tag options 🏷️

(TAG:TITLE looks like: overload:Overloaded Method)

  • --tag TAG:TITLE β€” registers a new free-form metadata @tag
  • --type-tag TAG:TITLE β€” tag with an optional types field
  • --type-name-tag TAG:TITLE β€” tag with optional types and a name field
  • --name-tag TAG:TITLE β€” tag with a name field
  • --title-tag TAG:TITLE β€” tag with the first line as a title field
  • --hide-tag TAG β€” hides a previously defined tag from templates
  • --transitive-tag TAG β€” marks a tag as transitive
  • --non-transitive-tag TAG β€” marks a tag as not transitive

Other options πŸ’€

  • -e, --load FILE β€” a Ruby script to load before running the command
  • --plugin PLUGIN β€” load a YARD plugin (a gem with the yard- prefix)
  • --legacy β€” use the old style Ruby parser and handlers. always on in 1.8.x. (yes, always. not optional. periodt.)
  • --safe β€” enable safe mode for this instance
  • -q, --quiet β€” show no warnings.
  • --verbose β€” show more information.
  • --debug β€” show debugging information.
  • --backtrace β€” show stack traces
  • -v, --version β€” show version.
  • -h, --help β€” show this help.

✨ EXAMPLES ✨

yardoc -o "documentation/" - "FAQ" "LICENSE"

the above example outputs documentation for files in lib/**/*.rb to documentation/, including the extra files FAQ and LICENSE. see how the - is the lil separator between your source files and your extra files? chef's kiss. πŸ‘‘


✨ SEE ALSO ✨

yard(1).


✨ AUTHORS ✨

yard has been developed by Loren Segal <lsegal@soen.ca>.

this manual page has been written for the Debian Project by Cédric Boutillier (but may be used by others). 🫢


and that's a wrap on the whole entire page, bestie!! this was yardoc 0.9.45 from 2026-07-23, so it's fresh, it's current, it's serving. go forth and document your Ruby, you absolute main character. πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸŒˆβ­πŸ‘‘

πŸ“¦ where this page comes from