rdoc-markdown 0.4.2 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +0 -2
- data/Gemfile.lock +45 -32
- data/README.md +0 -3
- data/example/index.csv +16 -0
- data/lib/rdoc/generator/markdown.rb +45 -57
- data/lib/rdoc/markdown/version.rb +1 -1
- data/rdoc-markdown.gemspec +5 -5
- metadata +26 -36
- data/.standard.yml +0 -10
- data/.streerc +0 -2
- data/example/RDoc/Generator/Markdown.md +0 -30
- data/example/RDoc/Generator.md +0 -2
- data/example/RDoc/Markdown.md +0 -6
- data/example/RDoc.md +0 -2
- data/example/TestGenerator.md +0 -10
- data/example/index.db +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df1f3da8afd7010551e9edbaf2f33de617d63584760e3c59120c6f3b38232f19
|
4
|
+
data.tar.gz: 82b591023300cf619230ef8786b3ae10ed3cb5d2aadae9afcd43b5da4c0528b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac5335f705812d01d5bd24488cda5fb77ce69f8fa6b32677b13f048aab476062c0845681324f3b05de9c0965bbcc2c0f1c64dbb5e4f58dc5ee8a8c4a8906dd33
|
7
|
+
data.tar.gz: b682c9b99cace11662bff88be24560b370a2b8a084ec9fac47a854e90a0bfdfafd246e4c62d9c84055c426bcaf3572d1f69bb2e0d02aacc838a7be46e6da8b01
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,45 +1,60 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rdoc-markdown (0.
|
5
|
-
|
6
|
-
|
7
|
-
rdoc
|
8
|
-
reverse_markdown
|
9
|
-
unindent
|
4
|
+
rdoc-markdown (0.5.0)
|
5
|
+
csv
|
6
|
+
erb
|
7
|
+
rdoc
|
8
|
+
reverse_markdown
|
9
|
+
unindent
|
10
10
|
|
11
11
|
GEM
|
12
12
|
remote: https://rubygems.org/
|
13
13
|
specs:
|
14
|
-
cgi (0.
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
minitest (5.
|
20
|
-
nokogiri (1.
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
14
|
+
cgi (0.4.1)
|
15
|
+
csv (3.3.2)
|
16
|
+
date (3.4.1)
|
17
|
+
erb (4.0.4)
|
18
|
+
cgi (>= 0.3.3)
|
19
|
+
minitest (5.25.4)
|
20
|
+
nokogiri (1.18.0-aarch64-linux-gnu)
|
21
|
+
racc (~> 1.4)
|
22
|
+
nokogiri (1.18.0-aarch64-linux-musl)
|
23
|
+
racc (~> 1.4)
|
24
|
+
nokogiri (1.18.0-arm-linux-gnu)
|
25
|
+
racc (~> 1.4)
|
26
|
+
nokogiri (1.18.0-arm-linux-musl)
|
27
|
+
racc (~> 1.4)
|
28
|
+
nokogiri (1.18.0-arm64-darwin)
|
29
|
+
racc (~> 1.4)
|
30
|
+
nokogiri (1.18.0-x86_64-darwin)
|
31
|
+
racc (~> 1.4)
|
32
|
+
nokogiri (1.18.0-x86_64-linux-gnu)
|
33
|
+
racc (~> 1.4)
|
34
|
+
nokogiri (1.18.0-x86_64-linux-musl)
|
35
|
+
racc (~> 1.4)
|
36
|
+
psych (5.2.2)
|
37
|
+
date
|
25
38
|
stringio
|
26
|
-
racc (1.
|
27
|
-
rake (13.
|
28
|
-
rdiscount (2.2.7)
|
29
|
-
rdoc (6.
|
39
|
+
racc (1.8.1)
|
40
|
+
rake (13.2.1)
|
41
|
+
rdiscount (2.2.7.3)
|
42
|
+
rdoc (6.10.0)
|
30
43
|
psych (>= 4.0.0)
|
31
|
-
reverse_markdown (
|
44
|
+
reverse_markdown (3.0.0)
|
32
45
|
nokogiri
|
33
|
-
stringio (3.
|
34
|
-
syntax_tree (6.1.1)
|
35
|
-
prettier_print (>= 1.2.0)
|
36
|
-
syntax_tree-disable_ternary (1.0.0)
|
46
|
+
stringio (3.1.2)
|
37
47
|
unindent (1.0)
|
38
48
|
|
39
49
|
PLATFORMS
|
40
|
-
|
41
|
-
|
42
|
-
|
50
|
+
aarch64-linux-gnu
|
51
|
+
aarch64-linux-musl
|
52
|
+
arm-linux-gnu
|
53
|
+
arm-linux-musl
|
54
|
+
arm64-darwin
|
55
|
+
x86_64-darwin
|
56
|
+
x86_64-linux-gnu
|
57
|
+
x86_64-linux-musl
|
43
58
|
|
44
59
|
DEPENDENCIES
|
45
60
|
bundler (~> 2.0)
|
@@ -47,8 +62,6 @@ DEPENDENCIES
|
|
47
62
|
rake (~> 13.0)
|
48
63
|
rdiscount (~> 2.0)
|
49
64
|
rdoc-markdown!
|
50
|
-
syntax_tree
|
51
|
-
syntax_tree-disable_ternary
|
52
65
|
|
53
66
|
BUNDLED WITH
|
54
|
-
2.
|
67
|
+
2.6.1
|
data/README.md
CHANGED
@@ -1,9 +1,6 @@
|
|
1
1
|
# RDoc-Markdown
|
2
2
|
RDoc plugin to generate markdown documentation and search index backed by sqlite database.
|
3
3
|
|
4
|
-
## Motivation
|
5
|
-
I'm trying to depend less on software with GUI, instead using software that could be used through console. **Documentation in markdown format allows me to review documentation in console**, instead of browser or GUI software like DevDocs.
|
6
|
-
|
7
4
|
## Installation
|
8
5
|
|
9
6
|
Install gem and add to application's Gemfile by executing:
|
data/example/index.csv
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
name,type,path
|
2
|
+
Bird,Class,Bird.md
|
3
|
+
Bird.speak,Method,Bird.md#method-i-speak
|
4
|
+
Bird.fly,Method,Bird.md#method-i-fly
|
5
|
+
Duck,Class,Duck.md
|
6
|
+
Duck.speak,Method,Duck.md#method-i-speak
|
7
|
+
Duck.rubber_ducks,Method,Duck.md#method-c-rubber_ducks
|
8
|
+
Duck.new,Method,Duck.md#method-c-new
|
9
|
+
Duck.useful?,Method,Duck.md#method-i-useful-3F
|
10
|
+
Duck.MAX_VELOCITY,Constant,Duck.md#MAX_VELOCITY
|
11
|
+
Duck.domestic,Attribute,Duck.md#attribute-i-domestic
|
12
|
+
Duck.rubber,Attribute,Duck.md#attribute-i-rubber
|
13
|
+
Object,Class,Object.md
|
14
|
+
Object.DEFAULT_DUCK_VELOCITY,Constant,Object.md#DEFAULT_DUCK_VELOCITY
|
15
|
+
Waterfowl,Module,Waterfowl.md
|
16
|
+
Waterfowl.swim,Method,Waterfowl.md#method-i-swim
|
@@ -5,8 +5,8 @@ gem "rdoc"
|
|
5
5
|
require "pathname"
|
6
6
|
require "erb"
|
7
7
|
require "reverse_markdown"
|
8
|
-
require "extralite"
|
9
8
|
require "unindent"
|
9
|
+
require "csv"
|
10
10
|
|
11
11
|
class RDoc::Generator::Markdown
|
12
12
|
RDoc::RDoc.add_generator self
|
@@ -60,8 +60,6 @@ class RDoc::Generator::Markdown
|
|
60
60
|
# Generates markdown files and search index file
|
61
61
|
|
62
62
|
def generate
|
63
|
-
# TODO: Make sure to set --markup parameter to 'markdown'.
|
64
|
-
|
65
63
|
debug("Setting things up #{@output_dir}")
|
66
64
|
|
67
65
|
setup
|
@@ -70,9 +68,9 @@ class RDoc::Generator::Markdown
|
|
70
68
|
|
71
69
|
emit_classfiles
|
72
70
|
|
73
|
-
debug("Generate
|
71
|
+
debug("Generate index file in #{@output_dir}")
|
74
72
|
|
75
|
-
|
73
|
+
emit_csv_index
|
76
74
|
end
|
77
75
|
|
78
76
|
private
|
@@ -94,62 +92,52 @@ class RDoc::Generator::Markdown
|
|
94
92
|
# This class emits a search index for generated documentation as sqlite database
|
95
93
|
#
|
96
94
|
|
97
|
-
def
|
98
|
-
|
99
|
-
|
100
|
-
db.execute <<-SQL
|
101
|
-
create table contentIndex (
|
102
|
-
id INTEGER PRIMARY KEY,
|
103
|
-
name TEXT,
|
104
|
-
type TEXT,
|
105
|
-
path TEXT
|
106
|
-
);
|
107
|
-
SQL
|
108
|
-
|
109
|
-
result = []
|
110
|
-
|
111
|
-
@classes.map do |klass|
|
112
|
-
result << {
|
113
|
-
name: klass.full_name,
|
114
|
-
type: klass.type.capitalize,
|
115
|
-
path: turn_to_path(klass.full_name),
|
116
|
-
}
|
117
|
-
|
118
|
-
klass.method_list.each do |method|
|
119
|
-
next if method.visibility.to_s.eql?("private")
|
120
|
-
|
121
|
-
result << {
|
122
|
-
name: "#{klass.full_name}.#{method.name}",
|
123
|
-
type: "Method",
|
124
|
-
path: "#{turn_to_path(klass.full_name)}##{method.aref}",
|
125
|
-
}
|
126
|
-
end
|
95
|
+
def emit_csv_index(name = "index.csv")
|
96
|
+
filepath = "#{output_dir}/#{name}"
|
127
97
|
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
end
|
98
|
+
CSV.open(filepath, "wb") do |csv|
|
99
|
+
csv << %w[name type path]
|
100
|
+
|
101
|
+
@classes.map do |klass|
|
102
|
+
csv << [
|
103
|
+
klass.full_name,
|
104
|
+
klass.type.capitalize,
|
105
|
+
turn_to_path(klass.full_name),
|
106
|
+
]
|
138
107
|
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
108
|
+
klass.method_list.each do |method|
|
109
|
+
next if method.visibility.to_s.eql?("private")
|
110
|
+
next if method.visibility.to_s.eql?("protected")
|
111
|
+
|
112
|
+
csv << [
|
113
|
+
"#{klass.full_name}.#{method.name}",
|
114
|
+
"Method",
|
115
|
+
"#{turn_to_path(klass.full_name)}##{method.aref}",
|
116
|
+
]
|
148
117
|
end
|
149
|
-
end
|
150
118
|
|
151
|
-
|
152
|
-
|
119
|
+
klass
|
120
|
+
.constants
|
121
|
+
.sort_by { |x| x.name }
|
122
|
+
.each do |const|
|
123
|
+
csv << [
|
124
|
+
"#{klass.full_name}.#{const.name}",
|
125
|
+
"Constant",
|
126
|
+
"#{turn_to_path(klass.full_name)}##{const.name}",
|
127
|
+
]
|
128
|
+
end
|
129
|
+
|
130
|
+
klass
|
131
|
+
.attributes
|
132
|
+
.sort_by { |x| x.name }
|
133
|
+
.each do |attr|
|
134
|
+
csv << [
|
135
|
+
"#{klass.full_name}.#{attr.name}",
|
136
|
+
"Attribute",
|
137
|
+
"#{turn_to_path(klass.full_name)}##{attr.aref}",
|
138
|
+
]
|
139
|
+
end
|
140
|
+
end
|
153
141
|
end
|
154
142
|
end
|
155
143
|
|
data/rdoc-markdown.gemspec
CHANGED
@@ -31,11 +31,11 @@ Gem::Specification.new do |spec|
|
|
31
31
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
32
32
|
spec.require_paths = ["lib"]
|
33
33
|
|
34
|
-
spec.add_dependency "rdoc"
|
35
|
-
spec.add_dependency "erb"
|
36
|
-
spec.add_dependency "reverse_markdown"
|
37
|
-
spec.add_dependency "
|
38
|
-
spec.add_dependency "
|
34
|
+
spec.add_dependency "rdoc"
|
35
|
+
spec.add_dependency "erb"
|
36
|
+
spec.add_dependency "reverse_markdown"
|
37
|
+
spec.add_dependency "unindent"
|
38
|
+
spec.add_dependency "csv"
|
39
39
|
|
40
40
|
spec.add_development_dependency "minitest", "~> 5.0"
|
41
41
|
spec.add_development_dependency "rake", "~> 13.0"
|
metadata
CHANGED
@@ -1,85 +1,84 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rdoc-markdown
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stanislav (Stas) Katkov
|
8
|
-
autorequire:
|
9
8
|
bindir: exe
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2024-12-28 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: rdoc
|
15
14
|
requirement: !ruby/object:Gem::Requirement
|
16
15
|
requirements:
|
17
|
-
- - "
|
16
|
+
- - ">="
|
18
17
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
18
|
+
version: '0'
|
20
19
|
type: :runtime
|
21
20
|
prerelease: false
|
22
21
|
version_requirements: !ruby/object:Gem::Requirement
|
23
22
|
requirements:
|
24
|
-
- - "
|
23
|
+
- - ">="
|
25
24
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
25
|
+
version: '0'
|
27
26
|
- !ruby/object:Gem::Dependency
|
28
27
|
name: erb
|
29
28
|
requirement: !ruby/object:Gem::Requirement
|
30
29
|
requirements:
|
31
|
-
- - "
|
30
|
+
- - ">="
|
32
31
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
32
|
+
version: '0'
|
34
33
|
type: :runtime
|
35
34
|
prerelease: false
|
36
35
|
version_requirements: !ruby/object:Gem::Requirement
|
37
36
|
requirements:
|
38
|
-
- - "
|
37
|
+
- - ">="
|
39
38
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
39
|
+
version: '0'
|
41
40
|
- !ruby/object:Gem::Dependency
|
42
41
|
name: reverse_markdown
|
43
42
|
requirement: !ruby/object:Gem::Requirement
|
44
43
|
requirements:
|
45
|
-
- - "
|
44
|
+
- - ">="
|
46
45
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
46
|
+
version: '0'
|
48
47
|
type: :runtime
|
49
48
|
prerelease: false
|
50
49
|
version_requirements: !ruby/object:Gem::Requirement
|
51
50
|
requirements:
|
52
|
-
- - "
|
51
|
+
- - ">="
|
53
52
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
53
|
+
version: '0'
|
55
54
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
55
|
+
name: unindent
|
57
56
|
requirement: !ruby/object:Gem::Requirement
|
58
57
|
requirements:
|
59
|
-
- - "
|
58
|
+
- - ">="
|
60
59
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
60
|
+
version: '0'
|
62
61
|
type: :runtime
|
63
62
|
prerelease: false
|
64
63
|
version_requirements: !ruby/object:Gem::Requirement
|
65
64
|
requirements:
|
66
|
-
- - "
|
65
|
+
- - ">="
|
67
66
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
67
|
+
version: '0'
|
69
68
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
69
|
+
name: csv
|
71
70
|
requirement: !ruby/object:Gem::Requirement
|
72
71
|
requirements:
|
73
|
-
- - "
|
72
|
+
- - ">="
|
74
73
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
74
|
+
version: '0'
|
76
75
|
type: :runtime
|
77
76
|
prerelease: false
|
78
77
|
version_requirements: !ruby/object:Gem::Requirement
|
79
78
|
requirements:
|
80
|
-
- - "
|
79
|
+
- - ">="
|
81
80
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
81
|
+
version: '0'
|
83
82
|
- !ruby/object:Gem::Dependency
|
84
83
|
name: minitest
|
85
84
|
requirement: !ruby/object:Gem::Requirement
|
@@ -145,8 +144,6 @@ extensions: []
|
|
145
144
|
extra_rdoc_files: []
|
146
145
|
files:
|
147
146
|
- ".editorconfig"
|
148
|
-
- ".standard.yml"
|
149
|
-
- ".streerc"
|
150
147
|
- CODE_OF_CONDUCT.md
|
151
148
|
- Gemfile
|
152
149
|
- Gemfile.lock
|
@@ -156,13 +153,8 @@ files:
|
|
156
153
|
- example/Bird.md
|
157
154
|
- example/Duck.md
|
158
155
|
- example/Object.md
|
159
|
-
- example/RDoc.md
|
160
|
-
- example/RDoc/Generator.md
|
161
|
-
- example/RDoc/Generator/Markdown.md
|
162
|
-
- example/RDoc/Markdown.md
|
163
|
-
- example/TestGenerator.md
|
164
156
|
- example/Waterfowl.md
|
165
|
-
- example/index.
|
157
|
+
- example/index.csv
|
166
158
|
- lib/markdown.rb
|
167
159
|
- lib/rdoc/discover.rb
|
168
160
|
- lib/rdoc/generator/markdown.rb
|
@@ -177,7 +169,6 @@ metadata:
|
|
177
169
|
homepage_uri: https://poshtui.com
|
178
170
|
source_code_uri: https://github.com/skatkov/rdoc-markdown
|
179
171
|
changelog_uri: https://github.com/skatkov/rdoc-markdown
|
180
|
-
post_install_message:
|
181
172
|
rdoc_options: []
|
182
173
|
require_paths:
|
183
174
|
- lib
|
@@ -192,8 +183,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
192
183
|
- !ruby/object:Gem::Version
|
193
184
|
version: '0'
|
194
185
|
requirements: []
|
195
|
-
rubygems_version: 3.
|
196
|
-
signing_key:
|
186
|
+
rubygems_version: 3.6.2
|
197
187
|
specification_version: 4
|
198
188
|
summary: RDoc plugin to generate markdown documentation
|
199
189
|
test_files: []
|
data/.standard.yml
DELETED
data/.streerc
DELETED
@@ -1,30 +0,0 @@
|
|
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/Generator.md
DELETED
data/example/RDoc/Markdown.md
DELETED
data/example/RDoc.md
DELETED
data/example/TestGenerator.md
DELETED
@@ -1,10 +0,0 @@
|
|
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
DELETED
Binary file
|