readme_yard 0.1.2 β 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/.yardopts +1 -0
- data/CHANGELOG.md +16 -1
- data/Gemfile +3 -0
- data/Gemfile.lock +65 -15
- data/README.md +235 -47
- data/README_YARD.md +141 -34
- data/bin/readme +2 -2
- data/lib/readme_yard/code_tag.rb +28 -0
- data/lib/readme_yard/comment_tag.rb +50 -0
- data/lib/readme_yard/error.rb +19 -0
- data/lib/readme_yard/example_tag.rb +36 -0
- data/lib/readme_yard/logger.rb +16 -0
- data/lib/readme_yard/readme_tag.rb +45 -0
- data/lib/readme_yard/source_tag.rb +30 -0
- data/lib/readme_yard/string_tag.rb +86 -0
- data/lib/readme_yard/tag_registry.rb +21 -0
- data/lib/readme_yard/value_tag.rb +31 -0
- data/lib/readme_yard/version.rb +1 -1
- data/lib/readme_yard/yard_opts_manager.rb +49 -0
- data/lib/readme_yard.rb +61 -80
- data/readme_yard.gemspec +7 -3
- metadata +45 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 755f223afede15fbac8b87531730204494747aaf8b95302bf0cae4ca9a8822d3
|
4
|
+
data.tar.gz: b765382a63cf98480cf2e557f793272c046f18916313b8907875f0fa70e4ee30
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fcc797e2dd79799f06c8acfd1737b901f010b8b52300e77fa78cf0be48b249f43e3968a23a74cb5b8243072d17008e87a77ac77e91715c81724b7fc50bab5d82
|
7
|
+
data.tar.gz: 12bdfd98250616c6379d1563a92de7cc9ae3b436746f96057bf6f66feea3ba1dafc045a631579960ac0cc0fb829ea51dbf9df8aec5e94257cc270c07cc3fe72a
|
data/.rubocop.yml
CHANGED
data/.yardopts
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,19 @@
|
|
1
|
-
##
|
1
|
+
## 0.3.0 - 2025-05-04
|
2
|
+
|
3
|
+
- Update dependencies: upgraded yard-readme to 0.5.0, Ruby requirement to >= 3.0
|
4
|
+
- Add TagRegistry class to centralize tag management
|
5
|
+
- Update bundler and various gem dependencies
|
6
|
+
- Improve command-line argument handling in the readme executable
|
7
|
+
- Extract YardOptsManager to improve code organization
|
8
|
+
- Rename ObjectTag to SourceTag and rename old SourceTag to CodeTag
|
9
|
+
- Add new ValueTag and StringTag
|
10
|
+
- Add standalone tag support: enable embedding yard content in README without yard tags in the source code
|
11
|
+
- Rename format methods for consistency
|
12
|
+
- Rename `readme doc` command to `readme yard` for clarity and improved memorability
|
13
|
+
|
14
|
+
## 0.2.0 - 2021-08-08
|
15
|
+
|
16
|
+
- Add new readme tag types - `comment`, `source`, and `object`. Log warnings and raise errors when helpful. Update README. 51997f24d5209fd8f0e5e11511352f6457bb9dbe
|
2
17
|
|
3
18
|
## 0.1.2 - 2021-08-06
|
4
19
|
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,44 +1,94 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
readme_yard (0.
|
4
|
+
readme_yard (0.3.0)
|
5
5
|
tty-markdown (~> 0.7)
|
6
|
-
yard
|
6
|
+
yard (~> 0.9)
|
7
|
+
yard-readme (~> 0.5)
|
7
8
|
|
8
9
|
GEM
|
9
10
|
remote: https://rubygems.org/
|
10
11
|
specs:
|
11
|
-
|
12
|
-
|
12
|
+
ast (2.4.3)
|
13
|
+
date (3.4.1)
|
14
|
+
debug (1.10.0)
|
15
|
+
irb (~> 1.10)
|
16
|
+
reline (>= 0.3.8)
|
17
|
+
io-console (0.8.0)
|
18
|
+
irb (1.15.2)
|
19
|
+
pp (>= 0.6.0)
|
20
|
+
rdoc (>= 4.0.0)
|
21
|
+
reline (>= 0.4.2)
|
22
|
+
json (2.11.3)
|
23
|
+
kramdown (2.5.1)
|
24
|
+
rexml (>= 3.3.9)
|
25
|
+
language_server-protocol (3.17.0.4)
|
26
|
+
lint_roller (1.1.0)
|
27
|
+
parallel (1.27.0)
|
28
|
+
parser (3.3.8.0)
|
29
|
+
ast (~> 2.4.1)
|
30
|
+
racc
|
13
31
|
pastel (0.8.0)
|
14
32
|
tty-color (~> 0.5)
|
15
|
-
|
16
|
-
|
33
|
+
pp (0.6.2)
|
34
|
+
prettyprint
|
35
|
+
prettyprint (0.2.0)
|
36
|
+
prism (1.4.0)
|
37
|
+
psych (5.2.4)
|
38
|
+
date
|
39
|
+
stringio
|
40
|
+
racc (1.8.1)
|
41
|
+
rainbow (3.1.1)
|
42
|
+
rdoc (6.13.1)
|
43
|
+
psych (>= 4.0.0)
|
44
|
+
regexp_parser (2.10.0)
|
45
|
+
reline (0.6.1)
|
46
|
+
io-console (~> 0.5)
|
47
|
+
rexml (3.4.1)
|
48
|
+
rouge (4.5.2)
|
49
|
+
rubocop (1.75.4)
|
50
|
+
json (~> 2.3)
|
51
|
+
language_server-protocol (~> 3.17.0.2)
|
52
|
+
lint_roller (~> 1.1.0)
|
53
|
+
parallel (~> 1.10)
|
54
|
+
parser (>= 3.3.0.2)
|
55
|
+
rainbow (>= 2.2.2, < 4.0)
|
56
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
57
|
+
rubocop-ast (>= 1.44.0, < 2.0)
|
58
|
+
ruby-progressbar (~> 1.7)
|
59
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
60
|
+
rubocop-ast (1.44.1)
|
61
|
+
parser (>= 3.3.7.2)
|
62
|
+
prism (~> 1.4)
|
63
|
+
ruby-progressbar (1.13.0)
|
64
|
+
stringio (3.1.7)
|
17
65
|
strings (0.2.1)
|
18
66
|
strings-ansi (~> 0.2)
|
19
67
|
unicode-display_width (>= 1.5, < 3.0)
|
20
68
|
unicode_utils (~> 1.4)
|
21
69
|
strings-ansi (0.2.0)
|
22
70
|
tty-color (0.6.0)
|
23
|
-
tty-markdown (0.7.
|
71
|
+
tty-markdown (0.7.2)
|
24
72
|
kramdown (>= 1.16.2, < 3.0)
|
25
73
|
pastel (~> 0.8)
|
26
|
-
rouge (
|
74
|
+
rouge (>= 3.14, < 5.0)
|
27
75
|
strings (~> 0.2.0)
|
28
76
|
tty-color (~> 0.5)
|
29
77
|
tty-screen (~> 0.8)
|
30
|
-
tty-screen (0.8.
|
31
|
-
unicode-display_width (2.
|
78
|
+
tty-screen (0.8.2)
|
79
|
+
unicode-display_width (2.6.0)
|
32
80
|
unicode_utils (1.4.0)
|
33
|
-
yard (0.9.
|
34
|
-
yard-readme (0.
|
35
|
-
yard (~> 0.9.26)
|
81
|
+
yard (0.9.37)
|
82
|
+
yard-readme (0.5.0)
|
36
83
|
|
37
84
|
PLATFORMS
|
38
|
-
arm64-darwin-
|
85
|
+
arm64-darwin-24
|
39
86
|
|
40
87
|
DEPENDENCIES
|
88
|
+
debug
|
89
|
+
irb
|
41
90
|
readme_yard!
|
91
|
+
rubocop (~> 1.75, >= 1.75.4)
|
42
92
|
|
43
93
|
BUNDLED WITH
|
44
|
-
2.
|
94
|
+
2.6.8
|
data/README.md
CHANGED
@@ -1,20 +1,62 @@
|
|
1
1
|
# Readme Yard πΏ
|
2
2
|
[](https://badge.fury.io/rb/readme_yard)
|
3
|
-
[](https://codeclimate.com/github/mattruzicka/readme_yard/maintainability)
|
4
3
|
|
5
|
-
|
6
|
-
|
7
|
-
Take a look at [README_YARD.md](https://github.com/mattruzicka/readme_yard/blob/main/README_YARD.md)
|
8
|
-
to see the template from which the README for this project was generated.
|
4
|
+
Build a better README with [YARD](https://yardoc.org)
|
5
|
+
by generating it straight from the source.
|
9
6
|
|
7
|
+
This gem aims to minimize the effort needed to keep your
|
8
|
+
README, documentation, and source code synced, useful,
|
9
|
+
and correct. Among its features, it introduces the @readme tag
|
10
|
+
that enables you to embed code comments directly into README sections,
|
11
|
+
eliminating redundancy and keeping documentation consistent
|
12
|
+
across your codebase and project README.
|
13
|
+
|
14
|
+
Look at the [README_YARD.md](https://github.com/mattruzicka/readme_yard/blob/main/README_YARD.md)
|
15
|
+
template for this project to see how it works.
|
10
16
|
If you're reading the README, that means this text is here
|
11
|
-
because `{@readme ReadmeYard}` is in
|
12
|
-
|
13
|
-
|
17
|
+
because the custom `{@readme ReadmeYard}` markdown tag is in
|
18
|
+
README_YARD.md and `readme build` was run at the command line.
|
19
|
+
|
20
|
+
Here's the [full documentation](https://rubydoc.info/github/mattruzicka/readme_yard).
|
21
|
+
|
22
|
+
|
23
|
+
---
|
24
|
+
|
25
|
+
β οΈ **Generated file warning** β Edit README_YARD.md, not README.md. Changes to README.md will be lost when running `readme build`.
|
26
|
+
|
27
|
+
### Future Work
|
28
|
+
- Implement safeguards to prevent accidental edits to README.md
|
29
|
+
- Support bidirectional editing through git integration
|
30
|
+
|
31
|
+
[PRs are welcome](#contributing) for these improvements.
|
32
|
+
|
33
|
+
---
|
34
|
+
|
35
|
+
## Table of Contents
|
36
|
+
- [Installation](#installation)
|
37
|
+
- [Getting Started](#getting-started)
|
38
|
+
- [Command Line Usage](#command-line-usage)
|
39
|
+
- [Tag Usage](#tag-usage)
|
40
|
+
- [Readme Tag](#readme-tag)
|
41
|
+
- [Standalone Tag Usage](#standalone-tag-usage)
|
42
|
+
- [Example Tag](#example-tag)
|
43
|
+
- [Contributing](#contributing)
|
44
|
+
|
45
|
+
---
|
46
|
+
|
47
|
+
## Installation
|
48
|
+
|
49
|
+
Add [gem "readme_yard"](https://rubygems.org/gems/readme_yard) to your Gemfile and run `bundle install` or install it yourself with: `gem install readme_yard`
|
50
|
+
|
51
|
+
**Note:** As of version 0.3.0, Readme Yard requires Ruby 3.0 or higher.
|
52
|
+
|
53
|
+
## Getting Started
|
14
54
|
|
15
|
-
|
16
|
-
|
17
|
-
|
55
|
+
Run `readme build` at the command line. This creates a README_YARD.md file if there isn't one by copying your existing README.md file.
|
56
|
+
|
57
|
+
README_YARD.md is the template from which `readme build` generates the README. Readme Yard adds the ability to embed and reference your source code in your README via README_YARD.md.
|
58
|
+
|
59
|
+
See [Tag Usage](#tag-usage).
|
18
60
|
|
19
61
|
---
|
20
62
|
|
@@ -24,87 +66,233 @@ _welcome_ to readme yard!
|
|
24
66
|
|
25
67
|
`readme build` - Reads from README_YARD.md and writes to README.md.
|
26
68
|
|
27
|
-
`readme
|
69
|
+
`readme yard` - Same as `readme build` + generates yard docs.
|
70
|
+
|
28
71
|
|
29
72
|
---
|
30
73
|
|
31
|
-
##
|
74
|
+
## Tag Usage
|
75
|
+
|
76
|
+
Readme Yard uses YARD tags and custom markdown tags. YARD tags live inside Ruby source code. The markdown tags live inside README_YARD.md.
|
77
|
+
|
78
|
+
When the Readme Yard build process encounters a tag in README_YARD.md, it searches the Ruby source code for its YARD tag counterpart, formats the output, and embeds it in the README file.
|
32
79
|
|
33
|
-
|
80
|
+
### Tag Reference Table
|
34
81
|
|
35
|
-
|
82
|
+
| Tag Type | YARD Syntax (in source code) | Markdown Syntax (in README_YARD.md) | Standalone Tag* | Purpose |
|
83
|
+
|----------|------------------------------|-------------------------------------|----------------|---------|
|
84
|
+
| Readme | `@readme` | `{@readme ObjectPath}` | N/A | General purpose tag to embed content from source code |
|
85
|
+
| Readme (comment) | `@readme comment` | `{@readme ObjectPath}` | `{@comment ObjectPath}` | Embeds only the comment from source code |
|
86
|
+
| Readme (code) | `@readme code` | `{@readme ObjectPath}` | `{@code ObjectPath}` | Embeds only code implementation |
|
87
|
+
| Readme (source) | `@readme source` | `{@readme ObjectPath}` | `{@source ObjectPath}` | Embeds both comments and code |
|
88
|
+
| Readme (value) | `@readme value` | `{@readme ObjectPath}` | `{@value ObjectPath}` | Embeds a Ruby value as a Ruby code block |
|
89
|
+
| Readme (string) | `@readme string` | `{@readme ObjectPath}` | `{@string ObjectPath}` | Embeds a Ruby string as normal text |
|
90
|
+
| Example | `@example` | `{@example ObjectPath}` | N/A | Embeds example code from YARD @example tags |
|
36
91
|
|
37
|
-
|
92
|
+
> *Standalone tags allow embedding content without requiring corresponding YARD tags in source code. See [Standalone Tag Usage](#standalone-tag-usage) for details.
|
93
|
+
|
94
|
+
### Examples
|
95
|
+
|
96
|
+
The next line is a code snippet if you're looking at [README.md](https://github.com/mattruzicka/README/blob/main/README_YARD.md) and `{@readme ReadmeYard::ExampleTag.hello_world}` if you're looking at [README_YARD.md](https://github.com/mattruzicka/readme_yard/blob/main/README_YARD.md).
|
97
|
+
|
98
|
+
```ruby
|
99
|
+
#
|
100
|
+
# @example
|
101
|
+
# ReadmeYard::ExampleTag.hello_world #=> "Hello π π π"
|
102
|
+
#
|
103
|
+
def hello_world
|
104
|
+
"Hello π π π"
|
105
|
+
end
|
106
|
+
```
|
107
|
+
|
108
|
+
|
109
|
+
The markdown tag tells Readme Yard to parse the `@readme` tag located above the `hello_world` class method located in [lib/readme_yard/example_tag.rb](https://github.com/mattruzicka/readme_yard/blob/main/lib/readme_yard/example_tag.rb).
|
110
|
+
|
111
|
+
To use another "meta" example, `{@readme ReadmeYard}` is used at the top of this project's README_YARD.md file to generate the first few sentences of this README. `ReadmeYard` references the class located in [lib/readme_yard.rb](https://github.com/mattruzicka/readme_yard/blob/main/lib/readme_yard.rb).
|
112
|
+
|
113
|
+
Last one, `{@readme ReadmeYard#command_line_usage}` is used to generate the "Command Line Usage" section above from the comments of the `command_line_usage` instance method located in [lib/readme_yard.rb](https://github.com/mattruzicka/readme_yard/blob/main/lib/readme_yard.rb). This method is extra meta: it returns the result of formatting its own comments as markdown. In this way, the usage instructions in the comments, the README, and as printed at the command line will always be in sync.
|
38
114
|
|
39
115
|
---
|
40
116
|
|
41
|
-
##
|
117
|
+
## Readme Tag
|
118
|
+
|
119
|
+
**Markdown** syntax: `{@readme ObjectPath}`
|
120
|
+
|
121
|
+
**YARD** syntax: `@example <name>`
|
122
|
+
|
123
|
+
By default, only the text nested under a @readme tag
|
124
|
+
will be embedded in the final output. The default
|
125
|
+
embed behavior can be changed through the use of tag names.
|
42
126
|
|
43
|
-
The following tags can be used in README_YARD.md to generate YARD documentation inside your README.
|
44
127
|
|
45
|
-
###
|
128
|
+
### Embed comments
|
46
129
|
|
47
|
-
Usage: `{@readme ObjectPath}`
|
48
130
|
|
49
|
-
|
131
|
+
**Usage:**
|
50
132
|
|
51
|
-
|
133
|
+
```ruby
|
134
|
+
# @readme comment
|
135
|
+
```
|
136
|
+
|
137
|
+
|
138
|
+
This example [@readme comment](https://github.com/mattruzicka/readme_yard/blob/main/lib/readme_yard/comment_tag.rb) tag embeds the below code snippet via the `{@readme ReadmeYard::CommentTag.format_tag}` markdown tag.
|
139
|
+
|
140
|
+
```ruby
|
141
|
+
#
|
142
|
+
# This comment is in the README because `@readme comment`
|
143
|
+
# is below (in the source code).
|
144
|
+
#
|
145
|
+
```
|
52
146
|
|
53
|
-
`{@readme ReadmeYard.hello_world}` - This object only exists so that you can read this in the README. `ReadmeYard.hello_world` references
|
54
|
-
the class method located in [lib/readme_yard.rb](https://github.com/mattruzicka/readme_yard/blob/main/lib/readme_yard.rb).
|
55
147
|
|
56
|
-
###
|
148
|
+
### Embed Ruby code
|
57
149
|
|
58
|
-
Usage: `{@example ObjectPath}`
|
59
150
|
|
60
|
-
|
151
|
+
**Usage:**
|
61
152
|
|
62
153
|
```ruby
|
63
|
-
|
154
|
+
# @readme code
|
64
155
|
```
|
65
156
|
|
66
|
-
---
|
67
157
|
|
68
|
-
|
158
|
+
This example [@readme code](https://github.com/mattruzicka/readme_yard/blob/main/lib/readme_yard/code_tag.rb) tag embeds the below code snippet via the `{@readme ReadmeYard::CodeTag.format_tag}` markdown tag.
|
159
|
+
|
160
|
+
```ruby
|
161
|
+
def format_tag(yard_object, _tag)
|
162
|
+
ExampleTag.format_ruby(yard_object.source)
|
163
|
+
end
|
164
|
+
```
|
165
|
+
|
69
166
|
|
70
|
-
|
167
|
+
### Embed Ruby comments and code
|
71
168
|
|
72
|
-
|
169
|
+
|
170
|
+
**Usage:**
|
171
|
+
|
172
|
+
```ruby
|
173
|
+
# @readme source
|
174
|
+
```
|
175
|
+
|
176
|
+
|
177
|
+
This example [@readme source](https://github.com/mattruzicka/readme_yard/blob/main/lib/readme_yard/source_tag.rb) tag embeds the below code snippet via the `{@readme ReadmeYard::SourceTag.format_tag}` markdown tag.
|
178
|
+
|
179
|
+
```ruby
|
180
|
+
#
|
181
|
+
# The comment and code for ReadmeYard::SourceTag#format_tag
|
182
|
+
# is in the README because `@readme source` is below (in the source code).
|
183
|
+
#
|
184
|
+
def format_tag(yard_object, _tag)
|
185
|
+
text = CommentTag.format_docstring_as_comment(yard_object)
|
186
|
+
text << "\n#{yard_object.source}"
|
187
|
+
ExampleTag.format_ruby(text)
|
188
|
+
end
|
189
|
+
```
|
190
|
+
|
191
|
+
|
192
|
+
### Embed a Ruby value as a Ruby code block
|
193
|
+
|
194
|
+
|
195
|
+
**Usage:**
|
196
|
+
|
197
|
+
```ruby
|
198
|
+
# @readme value
|
199
|
+
```
|
200
|
+
|
201
|
+
|
202
|
+
This example [@readme value](https://github.com/mattruzicka/readme_yard/blob/main/lib/readme_yard/value_tag.rb) tag embeds the below code snippet via the `{@value ReadmeYard::ValueTag::EXAMPLE}` markdown tag.
|
203
|
+
|
204
|
+
```ruby
|
205
|
+
{ key: "value" }.freeze
|
206
|
+
```
|
207
|
+
|
208
|
+
### Embed a Ruby string as normal text
|
209
|
+
|
210
|
+
|
211
|
+
**Usage:**
|
212
|
+
|
213
|
+
Because a [@readme string](https://github.com/mattruzicka/readme_yard/blob/main/lib/readme_yard/string_tag.rb) tag:
|
214
|
+
|
215
|
+
```ruby
|
216
|
+
# @readme string
|
217
|
+
```
|
218
|
+
|
219
|
+
|
220
|
+
Is located above this constant:
|
221
|
+
|
222
|
+
```ruby
|
223
|
+
XZAMPLE = <<~STRING
|
224
|
+
I heard you like self-documenting Ruby, so I wrote
|
225
|
+
self-documenting Ruby for your self-documenting Ruby.
|
226
|
+
STRING
|
227
|
+
```
|
228
|
+
|
229
|
+
|
230
|
+
We see can see its string value as simple text below:
|
231
|
+
|
232
|
+
I heard you like self-documenting Ruby, so I wrote
|
233
|
+
self-documenting Ruby for your self-documenting Ruby.
|
73
234
|
|
74
235
|
---
|
75
236
|
|
76
|
-
##
|
237
|
+
## Standalone Tag Usage
|
77
238
|
|
78
|
-
|
239
|
+
While using the `@readme` tag in your source code is recommended because it makes the README's dependency on source code explicit, sometimes it's useful to embed source code snippets directly without it. This is especially valuable when a source object can only contain one `@readme` tag, but you want to highlight multiple aspects of the object.
|
79
240
|
|
80
|
-
|
241
|
+
You can use any of these tags directly in README_YARD.md without requiring a corresponding `@readme` tag in the source code:
|
81
242
|
|
82
|
-
- `
|
243
|
+
- `{@comment ObjectPath}` - Embeds comments only
|
244
|
+
- `{@code ObjectPath}` - Embeds code only
|
245
|
+
- `{@source ObjectPath}` - Embeds both comments and code
|
246
|
+
- `{@value ObjectPath}` - Embeds a Ruby value as a Ruby code block
|
247
|
+
- `{@string ObjectPath}` - Embeds a Ruby string as plain text
|
83
248
|
|
84
|
-
|
249
|
+
For example, in the StringTag section above, we used both:
|
250
|
+
- `{@code ReadmeYard::StringTag::XZAMPLE}` to show the constant definition
|
251
|
+
- `{@string ReadmeYard::StringTag::XZAMPLE}` to display the string value as text
|
85
252
|
|
86
|
-
|
253
|
+
The standalone tag usage provides more flexibility when documenting your code and doesn't require modifications to the source files.
|
87
254
|
|
88
|
-
|
255
|
+
---
|
256
|
+
|
257
|
+
## Example Tag
|
89
258
|
|
90
|
-
|
259
|
+
**Markdown** syntax: `{@example ObjectPath}`
|
91
260
|
|
92
|
-
|
261
|
+
**YARD** syntax: `@example`
|
93
262
|
|
94
|
-
|
263
|
+
The Example Tag leverages YARD's standard `@example` tag syntax, allowing you to
|
264
|
+
include example code in your README directly from source files. This saves time and
|
265
|
+
ensures your README stays in sync with your YARD documentation
|
95
266
|
|
96
|
-
- Follow @see links to find tags
|
97
267
|
|
98
|
-
|
268
|
+
**Usage:**
|
99
269
|
|
100
|
-
|
270
|
+
```ruby
|
271
|
+
#
|
272
|
+
# @example
|
273
|
+
# ReadmeYard::ExampleTag.hello_world #=> "Hello π π π"
|
274
|
+
#
|
275
|
+
def hello_world
|
276
|
+
"Hello π π π"
|
277
|
+
end
|
278
|
+
```
|
101
279
|
|
102
|
-
- Integrate with the YARD server so that changes to documentation or README_YARD.md automatically regenerate the README
|
103
280
|
|
104
|
-
|
281
|
+
The below example code is generated from `{@example ReadmeYard::ExampleTag.hello_world}` because, as you can see above, the "hello_world" class method has an `@example` tag.
|
282
|
+
|
283
|
+
```ruby
|
284
|
+
ReadmeYard::ExampleTag.hello_world #=> "Hello π π π"
|
285
|
+
```
|
286
|
+
|
105
287
|
|
106
288
|
---
|
107
289
|
|
108
290
|
## Contributing
|
109
291
|
|
110
292
|
Bug reports and pull requests are welcome on GitHub at https://github.com/mattruzicka/yard-readme.
|
293
|
+
|
294
|
+
If you're interested in contributing, but don't know where to get started, feel free to message me on twitter at [@mattruzicka](https://twitter.com/mattruzicka). I have a lot of ideas!
|
295
|
+
|
296
|
+
Thanks for taking the time to think about me, the README.
|
297
|
+
|
298
|
+
πΏ π₯ π± β½
|