rdoc-markdown 0.3.5 → 0.3.6

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: eb88e163756c49396b718459f7d5dafc96350d4326d6fd1e57a13fc3ac011116
4
- data.tar.gz: 2a7477e2eb1b98af6cd06933e67f129892a492971b9ce60b64da4d296a42ac18
3
+ metadata.gz: cc9298f0cd81d54367d58d68aa1cacead0c80be2e43ea591f5fe4bbf29e44ca5
4
+ data.tar.gz: 15b4e889626b4b06fe2cd98e910f26d974d849690cb11a351e6fcceae55aeae1
5
5
  SHA512:
6
- metadata.gz: fa23545b89bfedd7cec08dd8f387727df15fb75c6cc532b35566fcb2ab2e53f85c94c7ec88e364edf59df15c6d2363b8ad3f54ec51627c6b1cac6592c83f2188
7
- data.tar.gz: ac8f4cd2f344afb9ac357ecd16202e40c60527e2db149fba53cff7ca55682561082c1a8a56958b914b5ba7c09a5d1c66b40b60b89c87bc51c3e8ef1c1d963987
6
+ metadata.gz: 779545ebd9dfdb19e8c474ff3ae851586ac9bddf069e74a828fe9cc2c482e4c1ca22fd11330065c35419099612d8977001b63940d4f583d3f6de838ccdbde25d
7
+ data.tar.gz: 2f2306bff2ca81fd87487db0f771ce24ecd4fbe4ceb8dfe379b538ea2d11689c7d7133dd91f380ce9248bafd51d3ac09bb1477f18e7adde4731444092b296415
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rdoc-markdown (0.3.3)
4
+ rdoc-markdown (0.3.7)
5
5
  erb (~> 2.0)
6
6
  extralite-bundle (~> 1.0)
7
7
  rdoc (~> 6.0)
@@ -33,29 +33,29 @@ GEM
33
33
  rdiscount (2.2.7)
34
34
  rdoc (6.4.0)
35
35
  psych (>= 4.0.0)
36
- regexp_parser (2.6.0)
36
+ regexp_parser (2.6.1)
37
37
  reverse_markdown (2.1.1)
38
38
  nokogiri
39
39
  rexml (3.2.5)
40
- rubocop (1.35.1)
40
+ rubocop (1.39.0)
41
41
  json (~> 2.3)
42
42
  parallel (~> 1.10)
43
43
  parser (>= 3.1.2.1)
44
44
  rainbow (>= 2.2.2, < 4.0)
45
45
  regexp_parser (>= 1.8, < 3.0)
46
46
  rexml (>= 3.2.5, < 4.0)
47
- rubocop-ast (>= 1.20.1, < 2.0)
47
+ rubocop-ast (>= 1.23.0, < 2.0)
48
48
  ruby-progressbar (~> 1.7)
49
49
  unicode-display_width (>= 1.4.0, < 3.0)
50
50
  rubocop-ast (1.23.0)
51
51
  parser (>= 3.1.1.0)
52
- rubocop-performance (1.14.3)
52
+ rubocop-performance (1.15.0)
53
53
  rubocop (>= 1.7.0, < 2.0)
54
54
  rubocop-ast (>= 0.4.0)
55
55
  ruby-progressbar (1.11.0)
56
- standard (1.16.1)
57
- rubocop (= 1.35.1)
58
- rubocop-performance (= 1.14.3)
56
+ standard (1.18.0)
57
+ rubocop (= 1.39.0)
58
+ rubocop-performance (= 1.15.0)
59
59
  stringio (3.0.2)
60
60
  unicode-display_width (2.3.0)
61
61
  unindent (1.0)
data/README.md CHANGED
@@ -13,6 +13,9 @@ Install gem and add to application's Gemfile by executing:
13
13
  If bundler is not being used to manage dependencies, install the gem by executing:
14
14
 
15
15
  $ gem install rdoc-markdown
16
+ ## Examples
17
+ Find examples in [/examples](/example/) folder. You can regenerate examples by running `./bin/generate.sh`, it will produce examples based on file in `test/data/*` folder.
18
+
16
19
 
