yard-markdown 0.4 → 0.4.1
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/README.md +4 -5
- data/example/Aquatic.md +5 -7
- data/example/Fish.md +11 -13
- data/example/Salmon.md +15 -17
- data/example_yard.rb +2 -11
- data/templates/default/fulldoc/markdown/setup.rb +7 -12
- 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: 56b8294ee2ef9bdd12b36f03b4260286e34d2002363a4f9cd280af85743c342c
|
4
|
+
data.tar.gz: f8df2867ca6d8c98aa79a20585d181b79ed12a507637b948708010ae2930ffe4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d814cb9ac75d6330b72bbd53087fbc417392aa44296944da168f4195b7d92a9d60ff5e5e40d233ad628763c2c7d9cdb9c99213dde740dd54478791fce1bdacd
|
7
|
+
data.tar.gz: 1aba7f70acf91dca5f5b2a829160ff255a60a598360ccfce492d6cd2096a3d110095fb1eac6bf38138fab808ed98cc6b8b517598acd71a69cc658e235b47012e
|
data/README.md
CHANGED
@@ -6,7 +6,6 @@ Yard plugin to generate markdown documentation
|
|
6
6
|
- Compatible with Github Flavored Markdown
|
7
7
|
- Mimick yard html layout where it makes sense to maintain familiarity
|
8
8
|
- Produce .csv index file alonside markdown documentation to act as file index
|
9
|
-
- Include markdown files that are already present in source code.
|
10
9
|
|
11
10
|
## Usage
|
12
11
|
Yard doesn't load plugin by default, so you need to load plugin through `~/.yard/config`:
|
@@ -26,13 +25,13 @@ gem install yard-markdown
|
|
26
25
|
Run `yardoc --format=markdown` to generate markdown documentation.
|
27
26
|
|
28
27
|
## Backstory
|
29
|
-
This is a successor to [rdoc-mardown gem](https://github.com/skatkov/rdoc-markdown/tree/main/example)
|
28
|
+
This is a successor to [rdoc-mardown gem](https://github.com/skatkov/rdoc-markdown/tree/main/example). These docsets are used in [POSH TUI](https://poshtui.com).
|
30
29
|
|
31
30
|
## Testing
|
32
31
|
Unit tests can't really test this gem properly. So it's semi-manual process of making changes and reviewing output.
|
33
32
|
|
34
|
-
Testing Rdoc conversion to markdown:
|
35
|
-
|
33
|
+
### Testing Rdoc conversion to markdown:
|
34
|
+
`yardoc example_rdoc.rb` -> outputs everything into example/ folder.
|
36
35
|
|
37
|
-
Testing Yard conversion to markdown:
|
36
|
+
### Testing Yard conversion to markdown:
|
38
37
|
`yardoc example_yard.rb` -> outputs everything into example/ folder.
|
data/example/Aquatic.md
CHANGED
@@ -8,13 +8,11 @@ A mixin for aquatic creatures.
|
|
8
8
|
## swim() [](#method-i-swim)
|
9
9
|
Swim in the water.
|
10
10
|
|
11
|
-
|
11
|
+
**@return** [void]
|
12
12
|
|
13
13
|
|
14
14
|
# Constants
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
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
@@ -9,27 +9,25 @@ The base class for all fish.
|
|
9
9
|
## make_sound() [](#method-i-make_sound)
|
10
10
|
Make a sound.
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
**@return** [void]
|
13
|
+
**@yield** [sound] The sound produced by the fish
|
14
|
+
**@yieldparam** [String] The actual sound
|
15
15
|
## swim(direction, speed) [](#method-i-swim)
|
16
16
|
Swim in a specific direction.
|
17
17
|
|
18
18
|
Swimming is the most critical feature of fish.
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
**@param** [Symbol, String] The direction to swim
|
21
|
+
**@param** [Integer] The speed at which to swim
|
22
|
+
**@return** [Boolean] Whether the swim was successful
|
23
23
|
|
24
|
-
|
24
|
+
**@example**
|
25
25
|
```ruby
|
26
26
|
swim(:north, 30)
|
27
27
|
```
|
28
28
|
|
29
29
|
# Constants
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
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
@@ -19,40 +19,38 @@ A salmon is an Aquatic Fish.
|
|
19
19
|
## initialize(farmed, wild) [](#method-i-initialize)
|
20
20
|
Creates a new salmon.
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
|
22
|
+
**@param** [Boolean] Whether the salmon is farmed
|
23
|
+
**@param** [Boolean] Whether the salmon is wild
|
24
|
+
**@return** [Salmon] a new instance of Salmon
|
25
25
|
## make_sound() [](#method-i-make_sound)
|
26
26
|
Salmon overrides generic implementation.
|
27
27
|
|
28
|
-
|
29
|
-
|
30
|
-
|
28
|
+
**@return** [void]
|
29
|
+
**@yield** [sound] The sound produced by the salmon
|
30
|
+
**@yieldparam** [String] The actual sound
|
31
31
|
## sustainable?() [](#method-i-sustainable?)
|
32
32
|
Checks if this salmon is sustainable.
|
33
33
|
|
34
|
-
|
34
|
+
**@return** [Boolean] Whether the salmon is sustainable
|
35
35
|
## swim() [](#method-i-swim)
|
36
36
|
Swim in the water.
|
37
37
|
|
38
|
-
|
38
|
+
**@return** [void]
|
39
39
|
|
40
40
|
# Public Class Methods
|
41
41
|
## wild_salmon() [](#method-c-wild_salmon)
|
42
|
-
|
42
|
+
**@return** [Array<Salmon>] List of all wild salmon
|
43
43
|
|
44
44
|
# Attributes
|
45
45
|
## farmed[RW] [](#attribute-i-farmed)
|
46
46
|
|
47
|
-
|
47
|
+
**@return** [Boolean] True for farmed salmon
|
48
48
|
## wild[RW] [](#attribute-i-wild)
|
49
49
|
|
50
|
-
|
50
|
+
**@return** [Boolean] True for wild salmon
|
51
51
|
|
52
52
|
# Constants
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
53
|
+
| Name | Default Value |
|
54
|
+
| --- | --- |
|
55
|
+
| [DEFAULT_SALMON_SPEED](#constant-DEFAULT_SALMON_SPEED) | 20 |
|
56
|
+
| [MAX_DEPTH](#constant-MAX_DEPTH) | 500 |
|
data/example_yard.rb
CHANGED
@@ -1,12 +1,5 @@
|
|
1
|
-
# @title YARD Markdown Example
|
2
|
-
# @description This example demonstrates various YARD features using markdown formatting.
|
3
|
-
#
|
4
|
-
# ## Links
|
5
|
-
#
|
6
|
-
# 1. [YARD Documentation](https://yardoc.org/)
|
7
|
-
# 2. [Markdown Syntax](https://daringfireball.net/projects/markdown/syntax)
|
8
|
-
|
9
1
|
# A mixin for aquatic creatures.
|
2
|
+
#
|
10
3
|
module Aquatic
|
11
4
|
# Swim in the water.
|
12
5
|
#
|
@@ -135,11 +128,9 @@ class Salmon < Fish
|
|
135
128
|
end
|
136
129
|
end
|
137
130
|
|
138
|
-
#
|
139
|
-
# Default speed for a swimming salmon
|
131
|
+
# Default speed for a swimming salmon
|
140
132
|
DEFAULT_SALMON_SPEED = 20
|
141
133
|
|
142
|
-
# @!constant [Integer] MAX_DEPTH
|
143
134
|
# Maximum depth for salmon habitat
|
144
135
|
MAX_DEPTH = 500
|
145
136
|
|
@@ -126,9 +126,7 @@ def serialize(object)
|
|
126
126
|
## <%= item.name(false) %>(<%= item.parameters.map {|p| p.join(" ") }.join(", ") %>) [](#<%=aref(item)%>)
|
127
127
|
<%= rdoc_to_md item.docstring %>
|
128
128
|
<%= render_tags item %>
|
129
|
-
|
130
|
-
<% end %>
|
131
|
-
<% end %>
|
129
|
+
<% end %><% end %>
|
132
130
|
<% if (attrs = attr_listing(object)).size > 0 %>
|
133
131
|
# Attributes
|
134
132
|
<% attrs.each do |item|%>
|
@@ -136,19 +134,16 @@ def serialize(object)
|
|
136
134
|
<%= rdoc_to_md item.docstring %>
|
137
135
|
|
138
136
|
<%= render_tags item %>
|
139
|
-
<% end %>
|
140
|
-
<% end %>
|
141
|
-
|
137
|
+
<% end %><% end %>
|
142
138
|
<% if constant_listing.size > 0 %>
|
143
139
|
<% groups(constant_listing, "Constants") do |list, name| %>
|
144
140
|
# <%= name %>
|
141
|
+
<% if list.size > 0 %>
|
142
|
+
| Name | Default Value |
|
143
|
+
| --- | --- |
|
145
144
|
<% list.each do |cnst| %>
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
<%= render_tags cnst %>
|
150
|
-
|
151
|
-
<% end %><% end %><% end %>',
|
145
|
+
| [<%= cnst.name %>](#<%=aref(cnst)%>) | <%= cnst.value %> |
|
146
|
+
<% end %><% end %><% end %><% end %>',
|
152
147
|
trim_mode: "<>",
|
153
148
|
)
|
154
149
|
|