rdoc-markdown 0.2.1 → 0.3

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: 16494339df3b522fae317e9010c0a9ee8cae1a7f4452595c8fde01e238421c64
4
- data.tar.gz: 1dec9b05ccdea281811213800b2301a4f89097dcaacbf72ac59fa7c85aeff676
3
+ metadata.gz: 022adabd6f2ced45f3d5ff3216b48376914f7ba7b80cc1b87d83e8d7507824d7
4
+ data.tar.gz: 5d9a514dbbcf570811d0a3f230a2eff9434d61413cf994500bb6fd1f1f49a5d2
5
5
  SHA512:
6
- metadata.gz: 30b4a879efd549f01f627558c390b34b05aece87ce14fe46293770e342c90fdaf176457b50fad52f215de6aa91b7477607601530d8874f60869570e9990b043d
7
- data.tar.gz: 76947d62302a58b3ceeb41d78be86dcbe7d6032fa41579e9287567aecda5bf23c7271bfb453c8125d9dd6d6b934bd5de996637145a2ba377f068f8198909c82a
6
+ metadata.gz: 41604d7644f1e4a437f79c3fcbc868c71189355e4b4ae79be430bd313e7729970d8029af95e2d649c71226079acef183329a1b63c1ce500a00815fa82ef587c1
7
+ data.tar.gz: f0a44ac4166d92a26b5166c8a290cbcfe16970b8d20c4f8c92ea4f0b5c3a1ae9a23ffe0348f79323c22caad9687eddb0d82346da3a31ba5b7594aeb39dd5e971
data/Gemfile.lock CHANGED
@@ -1,8 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rdoc-markdown (0.2.1)
5
- activesupport (~> 7.0)
4
+ rdoc-markdown (0.3)
6
5
  erb (~> 2.0)
7
6
  extralite-bundle (~> 1.0)
8
7
  rdoc (~> 6.0)
@@ -12,19 +11,11 @@ PATH
12
11
  GEM
13
12
  remote: https://rubygems.org/
14
13
  specs:
15
- activesupport (7.0.4)
16
- concurrent-ruby (~> 1.0, >= 1.0.2)
17
- i18n (>= 1.6, < 2)
18
- minitest (>= 5.1)
19
- tzinfo (~> 2.0)
20
14
  ast (2.4.2)
21
15
  cgi (0.3.3)
22
- concurrent-ruby (1.1.10)
23
16
  erb (2.2.3)
24
17
  cgi
25
18
  extralite-bundle (1.16)
26
- i18n (1.12.0)
27
- concurrent-ruby (~> 1.0)
28
19
  json (2.6.2)
29
20
  minitest (5.16.3)
30
21
  nokogiri (1.13.9-arm64-darwin)
@@ -66,8 +57,6 @@ GEM
66
57
  rubocop (= 1.35.1)
67
58
  rubocop-performance (= 1.14.3)
68
59
  stringio (3.0.2)
69
- tzinfo (2.0.5)
70
- concurrent-ruby (~> 1.0)
71
60
  unicode-display_width (2.3.0)
72
61
  unindent (1.0)
73
62
 
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # Rdoc::Markdown
2
- Rdoc Generator plugin to generate markdown documentation and search index as sqlite database that goes along with it.
2
+ RDoc plugin to generate markdown documentation and search index as sqlite database for entire content.
3
3
 
4
4
  ## Installation
5
5
 
@@ -5,9 +5,8 @@ gem "rdoc"
5
5
  require "pathname"
6
6
  require "erb"
7
7
  require "reverse_markdown"
8
- require 'extralite'
9
- require 'active_support/core_ext/string/inflections'
10
- require 'unindent'
8
+ require "extralite"
9
+ require "unindent"
11
10
 
12
11
  class RDoc::Generator::Markdown
13
12
  RDoc::RDoc.add_generator self
@@ -95,7 +94,7 @@ class RDoc::Generator::Markdown
95
94
  # This class emits a search index for generated documentation as sqlite database
96
95
  #
97
96
 
98
- def emit_sqlite(name="index.db")
97
+ def emit_sqlite(name = "index.db")
99
98
  db = Extralite::Database.new("#{output_dir}/#{name}")
100
99
 
101
100
  db.execute <<-SQL
@@ -130,7 +129,7 @@ class RDoc::Generator::Markdown
130
129
  result << {
131
130
  name: "#{klass.full_name}.#{const.name}",
132
131
  type: "Constant",
133
- path: "#{turn_to_path(klass.full_name)}##{ActiveSupport::Inflector.parameterize const.name}"
132
+ path: "#{turn_to_path(klass.full_name)}##{const.name}"
134
133
  }
135
134
  end
136
135
 
@@ -150,19 +149,6 @@ class RDoc::Generator::Markdown
150
149
 
151
150
  def emit_classfiles
152
151
  @classes.each do |klass|
153
- klass_methods = []
154
- instance_methods = []
155
-
156
- klass.method_list.each do |method|
157
- next if method.visibility.to_s.eql?("private")
158
-
159
- if method.type == "class"
160
- klass_methods << method
161
- else
162
- instance_methods << method
163
- end
164
- end
165
-
166
152
  template = ERB.new File.read(File.join(TEMPLATE_DIR, "classfile.md.erb"))
167
153
 
168
154
  out_file = Pathname.new("#{output_dir}/#{turn_to_path klass.full_name}")
@@ -185,7 +171,7 @@ class RDoc::Generator::Markdown
185
171
  # Converts HTML string into a Markdown string with some cleaning and improvements.
186
172
 
187
173
  def markdownify(input)
188
- md= ReverseMarkdown.convert input, github_flavored: true
174
+ md = ReverseMarkdown.convert input
189
175
 
190
176
  # unintent multiline strings
191
177
  md.unindent!
@@ -196,14 +182,10 @@ class RDoc::Generator::Markdown
196
182
 
197
183
  "[#{match[1]}](#{match[2]}.md#{match[3]})"
198
184
  end
199
-
200
- # clean up things, to make it look neat.
201
-
202
- md.gsub("[↑](#top)", "").lstrip
203
185
  end
204
186
 
205
187
  # Aliasing a shorter method name for use in templates
206
- alias_method :h, :markdownify
188
+ alias_method :h, :markdownify
207
189
 
208
190
  ##
209
191
  # Prepares for document generation, by creating required folders and initializing variables.
@@ -219,14 +201,4 @@ class RDoc::Generator::Markdown
219
201
 
220
202
  @classes = @store.all_classes_and_modules.sort
221
203
  end
222
-
223
- ##
224
- # Return a list of the documented modules sorted by salience first, then
225
- # by name.
226
-
227
- def get_sorted_module_list classes
228
- classes.select do |klass|
229
- klass.display?
230
- end.sort
231
- end
232
204
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Rdoc
4
4
  module Markdown
5
- VERSION = "0.2.1"
5
+ VERSION = "0.3"
6
6
  end
7
7
  end
@@ -1,23 +1,31 @@
1
- # <% if klass.type == 'class' %><%= klass.type.capitalize %>: **<%= klass.full_name %>**<% if klass.superclass %> < <% end %><% unless String === klass.superclass %><%= klass.superclass&.name %> <% else %> <%= klass.superclass %> <% end %> <% else %> <%= klass.type.capitalize %>: <%= klass&.name %> <% end %>
1
+ # <%= klass.type %> <%= klass.full_name.strip %> [](#<%= klass.aref.strip %>) [](#top)
2
2
  <%= h klass.description %>
3
- <% unless klass.constants.empty? %>
4
- | Constants | Description |
5
- | ------------- | ------------- |
6
- <% klass.constants.sort_by { |x| x.name }.each do |const| %> |**[<%= const.name %>](#<%= ActiveSupport::Inflector.parameterize const.name%>)** | <%= h const.description %> |
7
- <% end %><% end %>
8
- <% unless klass.attributes.empty? %>
3
+ <% klass.each_section do |section, constants, attributes| %>
4
+ <% if section.title %>## <%= section.title.strip %> <% end %>
5
+ <% if section.comment %> <%=h section.description %><% end%>
6
+ <% unless klass.constants.empty? %>
7
+ ## Constants
8
+ <% klass.constants.each do |const| %>
9
+ ### <%= const.name.strip %>[](#<%= const.name.strip %>)
10
+ <% if const.comment %> <%= h const.description %> <%else%> (Not documented) <% end %>
11
+ <% end %>
12
+ <% end %>
13
+ <% unless attributes&.empty? %>
9
14
  ## Attributes
10
- <% klass.attributes.sort_by { |x| x.name }.each do |attr| %>
11
- [[**<%= attr.rw %>**] <%= attr.name %>](#<%= attr.aref %>)
12
- <% end %><% end %>
13
- <% unless klass_methods.empty? %>
14
- ## Public Class Methods
15
- ***
16
- <% klass_methods.each do |method| %>### [<%= method.name %><%= method.params %>](#<%= method.aref %>)
17
-
18
- <%= h method.description %><% end %><% end %>
19
- <% unless instance_methods.empty? %>
20
- ## Public Instance Methods
21
- <% instance_methods.each do |method| %>### [<%= method.name %><%= method.params %>](#<%= method.aref %>)
22
-
23
- <%= h method.description %><% end %><% end %>
15
+ <% attributes.each do |attr| %>
16
+ ### <%= attr.rw %><%=h attr.name.strip %>[](#<%= attr.aref.strip %>)
17
+ <% if attr.comment %> <%= h attr.description %> <%else%> (Not documented) <% end %>
18
+ <% end %>
19
+ <% end %>
20
+ <% klass.methods_by_type(section).each do |type, visibilities| %>
21
+ <% next if visibilities.empty? %>
22
+ <% visibilities.each do |visibility, methods| %>
23
+ <% next if methods.empty? %>
24
+ ## <%= visibility.capitalize %> <%= type.capitalize %> Methods
25
+ <% methods.each do |method|%>
26
+ ### <%= method.name.strip %><%= method.param_seq.strip %> [](#<%= method.aref.strip %>)
27
+ <% if method.comment %> <%= h method.description %> <% else %> (Not documented) <%end%>
28
+ <% end %>
29
+ <% end %>
30
+ <% end %>
31
+ <% 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.2.1
4
+ version: '0.3'
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-23 00:00:00.000000000 Z
11
+ date: 2022-10-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rdoc
@@ -66,20 +66,6 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '1.0'
69
- - !ruby/object:Gem::Dependency
70
- name: activesupport
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: '7.0'
76
- type: :runtime
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: '7.0'
83
69
  - !ruby/object:Gem::Dependency
84
70
  name: unindent
85
71
  requirement: !ruby/object:Gem::Requirement