From efb33b5411f54ae491c10ce5cd227fa49b985fde Mon Sep 17 00:00:00 2001 From: Loren Segal Date: Fri, 20 Dec 2024 14:27:47 -0800 Subject: [PATCH] Update README.md --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index bf62c87f1..6c47204c8 100644 --- a/README.md +++ b/README.md @@ -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 @@ -147,7 +147,7 @@ $ yard --help Plugins can also add commands to the `yard` executable to provide extra functionality. -### Generating Documentation +#### Generating Documentation The `yardoc` executable is a shortcut for `yard doc`. @@ -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 @@ -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`: @@ -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 @@ -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, @@ -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: @@ -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