Skip to content

Commit 1fcabc4

Browse files
[DOC] Fix links in doc guide
1 parent 752c88b commit 1fcabc4

1 file changed

Lines changed: 34 additions & 30 deletions

File tree

doc/contributing/documentation_guide.md

Lines changed: 34 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ in the Ruby core and in the Ruby standard library.
66

77
## Generating documentation
88

9-
Most Ruby documentation lives in the source files and is written in
10-
[RDoc format](https://ruby.github.io/rdoc/RDoc/MarkupReference.html).
9+
Most Ruby documentation lives in the source files, and is written in RDoc format
10+
(described in the [RDoc Markup Reference]).
1111

1212
Some pages live under the `doc` folder and can be written in either
1313
`.rdoc` or `.md` format, determined by the file extension.
@@ -43,14 +43,12 @@ Use your judgment about what the user needs to know.
4343
- Write short declarative or imperative sentences.
4444
- Group sentences into (ideally short) paragraphs,
4545
each covering a single topic.
46-
- Organize material with
47-
[headings].
48-
- Refer to authoritative and relevant sources using
49-
[links](https://ruby.github.io/rdoc/RDoc/MarkupReference.html#class-RDoc::MarkupReference-label-Links).
46+
- Organize material with [headings].
47+
- Refer to authoritative and relevant sources using [links].
5048
- Use simple verb tenses: simple present, simple past, simple future.
5149
- Use simple sentence structure, not compound or complex structure.
5250
- Avoid:
53-
- Excessive comma-separated phrases; consider a [list].
51+
- Excessive comma-separated phrases; consider a [list][lists].
5452
- Idioms and culture-specific references.
5553
- Overuse of headings.
5654
- Using US-ASCII-incompatible characters in C source files;
@@ -105,16 +103,16 @@ involving new files `doc/*.rdoc`:
105103
*/
106104
```
107105
108-
### \RDoc
106+
### RDoc
109107
110108
Ruby is documented using RDoc.
111-
For information on \RDoc syntax and features, see the
112-
[RDoc Markup Reference](https://ruby.github.io/rdoc/RDoc/MarkupReference.html).
109+
For information on RDoc syntax and features,
110+
see the [RDoc Markup Reference].
113111
114112
### Output from `irb`
115113
116114
For code examples, consider using interactive Ruby,
117-
[irb](https://ruby-doc.org/stdlib/libdoc/irb/rdoc/IRB.html).
115+
[irb].
118116
119117
For a code example that includes `irb` output,
120118
consider aligning `# => ...` in successive lines.
@@ -133,16 +131,15 @@ Organize a long discussion for a class or module with [headings].
133131
Do not use formal headings in the documentation for a method or constant.
134132
135133
In the rare case where heading-like structures are needed
136-
within the documentation for a method or constant, use
137-
[bold text](https://ruby.github.io/rdoc/RDoc/MarkupReference.html#class-RDoc::MarkupReference-label-Bold)
138-
as pseudo-headings.
134+
within the documentation for a method or constant,
135+
use [bold text] as pseudo-headings.
139136
140137
### Blank Lines
141138
142139
A blank line begins a new paragraph.
143140
144-
A [code block](https://ruby.github.io/rdoc/RDoc/MarkupReference.html#class-RDoc::MarkupReference-label-Code+Blocks)
145-
or [list] should be preceded by and followed by a blank line.
141+
A [code block][code blocks]
142+
or [list][lists] should be preceded by and followed by a blank line.
146143
This is unnecessary for the HTML output, but helps in the `ri` output.
147144
148145
### \Method Names
@@ -185,7 +182,7 @@ renders as:
185182
> - File.new
186183
> - File#read.
187184
188-
In general, \RDoc's auto-linking should not be suppressed.
185+
In general, RDoc's auto-linking should not be suppressed.
189186
For example, we should write just plain _Float_ (which is auto-linked):
190187

191188
```rdoc
@@ -312,10 +309,9 @@ In particular, avoid building tables with HTML tags
312309
313310
Alternatives:
314311
315-
- A {verbatim text block}[https://ruby.github.io/rdoc/RDoc/MarkupReference.html#class-RDoc::MarkupReference-label-Verbatim+Text+Blocks],
312+
- A [verbatim text block][verbatim text blocks],
316313
using spaces and punctuation to format the text;
317-
note that {text markup}[https://ruby.github.io/rdoc/RDoc/MarkupReference.html#class-RDoc::MarkupReference-label-Text+Markup]
318-
will not be honored:
314+
note that [text markup][text markup] will not be honored:
319315
320316
- Example {source}[https://github.com/ruby/ruby/blob/34d802f32f00df1ac0220b62f72605827c16bad8/file.c#L6570-L6596].
321317
- Corresponding {output}[rdoc-ref:File@ReadWrite+Mode].
@@ -374,9 +370,9 @@ Guidelines:
374370
and a short description.
375371
- If the method has aliases, mention them in parentheses before the colon
376372
(and do not list the aliases separately).
377-
- Check the rendered documentation to determine whether \RDoc has recognized
373+
- Check the rendered documentation to determine whether RDoc has recognized
378374
the method and linked to it; if not, manually insert a
379-
[link](https://ruby.github.io/rdoc/RDoc/MarkupReference.html#class-RDoc::MarkupReference-label-Links).
375+
[link][links].
380376
381377
- If there are numerous entries, consider grouping them into subsections with headings.
382378
- If there are more than a few such subsections,
@@ -398,11 +394,11 @@ The general structure of the method documentation should be:
398394
399395
### Calling Sequence (for methods written in C)
400396
401-
For methods written in Ruby, \RDoc documents the calling sequence automatically.
397+
For methods written in Ruby, RDoc documents the calling sequence automatically.
402398
403-
For methods written in C, \RDoc cannot determine what arguments
404-
the method accepts, so those need to be documented using \RDoc directive
405-
[`call-seq:`](https://ruby.github.io/rdoc/RDoc/MarkupReference.html#class-RDoc::MarkupReference-label-Directives+for+Method+Documentation).
399+
For methods written in C, RDoc cannot determine what arguments
400+
the method accepts, so those need to be documented using RDoc directive
401+
[`call-seq:`][call-seq]
406402
407403
For a singleton method, use the form:
408404
@@ -577,7 +573,7 @@ argument passed if it is not obvious, not explicitly mentioned in the
577573
details, and not implicitly shown in the examples.
578574

579575
If there is more than one argument or block argument, use a
580-
[labeled list](https://ruby.github.io/rdoc/RDoc/MarkupReference.html#class-RDoc::MarkupReference-label-Labeled+Lists).
576+
[labeled list][lists].
581577

582578
### Corner Cases and Exceptions
583579

@@ -618,6 +614,14 @@ For methods that accept multiple argument types, in some cases it can
618614
be useful to document the different argument types separately. It's
619615
best to use a separate paragraph for each case you are discussing.
620616

621-
[headings]: https://ruby.github.io/rdoc/RDoc/MarkupReference.html#class-RDoc::MarkupReference-label-Headings
622-
[list]: https://ruby.github.io/rdoc/RDoc/MarkupReference.html#class-RDoc::MarkupReference-label-Lists
623-
[monofont]: https://ruby.github.io/rdoc/RDoc/MarkupReference.html#class-RDoc::MarkupReference-label-Monofont
617+
[bold text]: https://ruby.github.io/rdoc/doc/markup_reference/rdoc_rdoc.html#bold
618+
[call-seq]: https://ruby.github.io/rdoc/doc/markup_reference/rdoc_rdoc.html#directive-for-specifying-rdoc-source-format
619+
[code blocks]: https://ruby.github.io/rdoc/doc/markup_reference/rdoc_rdoc.html#code-blocks
620+
[headings]: https://ruby.github.io/rdoc/doc/markup_reference/rdoc_rdoc.html#headings
621+
[irb]: https://ruby.github.io/irb/index.html
622+
[links]: https://ruby.github.io/rdoc/doc/markup_reference/rdoc_rdoc.html#links
623+
[lists]: https://ruby.github.io/rdoc/doc/markup_reference/rdoc_rdoc.html#lists
624+
[monofont]: https://ruby.github.io/rdoc/doc/markup_reference/rdoc_rdoc.html#monofont
625+
[RDoc Markup Reference]: https://ruby.github.io/rdoc/doc/markup_reference/rdoc_rdoc.html
626+
[text markup]: https://ruby.github.io/rdoc/doc/markup_reference/rdoc_rdoc.html#text-markup
627+
[verbatim text blocks]: https://ruby.github.io/rdoc/doc/markup_reference/rdoc_rdoc.html#verbatim-text-blocks

0 commit comments

Comments
 (0)