rdoc-markdown 0.1.3 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +14 -2
- data/lib/rdoc/generator/markdown.rb +11 -1
- data/lib/rdoc/markdown/version.rb +1 -1
- data/lib/templates/classfile.md.erb +14 -19
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2daaac73b6d46ee2f2905484aa1257b756a51ebafdbb44277e6a4ddf8f08aa75
|
4
|
+
data.tar.gz: 627b149db5aadce52067bc7d54d0b672d92f21729598497bea9160e2bca4f6a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f9e1802dee3d4c5c5e98977527951c24355b2ba17507e2cdda3a0b573b4fa8f830eb2224dbf13e9ee81848d4598a7c4d703c0db242dba0f6a081f950f917aa4
|
7
|
+
data.tar.gz: bf1e6cfb1f1f6e982d43dee939ce2c14323b664570e953d2248539899852e0c4f92c6fd3c20784844a12a54e19fe5fb5c5ac6f14fc217f90811dc87f16aeb713
|
data/Gemfile.lock
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rdoc-markdown (0.1.
|
4
|
+
rdoc-markdown (0.1.8)
|
5
5
|
erb (~> 2.0)
|
6
6
|
rdoc (~> 6.0)
|
7
|
+
reverse_markdown (~> 2.0)
|
7
8
|
|
8
9
|
GEM
|
9
10
|
remote: https://rubygems.org/
|
@@ -13,14 +14,24 @@ GEM
|
|
13
14
|
erb (2.2.3)
|
14
15
|
cgi
|
15
16
|
minitest (5.16.3)
|
17
|
+
nokogiri (1.13.8-arm64-darwin)
|
18
|
+
racc (~> 1.4)
|
19
|
+
nokogiri (1.13.8-x86_64-linux)
|
20
|
+
racc (~> 1.4)
|
16
21
|
parallel (1.22.1)
|
17
22
|
parser (3.1.2.1)
|
18
23
|
ast (~> 2.4.1)
|
24
|
+
psych (4.0.6)
|
25
|
+
stringio
|
26
|
+
racc (1.6.0)
|
19
27
|
rainbow (3.1.1)
|
20
28
|
rake (13.0.6)
|
21
29
|
rdiscount (2.2.0.2)
|
22
|
-
rdoc (6.
|
30
|
+
rdoc (6.4.0)
|
31
|
+
psych (>= 4.0.0)
|
23
32
|
regexp_parser (2.5.0)
|
33
|
+
reverse_markdown (2.1.1)
|
34
|
+
nokogiri
|
24
35
|
rexml (3.2.5)
|
25
36
|
rubocop (1.29.1)
|
26
37
|
parallel (~> 1.10)
|
@@ -40,6 +51,7 @@ GEM
|
|
40
51
|
standard (1.12.1)
|
41
52
|
rubocop (= 1.29.1)
|
42
53
|
rubocop-performance (= 1.13.3)
|
54
|
+
stringio (3.0.2)
|
43
55
|
unicode-display_width (2.3.0)
|
44
56
|
|
45
57
|
PLATFORMS
|
@@ -4,6 +4,7 @@ gem "rdoc"
|
|
4
4
|
|
5
5
|
require "pathname"
|
6
6
|
require "erb"
|
7
|
+
require "reverse_markdown"
|
7
8
|
|
8
9
|
# Markdown generator.
|
9
10
|
# Registers command line options and generates markdown files
|
@@ -114,10 +115,19 @@ class RDoc::Generator::Markdown
|
|
114
115
|
out_file = Pathname.new("#{output_dir}/#{klass.full_name}.md")
|
115
116
|
out_file.dirname.mkpath
|
116
117
|
|
117
|
-
|
118
|
+
result = template.result(binding)
|
119
|
+
|
120
|
+
File.write(out_file, result)
|
118
121
|
end
|
119
122
|
end
|
120
123
|
|
124
|
+
|
125
|
+
private
|
126
|
+
|
127
|
+
def h(string)
|
128
|
+
ReverseMarkdown.convert string.strip, github_flavored: true
|
129
|
+
end
|
130
|
+
|
121
131
|
def setup
|
122
132
|
return if instance_variable_defined?(:@output_dir)
|
123
133
|
|
@@ -1,26 +1,21 @@
|
|
1
1
|
# <%= klass.name %>
|
2
|
-
## <% if klass.type == 'class' %><%= klass.type.capitalize %>[<%= klass.full_name %>](<%= klass
|
3
|
-
<% if klass.description && !klass.description.empty? %><%= klass.description %><% end %>
|
4
|
-
<% unless klass.constants.empty?
|
2
|
+
## <% if klass.type == 'class' %><%= klass.type.capitalize %> [<%= klass.full_name %>](<%= klass&.path %>)<% if klass.superclass %> inherits from <% end %><% unless String === klass.superclass %>[<%= klass.superclass&.name %>](<%= klass.superclass&.path %>) <% else %> <%= klass.superclass %> <% end %> <% else %> <%= klass.type.capitalize %>[<%= klass&.name %>](<%= klass&.path %>) <% end %>
|
3
|
+
<% if klass.description && !klass.description.empty? %><%= h klass.description %><% end %>
|
4
|
+
<% unless klass.constants.empty? %>
|
5
5
|
### Constants
|
6
|
-
<% klass.constants.sort_by { |x| x.name }.each do |const| %> <%= const.name %>
|
7
|
-
|
8
|
-
<% end %>
|
9
|
-
<% unless klass.attributes.empty?
|
6
|
+
<% klass.constants.sort_by { |x| x.name }.each do |const| %> <%= h const.name %>
|
7
|
+
<%= h const.description %>
|
8
|
+
<% end %><% end %>
|
9
|
+
<% unless klass.attributes.empty? %>
|
10
10
|
### Attributes
|
11
|
-
<% klass.attributes.sort_by { |x| x.name }.each do |attr| %><%= attr.name %>
|
11
|
+
<% klass.attributes.sort_by { |x| x.name }.each do |attr| %><%= h attr.name %>
|
12
12
|
<%= attr.rw %>
|
13
|
-
<%= attr.description %>
|
14
|
-
|
15
|
-
<% end %><% end %>
|
13
|
+
<%= h attr.description %><% end %><% end %>
|
16
14
|
<% unless klass_methods.empty? %>
|
17
|
-
<!-- Class Methods -->
|
18
15
|
### Public Class Methods
|
19
|
-
<% klass_methods.each do |method| %>[<%= method.name %><%= method.params %>](<%= method.aref %>)
|
20
|
-
<%= method.description %><% end %>
|
21
|
-
|
22
|
-
<% end %>
|
23
|
-
<% unless instance_methods.empty? %><!-- Instance Methods -->
|
16
|
+
<% klass_methods.each do |method| %>[<%= h method.name %><%= h method.params %>](<%= method.aref %>)
|
17
|
+
<%= h method.description %><% end %><% end %>
|
18
|
+
<% unless instance_methods.empty? %>
|
24
19
|
### Public Instance Methods
|
25
|
-
<% instance_methods.each do |method| %>[<%= method.name %><%= method.params %>](<%= method.aref %>)
|
26
|
-
|
20
|
+
<% instance_methods.each do |method| %>[<%= h method.name %><%= h method.params %>](<%= method.aref %>)
|
21
|
+
<% if method.name %><%= h method.description %><% end %><% end %><% end %>
|
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.5
|
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-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdoc
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '2.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: reverse_markdown
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '2.0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '2.0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: minitest
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -156,7 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
156
170
|
- !ruby/object:Gem::Version
|
157
171
|
version: '0'
|
158
172
|
requirements: []
|
159
|
-
rubygems_version: 3.
|
173
|
+
rubygems_version: 3.1.6
|
160
174
|
signing_key:
|
161
175
|
specification_version: 4
|
162
176
|
summary: rdoc generator that produces markdown files
|