rdoc-markdown 0.1.10 → 0.1.13
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/Gemfile.lock +3 -1
- data/docs/example.rb +3 -3
- data/lib/rdoc/generator/markdown.rb +60 -2
- data/lib/rdoc/markdown/version.rb +1 -1
- data/publish.sh +6 -0
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a38c23f0593e099cf817af08dbf8c2f73573462135c99eafae1c8d060bffbc26
|
4
|
+
data.tar.gz: c209b03ef83bc8d936d5638a775c15b8c1ff0626ec94bbdd138abc2596e73999
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a16a238ac2090d2d60a3c998bff28a9787a5d123fe5215e813b01f410433f8ac5264be02cb5677248c239e5d72bc26613c5a9d6b837eae90fe3d232b4eb25bda
|
7
|
+
data.tar.gz: ed04a374783a90b072f757d39439e0749d52bac3e6ee6d13af0b90408746f96c2d3257e50a72452ad749689bcd3dbe767ac509bf6bc1b597c7ad7771810c4554
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rdoc-markdown (0.1.
|
4
|
+
rdoc-markdown (0.1.10)
|
5
5
|
erb (~> 2.0)
|
6
|
+
extralite-bundle (~> 1.0)
|
6
7
|
rdoc (~> 6.0)
|
7
8
|
reverse_markdown (~> 2.0)
|
8
9
|
|
@@ -13,6 +14,7 @@ GEM
|
|
13
14
|
cgi (0.3.3)
|
14
15
|
erb (2.2.3)
|
15
16
|
cgi
|
17
|
+
extralite-bundle (1.16)
|
16
18
|
json (2.6.2)
|
17
19
|
minitest (5.16.3)
|
18
20
|
nokogiri (1.13.8-arm64-darwin)
|
data/docs/example.rb
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
##
|
2
|
-
# === RDoc::Generator::
|
2
|
+
# === RDoc::Generator::Markdown example.
|
3
3
|
#
|
4
|
-
# This example employs
|
4
|
+
# This example employs various RDoc features to demonstrate
|
5
5
|
# generator output.
|
6
6
|
#
|
7
7
|
# ---
|
8
8
|
#
|
9
9
|
# Links:
|
10
10
|
#
|
11
|
-
# 1. {Project Home Page}[https://github.com/
|
11
|
+
# 1. {Project Home Page}[https://github.com/skatkov/rdoc-markdown)
|
12
12
|
# 2. {RDoc Documentation}[http://ruby-doc.org/stdlib-2.0.0/libdoc/rdoc/rdoc/RDoc/Markup.html]
|
13
13
|
#
|
14
14
|
|
@@ -5,6 +5,7 @@ gem "rdoc"
|
|
5
5
|
require "pathname"
|
6
6
|
require "erb"
|
7
7
|
require "reverse_markdown"
|
8
|
+
require 'extralite'
|
8
9
|
|
9
10
|
class RDoc::Generator::Markdown
|
10
11
|
RDoc::RDoc.add_generator self
|
@@ -60,6 +61,10 @@ class RDoc::Generator::Markdown
|
|
60
61
|
debug("Generate documentation in #{@output_dir}")
|
61
62
|
|
62
63
|
emit_classfiles
|
64
|
+
|
65
|
+
debug("Generate index db file: #{output_dir}/index.db")
|
66
|
+
|
67
|
+
emit_sqlite
|
63
68
|
end
|
64
69
|
|
65
70
|
private
|
@@ -74,6 +79,59 @@ class RDoc::Generator::Markdown
|
|
74
79
|
end
|
75
80
|
end
|
76
81
|
|
82
|
+
def emit_sqlite
|
83
|
+
db = Extralite::Database.new("#{output_dir}/index.db")
|
84
|
+
|
85
|
+
db.execute <<-SQL
|
86
|
+
create table contentIndex (
|
87
|
+
id INTEGER PRIMARY KEY,
|
88
|
+
name TEXT,
|
89
|
+
type TEXT,
|
90
|
+
path TEXT
|
91
|
+
);
|
92
|
+
SQL
|
93
|
+
|
94
|
+
result = []
|
95
|
+
|
96
|
+
@classes.map do |klass|
|
97
|
+
result << {
|
98
|
+
name: klass.full_name,
|
99
|
+
type: klass.type.capitalize,
|
100
|
+
path: turn_to_path(klass.full_name)
|
101
|
+
}
|
102
|
+
|
103
|
+
klass.method_list.each do |method|
|
104
|
+
next if method.visibility.to_s.eql?("private")
|
105
|
+
|
106
|
+
result << {
|
107
|
+
name: "#{klass.full_name}.#{method.name}",
|
108
|
+
type: "Method",
|
109
|
+
path: turn_to_path(klass.full_name)
|
110
|
+
}
|
111
|
+
end
|
112
|
+
|
113
|
+
klass.constants.sort_by { |x| x.name }.each do |const|
|
114
|
+
result << {
|
115
|
+
name: "#{klass.full_name}.#{const.name}",
|
116
|
+
type: "Constant",
|
117
|
+
path: turn_to_path(klass.full_name)
|
118
|
+
}
|
119
|
+
end
|
120
|
+
|
121
|
+
klass.attributes.sort_by { |x| x.name }.each do |attr|
|
122
|
+
result << {
|
123
|
+
name: "#{klass.full_name}.#{attr.name}",
|
124
|
+
type: "Attribute",
|
125
|
+
path: turn_to_path(klass.full_name)
|
126
|
+
}
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
result.each do |rec|
|
131
|
+
db.execute "insert into contentIndex (name, type, path) values (:name, :type, :path)", rec
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
77
135
|
def emit_classfiles
|
78
136
|
@classes.each do |klass|
|
79
137
|
klass_methods = []
|
@@ -91,7 +149,7 @@ class RDoc::Generator::Markdown
|
|
91
149
|
|
92
150
|
template = ERB.new File.read(File.join(TEMPLATE_DIR, "classfile.md.erb"))
|
93
151
|
|
94
|
-
out_file = Pathname.new("#{output_dir}/#{turn_to_path klass.full_name}
|
152
|
+
out_file = Pathname.new("#{output_dir}/#{turn_to_path klass.full_name}")
|
95
153
|
out_file.dirname.mkpath
|
96
154
|
|
97
155
|
result = template.result(binding)
|
@@ -104,7 +162,7 @@ class RDoc::Generator::Markdown
|
|
104
162
|
private
|
105
163
|
|
106
164
|
def turn_to_path(class_name)
|
107
|
-
class_name.gsub("::", "/")
|
165
|
+
"#{class_name.gsub("::", "/")}.md"
|
108
166
|
end
|
109
167
|
|
110
168
|
def markdownify(input)
|
data/publish.sh
ADDED
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.1.
|
4
|
+
version: 0.1.13
|
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-10-
|
11
|
+
date: 2022-10-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdoc
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '2.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: extralite-bundle
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: minitest
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -147,6 +161,7 @@ files:
|
|
147
161
|
- lib/rdoc/generator/markdown.rb
|
148
162
|
- lib/rdoc/markdown/version.rb
|
149
163
|
- lib/templates/classfile.md.erb
|
164
|
+
- publish.sh
|
150
165
|
- sig/rdoc/markdown.rbs
|
151
166
|
homepage: https://poshtui.com
|
152
167
|
licenses:
|