rdoc-markdown 0.1.4 → 0.1.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c6496d719bac799f108e7504fb0eef463533e1aa3df50a0da4877d44ff514c7e
4
- data.tar.gz: b1da8475d96bdec1615012f21bdfcdf6709597837974409f43923d1452f5f430
3
+ metadata.gz: 2daaac73b6d46ee2f2905484aa1257b756a51ebafdbb44277e6a4ddf8f08aa75
4
+ data.tar.gz: 627b149db5aadce52067bc7d54d0b672d92f21729598497bea9160e2bca4f6a4
5
5
  SHA512:
6
- metadata.gz: 0a8f5ea92bad8e716b72b642831e948dcf97b4fc58375600b764361e3805665c0cb7ed5cd8d87986b4b909daa1c16b08a1053bacf63bbe0494e7b4b0d6f71035
7
- data.tar.gz: e95317429aa6bc84be6c45304453c89602c29d50db68aa7b2aa5802c7916c4be6d0ad0ada196fbff48c265583919171cffdc2a5e37340d9a054f967fd6fad6de
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.3)
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.2.1.1)
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
- File.write(out_file, template.result(binding))
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
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Rdoc
4
4
  module Markdown
5
- VERSION = "0.1.4"
5
+ VERSION = "0.1.5"
6
6
  end
7
7
  end
@@ -1,22 +1,21 @@
1
- # <%= klass&.name %>
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? %><%= klass.description %><% end %>
1
+ # <%= klass.name %>
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
4
  <% unless klass.constants.empty? %>
5
5
  ### Constants
6
- <% klass.constants.sort_by { |x| x&.name }.each do |const| %> <%= const&.name %> <% end %>
7
- <% end %>
6
+ <% klass.constants.sort_by { |x| x.name }.each do |const| %> <%= h const.name %>
7
+ <%= h const.description %>
8
+ <% end %><% end %>
8
9
  <% unless klass.attributes.empty? %>
9
10
  ### Attributes
10
- <% 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 %>
11
12
  <%= attr.rw %>
12
- <%= attr.description %>
13
- <% end %><% end %>
13
+ <%= h attr.description %><% end %><% end %>
14
14
  <% unless klass_methods.empty? %>
15
15
  ### Public Class Methods
16
- <% klass_methods.each do |method| %>[<%= method&.name %><%= method.params %>](<%= method.aref %>)
17
- <%= method.description %><% end %>
18
- <% end %>
16
+ <% klass_methods.each do |method| %>[<%= h method.name %><%= h method.params %>](<%= method.aref %>)
17
+ <%= h method.description %><% end %><% end %>
19
18
  <% unless instance_methods.empty? %>
20
19
  ### Public Instance Methods
21
- <% instance_methods.each do |method| %>[<%= method&.name %><%= method.params %>](<%= method.aref %>)
22
- <%= method.description %><% end %><% end %>
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
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-14 00:00:00.000000000 Z
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