rdoc-markdown 0.1.6 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +5 -5
- data/lib/rdoc/generator/markdown.rb +14 -2
- data/lib/rdoc/markdown/version.rb +1 -1
- data/lib/templates/classfile.md.erb +18 -15
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d00a1ac32eb71f6eff97e6ee46bb1756c5fad8d97125c269ca0a1a5ba69f8061
|
4
|
+
data.tar.gz: 34ee2b38e839454a19f197466248db8033076d5113fb4da9895a4ed5a9b00e98
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0a1f0294c47c08f72134820afc998a5d01dc4a20d7588df73f9dcbde9ce1b778282480ac35d9d95fea3b73b738ba9e30166bbf861f493713e18b8b3c4b2a300
|
7
|
+
data.tar.gz: 3dc3972ce4e1ef10116c2fa1dcb04ad980e9a73068d79a6399e0abbcca3b49f16f28fe5db1855bc353643cedf92c781853c56e7e9a0bf09b4c55783d539537a8
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
!!! This is just experimental gem
|
2
|
-
|
3
1
|
# Rdoc::Markdown
|
4
2
|
This gem is focused on spitting readable markdown files based on rdoc documentation. It should also come with sqlite database as an index (but this is so far only in plans).
|
5
3
|
|
4
|
+
It is still actively in development and while works as proof of concept, still has some quirks here and there.
|
5
|
+
|
6
6
|
## Installation
|
7
7
|
|
8
8
|
Install the gem and add to the application's Gemfile by executing:
|
@@ -20,7 +20,7 @@ First thing to do, is to install a gem
|
|
20
20
|
|
21
21
|
Then proceed to directory where you want to generate documentation:
|
22
22
|
|
23
|
-
`rdoc --format=markdown
|
23
|
+
`rdoc --format=markdown`
|
24
24
|
|
25
25
|
Don't forget to append `--debug` to have a bit more information in case thing fail (and they will probably do, because this entire thing is experimental).
|
26
26
|
|
@@ -48,8 +48,8 @@ gem push rdoc-markdown-0.1.2.gem
|
|
48
48
|
```
|
49
49
|
## Contributing
|
50
50
|
|
51
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
51
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/skatkov/rdoc-markdown. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/skatkov/rdoc-markdown/blob/master/CODE_OF_CONDUCT.md).
|
52
52
|
|
53
53
|
## Code of Conduct
|
54
54
|
|
55
|
-
Everyone interacting in the Rdoc::Markdown project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/
|
55
|
+
Everyone interacting in the Rdoc::Markdown project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/skatkov/rdoc-markdown/blob/master/CODE_OF_CONDUCT.md).
|
@@ -112,7 +112,7 @@ class RDoc::Generator::Markdown
|
|
112
112
|
|
113
113
|
template = ERB.new File.read(File.join(TEMPLATE_DIR, "classfile.md.erb"))
|
114
114
|
|
115
|
-
out_file = Pathname.new("#{output_dir}/#{klass.full_name}.md")
|
115
|
+
out_file = Pathname.new("#{output_dir}/#{turn_to_path klass.full_name}.md")
|
116
116
|
out_file.dirname.mkpath
|
117
117
|
|
118
118
|
result = template.result(binding)
|
@@ -124,8 +124,20 @@ class RDoc::Generator::Markdown
|
|
124
124
|
|
125
125
|
private
|
126
126
|
|
127
|
+
def replace_extensions_in_links(text)
|
128
|
+
text.gsub(/\[(.+)\]\((.+).html(.*)\)/) do |_|
|
129
|
+
match = Regexp.last_match
|
130
|
+
|
131
|
+
"[#{match[1]}](#{match[2]}.md#{match[3]})"
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
def turn_to_path(class_name)
|
136
|
+
class_name.gsub("::", "/")
|
137
|
+
end
|
138
|
+
|
127
139
|
def h(string)
|
128
|
-
ReverseMarkdown.convert string.strip, github_flavored: true
|
140
|
+
replace_extensions_in_links ReverseMarkdown.convert string.strip, github_flavored: true
|
129
141
|
end
|
130
142
|
|
131
143
|
def setup
|
@@ -1,21 +1,24 @@
|
|
1
|
-
# <%= klass.name %>
|
2
|
-
|
3
|
-
<% if klass.description && !klass.description.empty? %><%= h klass.description %><% end %>
|
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 %>
|
2
|
+
<% if klass.description && !klass.description.empty? %><%= h klass.description %><% end %>
|
4
3
|
<% unless klass.constants.empty? %>
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
## Constants
|
5
|
+
***
|
6
|
+
<% klass.constants.sort_by { |x| x.name }.each do |const| %> **<%= const.name %>**
|
7
|
+
<%= h const.description %>
|
8
8
|
<% end %><% end %>
|
9
9
|
<% unless klass.attributes.empty? %>
|
10
|
-
|
11
|
-
<% klass.attributes.sort_by { |x| x.name }.each do |attr|
|
12
|
-
<%= attr.rw %>
|
13
|
-
|
10
|
+
## Attributes
|
11
|
+
<% klass.attributes.sort_by { |x| x.name }.each do |attr| %>
|
12
|
+
**[<%= attr.rw %>]** <%= attr.name %>
|
13
|
+
<% end %><% end %>
|
14
14
|
<% unless klass_methods.empty? %>
|
15
|
-
|
16
|
-
|
15
|
+
## Public Class Methods
|
16
|
+
***
|
17
|
+
<% klass_methods.each do |method| %>### <%= method.name %><%= method.params %>
|
18
|
+
|
17
19
|
<%= h method.description %><% end %><% end %>
|
18
20
|
<% unless instance_methods.empty? %>
|
19
|
-
|
20
|
-
<% instance_methods.each do |method|
|
21
|
-
|
21
|
+
## Public Instance Methods
|
22
|
+
<% instance_methods.each do |method| %>### <%= method.name %><%= method.params %>
|
23
|
+
|
24
|
+
<%= h method.description %><% 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.8
|
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-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdoc
|