17
20
  ## Usage
18
21
  RDoc will auto-detect rdoc-markdown plugin if it was installed. You just need to instruct RDoc to produce markdown output instead of standard HTML through `format` parameter.
data/example/Bird.md ADDED
@@ -0,0 +1,17 @@
1
+ # class Bird [](#class-Bird) [](#top)
2
+ The base class for all birds.
3
+
4
+ ## Public Instance Methods
5
+ ### fly(string, number) -> bool [](#method-i-fly)
6
+ Fly somewhere.
7
+
8
+ Flying is the most critical feature of birds.
9
+
10
+ = Example
11
+
12
+ fly(:south, 70)
13
+
14
+ ### speak() { |text| ... } [](#method-i-speak)
15
+ Produce some noise.
16
+
17
+
data/example/Duck.md ADDED
@@ -0,0 +1,50 @@
1
+ # class Duck [](#class-Duck) [](#top)
2
+ A duck is a [`Waterfowl`](Waterfowl.html) [`Bird`](Bird.html).
3
+
4
+ Features:
5
+
6
+ bird::
7
+
8
+ - speak
9
+
10
+ - fly
11
+
12
+ waterfowl::
13
+
14
+ - swim
15
+
16
+ ## Constants
17
+ | Name | Description |
18
+ | ---- | ----------- |
19
+ | **MAX_VELOCITY[](#MAX_VELOCITY)** | Not documented |
20
+ ## Bird overrides ## Constants
21
+ | Name | Description |
22
+ | ---- | ----------- |
23
+ | **MAX_VELOCITY[](#MAX_VELOCITY)** | Not documented |
24
+ ## Public Instance Methods
25
+ ### speak() { |speech| ... } [](#method-i-speak)
26
+ [`Duck`](Duck.html) overrides generic implementation.
27
+
28
+ ## Duck extensions ## Constants
29
+ | Name | Description |
30
+ | ---- | ----------- |
31
+ | **MAX_VELOCITY[](#MAX_VELOCITY)** | Not documented |
32
+ ## Attributes
33
+ ### domestic[RW] [](#attribute-i-domestic)
34
+ True for domestic ducks.
35
+
36
+ ### rubber[R] [](#attribute-i-rubber)
37
+ True for rubber ducks.
38
+
39
+ ## Public Class Methods
40
+ ### new(domestic, rubber) [](#method-c-new)
41
+ Creates a new duck.
42
+
43
+ ### rubber_ducks() [](#method-c-rubber_ducks)
44
+ Returns list of all rubber ducks.
45
+
46
+ ## Public Instance Methods
47
+ ### useful? -> bool [](#method-i-useful-3F)
48
+ Checks if this duck is a useful one.
49
+
50
+
data/example/Object.md ADDED
@@ -0,0 +1,8 @@
1
+ # class Object [](#class-Object) [](#top)
2
+ ## Constants
3
+ | Name | Description |
4
+ | ---- | ----------- |
5
+ | **DEFAULT_DUCK_VELOCITY[](#DEFAULT_DUCK_VELOCITY)** | Default velocity for a flying duck.
6
+
7
+ |
8
+
@@ -0,0 +1,32 @@
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
+
7
+ |
8
+ ## Attributes
9
+ ### base_dir[R] [](#attribute-i-base_dir)
10
+ The path to generate files into, combined with `--op` from the options for a full path.
11
+
12
+ ### classes[R] [](#attribute-i-classes)
13
+ Classes and modules to be used by this generator, not necessarily displayed.
14
+
15
+ ### store[R] [](#attribute-i-store)
16
+ The RDoc::Store that is the source of the generated content
17
+
18
+ ## Public Class Methods
19
+ ### new(store, options) [](#method-c-new)
20
+ Initializer method for Rdoc::Generator::Markdown
21
+
22
+ ## Public Instance Methods
23
+ ### class_dir() [](#method-i-class_dir)
24
+ Directory where generated class HTML files live relative to the output dir.
25
+
26
+ ### file_dir() [](#method-i-file_dir)
27
+ this alias is required for rdoc to work
28
+
29
+ ### generate() [](#method-i-generate)
30
+ Generates markdown files and search index file
31
+
32
+
@@ -0,0 +1,2 @@
1
+ # module RDoc::Generator [](#module-RDoc::Generator) [](#top)
2
+
@@ -0,0 +1,2 @@
1
+ # class RDoc::Markdown [](#class-RDoc::Markdown) [](#top)
2
+
data/example/RDoc.md ADDED
@@ -0,0 +1,2 @@
1
+ # module RDoc [](#module-RDoc) [](#top)
2
+
@@ -0,0 +1,6 @@
1
+ # module Rdoc::Markdown [](#module-Rdoc::Markdown) [](#top)
2
+ ## Constants
3
+ | Name | Description |
4
+ | ---- | ----------- |
5
+ | **VERSION[](#VERSION)** | Not documented |
6
+
data/example/Rdoc.md ADDED
@@ -0,0 +1,2 @@
1
+ # module Rdoc [](#module-Rdoc) [](#top)
2
+
@@ -0,0 +1,10 @@
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
+
@@ -0,0 +1,8 @@
1
+ # module Waterfowl [](#module-Waterfowl) [](#top)
2
+ A mixin for waterfowl creatures.
3
+
4
+ ## Public Instance Methods
5
+ ### swim() [](#method-i-swim)
6
+ Swimming helper.
7
+
8
+
data/example/index.db ADDED
Binary file
@@ -151,12 +151,14 @@ class RDoc::Generator::Markdown
151
151
 
152
152
  def emit_classfiles
153
153
  @classes.each do |klass|
154
- template = ERB.new File.read(File.join(TEMPLATE_DIR, "classfile.md.erb"))
154
+ template_content = File.read(File.join(TEMPLATE_DIR, "classfile.md.erb"))
155
+
156
+ template = ERB.new template_content, trim_mode: ">"
155
157
 
156
158
  out_file = Pathname.new("#{output_dir}/#{turn_to_path klass.full_name}")
157
159
  out_file.dirname.mkpath
158
160
 
159
- result = template.result(binding).squeeze(" ").gsub("\n ", "\n").squeeze("\n\n")
161
+ result = template.result(binding).squeeze(" ")
160
162
 
161
163
  File.write(out_file, result)
162
164
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Rdoc
4
4
  module Markdown
5
- VERSION = "0.3.5"
5
+ VERSION = "0.3.6"
6
6
  end
7
7
  end
@@ -7,8 +7,7 @@
7
7
  ## Constants
8
8
  | Name | Description |
9
9
  | ---- | ----------- |
10
- <% klass.constants.each do |const| %>
11
- | **<%= const.name %>[](#<%= const.name %>)** | <% unless const.description.empty? %> <%= h const.description %> <%else%> Not documented <% end %> |
10
+ <% klass.constants.each do |const| %> | **<%= const.name %>[](#<%= const.name %>)** | <% unless const.description.empty? %> <%= h const.description %> <%else%> Not documented <% end %> |
12
11
  <% end %>
13
12
  <% end %>
14
13
  <% unless attributes&.empty? %>
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.3.5
4
+ version: 0.3.6
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-11-05 00:00:00.000000000 Z
11
+ date: 2022-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rdoc
@@ -166,6 +166,18 @@ files:
166
166
  - LICENSE
167
167
  - README.md
168
168
  - Rakefile
169
+ - example/Bird.md
170
+ - example/Duck.md
171
+ - example/Object.md
172
+ - example/RDoc.md
173
+ - example/RDoc/Generator.md
174
+ - example/RDoc/Generator/Markdown.md
175
+ - example/RDoc/Markdown.md
176
+ - example/Rdoc.md
177
+ - example/Rdoc/Markdown.md
178
+ - example/TestGenerator.md
179
+ - example/Waterfowl.md
180
+ - example/index.db
169
181
  - lib/markdown.rb
170
182
  - lib/rdoc/discover.rb
171
183
  - lib/rdoc/generator/markdown.rb