OSDN Git Service

Regular updates
[twpd/master.git] / rdoc.md
1 ---
2 title: Rdoc
3 category: Markup
4 layout: 2017/sheet
5 ---
6
7 ### Basic RDoc format
8
9 ```rb
10 # Foo.
11 #
12 # @example
13 #
14 #   y
15 #   g
16 #
17 # @param [String] param_name The xx and xx.
18 #
19 # @see http://url.com
20 #
21 # @return [true] if so
22 ```
23
24 ### Inline
25
26 ```markdown
27 *bold*
28 _emphasized_
29 +code+
30 ```
31
32 ```markdown
33 http://www.link.com
34 See Models::User@Examples
35 {Google}[http://google.com]
36 ```
37
38 ### Skip
39
40 ```rb
41 def input # :nodoc:
42 ```
43
44 ```rb
45 module MyModule # :nodoc: all
46 ```
47
48 ### Definition lists
49
50 ```rb
51 # == Definition lists
52 #
53 # list::  hi.
54 # +foo+:: parameterized
55 ```
56
57 ```rb
58 # == Definition lists
59 # [foo]   also
60 # [bar]   like this
61 ```
62
63 ### Return types
64
65 ```rb
66 # @return [String]
67 # @return [String, nil] the name
68 ```
69
70 ### Callseq
71
72 ```rb
73 # :call-seq:
74 #   ARGF.readlines(sep=$/)     -> array
75 #   ARGF.readlines(limit)      -> array
76 #   ARGF.readlines(sep, limit) -> array
77 #
78 #   ARGF.to_a(sep=$/)     -> array
79 #   ARGF.to_a(limit)      -> array
80 #   ARGF.to_a(sep, limit) -> array
81 ```
82
83 ### Category
84
85 ```rb
86 # :category: Utilities
87 ```
88
89 ### Sections
90
91 ```rb
92 # :section: Expiry methods
93 # methods relating to expiring
94
95 def expire!
96 def expired?
97 ...
98 ```
99
100 ### Using tomdoc
101
102 ```rb
103 # :markup: TomDoc
104 ```
105
106 Place this at the beginning of the file.
107
108 ## Also see
109 {: .-one-column}
110
111 * <http://rdoc.rubyforge.org/RDoc/Markup.html>
112 * <http://www.rubydoc.info/gems/yard/file/docs/GettingStarted.md>
113 {: .-also-see}