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.yardocdb 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.yardocdatabase, no documentation at all. just the db, no vibes rendered.-c,--use-cache [FILE]β use the cached.yardocdb to generate documentation (defaults to no cache)--no-cacheβ clear the.yardocdb 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.documentfile (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@privatetag--[no-]api APIβ generates documentation for a given API (objects which define the correct@apitag). if--no-apiis given, it displays objects with no@apitag.--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-Mdescription 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 toen)--po-dir DIRβ the directory that has.pofiles (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 theyard-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 β¨
β¨ 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
- ubuntu stonking: yard 0.9.45-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms