yard-markdown 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/example/Aquatic.md +5 -5
- data/example/Fish.md +11 -6
- data/example/Salmon.md +14 -5
- data/templates/default/fulldoc/markdown/setup.rb +11 -11
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1c4368b70ec91bff1a8f9bf1aaefc79578a34251b879d800f59c466b611dd5a
|
4
|
+
data.tar.gz: 917397c1e9df43930d699fe0258dd124260b5168222fc28c5d0a84ded9f21d1e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 932de039cf4fbd5fadd8bf012f7663f6cda4b270100b7930a28d6e182949628b727705a47893daebb5b39cf4c630f5c3a4e2f7a8ff3e7609e2aa2a43172db00f
|
7
|
+
data.tar.gz: 1d8191d7f0e0db8eea07842025a3dea14a924a67924464df8053ad00d337c9efb71ca832cafd3b83c2e6d150fa897c3ca08527744e86e043d4f3bd059db54898
|
data/example/Aquatic.md
CHANGED
@@ -4,6 +4,11 @@
|
|
4
4
|
|
5
5
|
A mixin for aquatic creatures.
|
6
6
|
|
7
|
+
|
8
|
+
| Constants | Default Value |
|
9
|
+
| --- | --- |
|
10
|
+
| [DEFAULT_SALMON_SPEED](#constant-DEFAULT_SALMON_SPEED) | 20 |
|
11
|
+
| [MAX_DEPTH](#constant-MAX_DEPTH) | 500 |
|
7
12
|
# Public Instance Methods
|
8
13
|
## swim() [](#method-i-swim)
|
9
14
|
Swim in the water.
|
@@ -11,8 +16,3 @@ Swim in the water.
|
|
11
16
|
**@return** [void]
|
12
17
|
|
13
18
|
|
14
|
-
# Constants
|
15
|
-
| Name | Default Value |
|
16
|
-
| --- | --- |
|
17
|
-
| [DEFAULT_SALMON_SPEED](#constant-DEFAULT_SALMON_SPEED) | 20 |
|
18
|
-
| [MAX_DEPTH](#constant-MAX_DEPTH) | 500 |
|
data/example/Fish.md
CHANGED
@@ -5,29 +5,34 @@
|
|
5
5
|
|
6
6
|
The base class for all fish.
|
7
7
|
|
8
|
+
|
9
|
+
| Constants | Default Value |
|
10
|
+
| --- | --- |
|
11
|
+
| [DEFAULT_SALMON_SPEED](#constant-DEFAULT_SALMON_SPEED) | 20 |
|
12
|
+
| [MAX_DEPTH](#constant-MAX_DEPTH) | 500 |
|
8
13
|
# Public Instance Methods
|
9
14
|
## make_sound() [](#method-i-make_sound)
|
10
15
|
Make a sound.
|
11
16
|
|
12
17
|
**@return** [void]
|
18
|
+
|
13
19
|
**@yield** [sound] The sound produced by the fish
|
20
|
+
|
14
21
|
**@yieldparam** [String] The actual sound
|
22
|
+
|
15
23
|
## swim(direction, speed) [](#method-i-swim)
|
16
24
|
Swim in a specific direction.
|
17
25
|
|
18
26
|
Swimming is the most critical feature of fish.
|
19
27
|
|
20
28
|
**@param** [Symbol, String] The direction to swim
|
29
|
+
|
21
30
|
**@param** [Integer] The speed at which to swim
|
31
|
+
|
22
32
|
**@return** [Boolean] Whether the swim was successful
|
23
33
|
|
34
|
+
|
24
35
|
**@example**
|
25
36
|
```ruby
|
26
37
|
swim(:north, 30)
|
27
38
|
```
|
28
|
-
|
29
|
-
# Constants
|
30
|
-
| Name | Default Value |
|
31
|
-
| --- | --- |
|
32
|
-
| [DEFAULT_SALMON_SPEED](#constant-DEFAULT_SALMON_SPEED) | 20 |
|
33
|
-
| [MAX_DEPTH](#constant-MAX_DEPTH) | 500 |
|
data/example/Salmon.md
CHANGED
@@ -15,28 +15,41 @@ A salmon is an Aquatic Fish.
|
|
15
15
|
* **Aquatic**
|
16
16
|
* swim (overridden)
|
17
17
|
|
18
|
+
|
19
|
+
| Constants | Default Value |
|
20
|
+
| --- | --- |
|
21
|
+
| [DEFAULT_SALMON_SPEED](#constant-DEFAULT_SALMON_SPEED) | 20 |
|
22
|
+
| [MAX_DEPTH](#constant-MAX_DEPTH) | 500 |
|
18
23
|
# Public Instance Methods
|
19
24
|
## initialize(farmed, wild) [](#method-i-initialize)
|
20
25
|
Creates a new salmon.
|
21
26
|
|
22
27
|
**@param** [Boolean] Whether the salmon is farmed
|
28
|
+
|
23
29
|
**@param** [Boolean] Whether the salmon is wild
|
30
|
+
|
24
31
|
**@return** [Salmon] a new instance of Salmon
|
32
|
+
|
25
33
|
## make_sound() [](#method-i-make_sound)
|
26
34
|
Salmon overrides generic implementation.
|
27
35
|
|
28
36
|
**@return** [void]
|
37
|
+
|
29
38
|
**@yield** [sound] The sound produced by the salmon
|
39
|
+
|
30
40
|
**@yieldparam** [String] The actual sound
|
41
|
+
|
31
42
|
## sustainable?() [](#method-i-sustainable?)
|
32
43
|
Checks if this salmon is sustainable.
|
33
44
|
|
34
45
|
**@return** [Boolean] Whether the salmon is sustainable
|
46
|
+
|
35
47
|
## swim() [](#method-i-swim)
|
36
48
|
Swim in the water.
|
37
49
|
|
38
50
|
**@return** [void]
|
39
51
|
|
52
|
+
|
40
53
|
# Public Class Methods
|
41
54
|
## wild_salmon() [](#method-c-wild_salmon)
|
42
55
|
**@return** [Array<Salmon>] List of all wild salmon
|
@@ -45,12 +58,8 @@ Swim in the water.
|
|
45
58
|
## farmed[RW] [](#attribute-i-farmed)
|
46
59
|
|
47
60
|
**@return** [Boolean] True for farmed salmon
|
61
|
+
|
48
62
|
## wild[RW] [](#attribute-i-wild)
|
49
63
|
|
50
64
|
**@return** [Boolean] True for wild salmon
|
51
65
|
|
52
|
-
# Constants
|
53
|
-
| Name | Default Value |
|
54
|
-
| --- | --- |
|
55
|
-
| [DEFAULT_SALMON_SPEED](#constant-DEFAULT_SALMON_SPEED) | 20 |
|
56
|
-
| [MAX_DEPTH](#constant-MAX_DEPTH) | 500 |
|
@@ -111,6 +111,15 @@ def serialize(object)
|
|
111
111
|
<%= rdoc_to_md object.docstring %>
|
112
112
|
|
113
113
|
<%= render_tags object %>
|
114
|
+
|
115
|
+
<% if constant_listing.size > 0 %>
|
116
|
+
<% groups(constant_listing, "Constants") do |list, name| %>
|
117
|
+
<% if list.size > 0 %>
|
118
|
+
| <%= name %> | Default Value |
|
119
|
+
| --- | --- |
|
120
|
+
<% list.each do |cnst| %>
|
121
|
+
| [<%= cnst.name %>](#<%=aref(cnst)%>) | <%= cnst.value %> |
|
122
|
+
<% end %><% end %><% end %><% end %>
|
114
123
|
<% if (insmeths = public_instance_methods(object)).size > 0 %>
|
115
124
|
# Public Instance Methods
|
116
125
|
<% insmeths.each do |item| %>
|
@@ -134,16 +143,7 @@ def serialize(object)
|
|
134
143
|
<%= rdoc_to_md item.docstring %>
|
135
144
|
|
136
145
|
<%= render_tags item %>
|
137
|
-
<% end %><% end %>
|
138
|
-
<% if constant_listing.size > 0 %>
|
139
|
-
<% groups(constant_listing, "Constants") do |list, name| %>
|
140
|
-
# <%= name %>
|
141
|
-
<% if list.size > 0 %>
|
142
|
-
| Name | Default Value |
|
143
|
-
| --- | --- |
|
144
|
-
<% list.each do |cnst| %>
|
145
|
-
| [<%= cnst.name %>](#<%=aref(cnst)%>) | <%= cnst.value %> |
|
146
|
-
<% end %><% end %><% end %><% end %>',
|
146
|
+
<% end %><% end %>',
|
147
147
|
trim_mode: "<>",
|
148
148
|
)
|
149
149
|
|
@@ -179,7 +179,7 @@ def render_tags(object)
|
|
179
179
|
result = String.new("")
|
180
180
|
object.tags.each do |tag|
|
181
181
|
result << if !(tag.tag_name == "example")
|
182
|
-
"**@#{tag.tag_name}** [#{tag.types&.join(', ')}] #{tag.text}\n"
|
182
|
+
"**@#{tag.tag_name}** [#{tag.types&.join(', ')}] #{tag.text}\n\n"
|
183
183
|
else
|
184
184
|
""
|
185
185
|
end
|