rdoc-markdown 0.3.5 → 0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +8 -8
- data/README.md +3 -0
- data/example/Bird.md +17 -0
- data/example/Duck.md +50 -0
- data/example/Object.md +6 -0
- data/example/RDoc/Generator/Markdown.md +30 -0
- data/example/RDoc/Generator.md +2 -0
- data/example/RDoc/Markdown.md +2 -0
- data/example/RDoc.md +2 -0
- data/example/Rdoc/Markdown.md +6 -0
- data/example/Rdoc.md +2 -0
- data/example/TestGenerator.md +10 -0
- data/example/Waterfowl.md +8 -0
- data/example/index.db +0 -0
- data/lib/rdoc/generator/markdown.rb +5 -2
- data/lib/rdoc/markdown/version.rb +1 -1
- data/lib/templates/classfile.md.erb +1 -2
- metadata +14 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 701b08501deaf21f981b61001ec79249d506f685a755b0931ccb40f19a93690f
|
4
|
+
data.tar.gz: e3d5b50d3599a08004aaa182426477adeaeb539ff0215a92cd10485007282c88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79c8b70b7e4a2e5b1a763d66cb8e8210c8b51250c1afdcb0de9fb5a96607f3347f060731540426b7641767d1cd6bd50ad8be3a56749facdc16e3cb8e93c4c704
|
7
|
+
data.tar.gz: 051f1cf3cc914fededfebb6db13d0c121b82e5e01de1b51f43a5af27f886929a0b6a3ddea27c7691ea6d46707778c290be142483e065146e2fc0e7db4b131b48
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rdoc-markdown (0.
|
4
|
+
rdoc-markdown (0.4)
|
5
5
|
erb (~> 2.0)
|
6
6
|
extralite-bundle (~> 1.0)
|
7
7
|
rdoc (~> 6.0)
|
@@ -33,29 +33,29 @@ GEM
|
|
33
33
|
rdiscount (2.2.7)
|
34
34
|
rdoc (6.4.0)
|
35
35
|
psych (>= 4.0.0)
|
36
|
-
regexp_parser (2.6.
|
36
|
+
regexp_parser (2.6.1)
|
37
37
|
reverse_markdown (2.1.1)
|
38
38
|
nokogiri
|
39
39
|
rexml (3.2.5)
|
40
|
-
rubocop (1.
|
40
|
+
rubocop (1.39.0)
|
41
41
|
json (~> 2.3)
|
42
42
|
parallel (~> 1.10)
|
43
43
|
parser (>= 3.1.2.1)
|
44
44
|
rainbow (>= 2.2.2, < 4.0)
|
45
45
|
regexp_parser (>= 1.8, < 3.0)
|
46
46
|
rexml (>= 3.2.5, < 4.0)
|
47
|
-
rubocop-ast (>= 1.
|
47
|
+
rubocop-ast (>= 1.23.0, < 2.0)
|
48
48
|
ruby-progressbar (~> 1.7)
|
49
49
|
unicode-display_width (>= 1.4.0, < 3.0)
|
50
50
|
rubocop-ast (1.23.0)
|
51
51
|
parser (>= 3.1.1.0)
|
52
|
-
rubocop-performance (1.
|
52
|
+
rubocop-performance (1.15.1)
|
53
53
|
rubocop (>= 1.7.0, < 2.0)
|
54
54
|
rubocop-ast (>= 0.4.0)
|
55
55
|
ruby-progressbar (1.11.0)
|
56
|
-
standard (1.
|
57
|
-
rubocop (= 1.
|
58
|
-
rubocop-performance (= 1.
|
56
|
+
standard (1.18.1)
|
57
|
+
rubocop (= 1.39.0)
|
58
|
+
rubocop-performance (= 1.15.1)
|
59
59
|
stringio (3.0.2)
|
60
60
|
unicode-display_width (2.3.0)
|
61
61
|
unindent (1.0)
|
data/README.md
CHANGED
@@ -13,6 +13,9 @@ Install gem and add to application's Gemfile by executing:
|
|
13
13
|
If bundler is not being used to manage dependencies, install the gem by executing:
|
14
14
|
|
15
15
|
$ gem install rdoc-markdown
|
16
|
+
## Examples
|
17
|
+
Find examples in [/examples](/example/) folder. You can regenerate examples by running `./bin/generate.sh`, it will produce examples based on file in `test/data/*` folder.
|
18
|
+
|
16
19
|
|
17
20
|
## Usage
|
18
21
|
RDoc will auto-detect rdoc-markdown plugin if it was installed. You just need to instruct RDoc to produce markdown output instead of standard HTML through `format` parameter.
|
data/example/Bird.md
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# class Bird [](#class-Bird) [](#top)
|
2
|
+
The base class for all birds.
|
3
|
+
|
4
|
+
## Public Instance Methods
|
5
|
+
### fly(string, number) -> bool [](#method-i-fly)
|
6
|
+
Fly somewhere.
|
7
|
+
|
8
|
+
Flying is the most critical feature of birds.
|
9
|
+
|
10
|
+
= Example
|
11
|
+
|
12
|
+
fly(:south, 70)
|
13
|
+
|
14
|
+
### speak() { |text| ... } [](#method-i-speak)
|
15
|
+
Produce some noise.
|
16
|
+
|
17
|
+
|
data/example/Duck.md
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
# class Duck [](#class-Duck) [](#top)
|
2
|
+
A duck is a [`Waterfowl`](Waterfowl.html) [`Bird`](Bird.html).
|
3
|
+
|
4
|
+
Features:
|
5
|
+
|
6
|
+
bird::
|
7
|
+
|
8
|
+
- speak
|
9
|
+
|
10
|
+
- fly
|
11
|
+
|
12
|
+
waterfowl::
|
13
|
+
|
14
|
+
- swim
|
15
|
+
|
16
|
+
## Constants
|
17
|
+
| Name | Description |
|
18
|
+
| ---- | ----------- |
|
19
|
+
| **MAX_VELOCITY[](#MAX_VELOCITY)** | Not documented |
|
20
|
+
## Bird overrides ## Constants
|
21
|
+
| Name | Description |
|
22
|
+
| ---- | ----------- |
|
23
|
+
| **MAX_VELOCITY[](#MAX_VELOCITY)** | Not documented |
|
24
|
+
## Public Instance Methods
|
25
|
+
### speak() { |speech| ... } [](#method-i-speak)
|
26
|
+
[`Duck`](Duck.html) overrides generic implementation.
|
27
|
+
|
28
|
+
## Duck extensions ## Constants
|
29
|
+
| Name | Description |
|
30
|
+
| ---- | ----------- |
|
31
|
+
| **MAX_VELOCITY[](#MAX_VELOCITY)** | Not documented |
|
32
|
+
## Attributes
|
33
|
+
### domestic[RW] [](#attribute-i-domestic)
|
34
|
+
True for domestic ducks.
|
35
|
+
|
36
|
+
### rubber[R] [](#attribute-i-rubber)
|
37
|
+
True for rubber ducks.
|
38
|
+
|
39
|
+
## Public Class Methods
|
40
|
+
### new(domestic, rubber) [](#method-c-new)
|
41
|
+
Creates a new duck.
|
42
|
+
|
43
|
+
### rubber_ducks() [](#method-c-rubber_ducks)
|
44
|
+
Returns list of all rubber ducks.
|
45
|
+
|
46
|
+
## Public Instance Methods
|
47
|
+
### useful? -> bool [](#method-i-useful-3F)
|
48
|
+
Checks if this duck is a useful one.
|
49
|
+
|
50
|
+
|
data/example/Object.md
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# class RDoc::Generator::Markdown [](#class-RDoc::Generator::Markdown) [](#top)
|
2
|
+
## Constants
|
3
|
+
| Name | Description |
|
4
|
+
| ---- | ----------- |
|
5
|
+
| **TEMPLATE_DIR[](#TEMPLATE_DIR)** | Defines a constant for directory where templates could be found |
|
6
|
+
## Attributes
|
7
|
+
### base_dir[R] [](#attribute-i-base_dir)
|
8
|
+
The path to generate files into, combined with `--op` from the options for a full path.
|
9
|
+
|
10
|
+
### classes[R] [](#attribute-i-classes)
|
11
|
+
Classes and modules to be used by this generator, not necessarily displayed.
|
12
|
+
|
13
|
+
### store[R] [](#attribute-i-store)
|
14
|
+
The RDoc::Store that is the source of the generated content
|
15
|
+
|
16
|
+
## Public Class Methods
|
17
|
+
### new(store, options) [](#method-c-new)
|
18
|
+
Initializer method for Rdoc::Generator::Markdown
|
19
|
+
|
20
|
+
## Public Instance Methods
|
21
|
+
### class_dir() [](#method-i-class_dir)
|
22
|
+
Directory where generated class HTML files live relative to the output dir.
|
23
|
+
|
24
|
+
### file_dir() [](#method-i-file_dir)
|
25
|
+
this alias is required for rdoc to work
|
26
|
+
|
27
|
+
### generate() [](#method-i-generate)
|
28
|
+
Generates markdown files and search index file
|
29
|
+
|
30
|
+
|
data/example/RDoc.md
ADDED
data/example/Rdoc.md
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
# class TestGenerator [](#class-TestGenerator) [](#top)
|
2
|
+
## Constants
|
3
|
+
| Name | Description |
|
4
|
+
| ---- | ----------- |
|
5
|
+
| **CLASSES[](#CLASSES)** | Not documented |
|
6
|
+
## Public Instance Methods
|
7
|
+
### run_generator(file, title) { |options| ... } [](#method-i-run_generator)
|
8
|
+
### source_file() [](#method-i-source_file)
|
9
|
+
### test_generator() [](#method-i-test_generator)
|
10
|
+
|
data/example/index.db
ADDED
Binary file
|
@@ -151,12 +151,14 @@ class RDoc::Generator::Markdown
|
|
151
151
|
|
152
152
|
def emit_classfiles
|
153
153
|
@classes.each do |klass|
|
154
|
-
|
154
|
+
template_content = File.read(File.join(TEMPLATE_DIR, "classfile.md.erb"))
|
155
|
+
|
156
|
+
template = ERB.new template_content, trim_mode: ">"
|
155
157
|
|
156
158
|
out_file = Pathname.new("#{output_dir}/#{turn_to_path klass.full_name}")
|
157
159
|
out_file.dirname.mkpath
|
158
160
|
|
159
|
-
result = template.result(binding).squeeze("
|
161
|
+
result = template.result(binding).squeeze(" ")
|
160
162
|
|
161
163
|
File.write(out_file, result)
|
162
164
|
end
|
@@ -172,6 +174,7 @@ class RDoc::Generator::Markdown
|
|
172
174
|
##
|
173
175
|
# Converts HTML string into a Markdown string with some cleaning and improvements.
|
174
176
|
|
177
|
+
# FIXME: This could return string with newlines in the end, which is not good.
|
175
178
|
def markdownify(input)
|
176
179
|
# TODO: I should be able to set unknown_tags to "raise" for debugging purposes. Probably through rdoc parameters?
|
177
180
|
# Allowed parameters:
|
@@ -7,8 +7,7 @@
|
|
7
7
|
## Constants
|
8
8
|
| Name | Description |
|
9
9
|
| ---- | ----------- |
|
10
|
-
|
11
|
-
| **<%= const.name %>[](#<%= const.name %>)** | <% unless const.description.empty? %> <%= h const.description %> <%else%> Not documented <% end %> |
|
10
|
+
<% klass.constants.each do |const| %> | **<%= const.name %>[](#<%= const.name %>)** | <% unless const.description.empty? %> <%= h(const.description).rstrip %> <%else%> Not documented <% end %> |
|
12
11
|
<% end %>
|
13
12
|
<% end %>
|
14
13
|
<% unless attributes&.empty? %>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rdoc-markdown
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: '0.4'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stanislav (Stas) Katkov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-11-
|
11
|
+
date: 2022-11-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdoc
|
@@ -166,6 +166,18 @@ files:
|
|
166
166
|
- LICENSE
|
167
167
|
- README.md
|
168
168
|
- Rakefile
|
169
|
+
- example/Bird.md
|
170
|
+
- example/Duck.md
|
171
|
+
- example/Object.md
|
172
|
+
- example/RDoc.md
|
173
|
+
- example/RDoc/Generator.md
|
174
|
+
- example/RDoc/Generator/Markdown.md
|
175
|
+
- example/RDoc/Markdown.md
|
176
|
+
- example/Rdoc.md
|
177
|
+
- example/Rdoc/Markdown.md
|
178
|
+
- example/TestGenerator.md
|
179
|
+
- example/Waterfowl.md
|
180
|
+
- example/index.db
|
169
181
|
- lib/markdown.rb
|
170
182
|
- lib/rdoc/discover.rb
|
171
183
|
- lib/rdoc/generator/markdown.rb
|