Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
lsegal authored Dec 20, 2024
1 parent 3c14200 commit efb33b5
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ gems further up in the list to your Gemfile.
There are a couple of ways to use YARD. The first is via command-line, and the
second is the Rake task.

**1. yard Command-line Tool**
### 1. yard Command-line Tool

YARD comes packaged with a executable named `yard` which can control the many
functions of YARD, including generating documentation, graphs running the YARD
Expand All @@ -147,7 +147,7 @@ $ yard --help
Plugins can also add commands to the `yard` executable to provide extra
functionality.

### Generating Documentation
#### Generating Documentation

<span class="note">The `yardoc` executable is a shortcut for `yard doc`.</span>

Expand Down Expand Up @@ -194,7 +194,7 @@ switches separated by whitespace (newlines or space) to pass to yardoc whenever
it is run. A full overview of the `.yardopts` file can be found in
[YARD::CLI::Yardoc](https://rubydoc.info/gems/yard/YARD/CLI/Yardoc#label-Options+File+-28.yardopts-29).

### Queries
#### Queries

The `yardoc` tool also supports a `--query` argument to only include objects
that match a certain data or meta-data query. The query syntax is Ruby, though a
Expand All @@ -221,7 +221,7 @@ following two lines both check for the existence of a return and param tag:

For more information about the query syntax, see the {YARD::Verifier} class.

**2. Rake Task**
### 2. Rake Task

The second most obvious is to generate docs via a Rake task. You can do this by
adding the following to your `Rakefile`:
Expand All @@ -247,7 +247,7 @@ environment variable:
$ rake yard OPTS='--any --extra --opts'
```

**3. `yri` RI Implementation**
### 3. `yri` RI Implementation

The yri binary will use the cached .yardoc database to give you quick ri-style
access to your documentation. It's way faster than ri but currently does not
Expand All @@ -271,7 +271,7 @@ $ yard gems
If you don't have sudo access, it will write these files to your `~/.yard`
directory. `yri` will also cache lookups there.

**4. `yard server` Documentation Server**
### 4. `yard server` Documentation Server

The `yard server` command serves documentation for a local project or all
installed RubyGems. To serve documentation for a project you are working on,
Expand All @@ -285,14 +285,14 @@ And the project inside the current directory will be parsed (if the source has
not yet been scanned by YARD) and served at
[http://localhost:8808](http://localhost:8808).

### Live Reloading
#### Live Reloading

If you want to serve documentation on a project while you document it so that
you can preview the results, simply pass `--reload` (`-r`) to the above command
and YARD will reload any changed files on each request. This will allow you to
change any documentation in the source and refresh to see the new contents.

### Serving Gems
#### Serving Gems

To serve documentation for all installed gems, call:

Expand All @@ -304,7 +304,7 @@ This will also automatically build documentation for any gems that have not been
previously scanned. Note that in this case there will be a slight delay between
the first request of a newly parsed gem.

**5. `yard graph` Graphviz Generator**
### 5. `yard graph` Graphviz Generator

You can use `yard graph` to generate dot graphs of your code. This, of course,
requires [Graphviz](http://www.graphviz.org) and the `dot` binary. By default
Expand Down

0 comments on commit efb33b5

Please sign in to comment.