rdoc-generator-mdoc 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rdoc/generator/mdoc/formatter.rb +12 -2
- data/rdoc-generator-mdoc.gemspec +1 -1
- data/templates/module.mdoc.erb +6 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 50d42f3f4355b8676989d4ac9f203eefc3ea00be
|
4
|
+
data.tar.gz: a4d6923235de9ef5ab4700984fb6535dd3f37ed1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 270390a24e1bfbbb9d36343b5c885378689e009cc359a82473c890e04d03a8aa85e3f2710119f1b08dc3e9bc42d78694a1284bd1bf85195d308b3c88593607e1
|
7
|
+
data.tar.gz: 5266cce03f689954e9bd6c0836f78f1e24aa466995602c6af2ed005acef414964a3ecc36abaeaa8f6a5e399cc0bbe4e217302c264df27b13d43ddd493f0baa2b
|
@@ -28,9 +28,15 @@ class RDoc::Generator::Mdoc
|
|
28
28
|
end
|
29
29
|
|
30
30
|
##
|
31
|
-
# Turn a heading into a subsection header
|
31
|
+
# Turn a heading into a paragraph or a subsection header depending on
|
32
|
+
# wether we are currently processing a list or not. List items can't
|
33
|
+
# contain subsection headers.
|
32
34
|
def accept_heading(heading)
|
33
|
-
|
35
|
+
if in_list?
|
36
|
+
accept_paragraph(heading)
|
37
|
+
else
|
38
|
+
parts << ".Ss #{heading.text}\n"
|
39
|
+
end
|
34
40
|
end
|
35
41
|
|
36
42
|
##
|
@@ -148,6 +154,10 @@ class RDoc::Generator::Mdoc
|
|
148
154
|
list_types.last
|
149
155
|
end
|
150
156
|
|
157
|
+
def in_list?
|
158
|
+
!list_types.empty?
|
159
|
+
end
|
160
|
+
|
151
161
|
def convert_string(string)
|
152
162
|
escape(string.strip)
|
153
163
|
end
|
data/rdoc-generator-mdoc.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = "rdoc-generator-mdoc"
|
3
|
-
spec.version = "0.0.
|
3
|
+
spec.version = "0.0.4"
|
4
4
|
spec.authors = ["Calle Erlandsson", "Mike Burns"]
|
5
5
|
spec.email = ["calle@thoughtbot.com", "hello@thoughtbot.com"]
|
6
6
|
spec.summary = "An mdoc(7) generator for RDoc"
|
data/templates/module.mdoc.erb
CHANGED
@@ -43,9 +43,9 @@ Not documented.
|
|
43
43
|
<% end %>
|
44
44
|
<% unless section.constants.empty? %>
|
45
45
|
.Ss Constants
|
46
|
-
|
46
|
+
\&
|
47
47
|
<% section.constants.each do |constant| %>
|
48
|
-
.
|
48
|
+
.Ss Dv <%= constant.name %> Li = <%= escape constant.value %>
|
49
49
|
<% if constant.described? %>
|
50
50
|
<%= constant.description %>
|
51
51
|
<% else %>
|
@@ -53,13 +53,12 @@ Not documented.
|
|
53
53
|
.Pp
|
54
54
|
<% end %>
|
55
55
|
<% end %>
|
56
|
-
.El
|
57
56
|
<% end %>
|
58
57
|
<% unless section.attributes.empty? %>
|
59
58
|
.Ss Attributes
|
60
|
-
|
59
|
+
\&
|
61
60
|
<% section.attributes.each do |attribute| %>
|
62
|
-
.
|
61
|
+
.Ss Va <%= attribute.name %> Pq <%= attribute.rw %>
|
63
62
|
<% if attribute.described? %>
|
64
63
|
<%= attribute.description %>
|
65
64
|
<% else %>
|
@@ -67,14 +66,13 @@ Not documented.
|
|
67
66
|
.Pp
|
68
67
|
<% end %>
|
69
68
|
<% end %>
|
70
|
-
.El
|
71
69
|
<% end %>
|
72
70
|
<% section.class.method_types.each do |type| %>
|
73
71
|
<% unless section.methods_of_type(type).empty? %>
|
74
72
|
.Ss <%= type.capitalize %> Methods
|
75
|
-
|
73
|
+
\&
|
76
74
|
<% section.methods_of_type(type).each do |method| %>
|
77
|
-
.
|
75
|
+
.Ss Fn "<%= escape method.visibility %> <%= escape method.name %>" <%=
|
78
76
|
method.parameters.map { |p| quote(escape(p)) }.join(" ") %>
|
79
77
|
<% if method.has_invocation_examples? %>
|
80
78
|
.Bd -literal
|
@@ -108,7 +106,6 @@ Also aliased as:
|
|
108
106
|
.El
|
109
107
|
<% end %>
|
110
108
|
<% end %>
|
111
|
-
.El
|
112
109
|
<% end %>
|
113
110
|
<% end %>
|
114
111
|
<% end %>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rdoc-generator-mdoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Calle Erlandsson
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-08-
|
12
|
+
date: 2014-08-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|