kramdown-rfc2629 1.2.14 → 1.3.1
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 +4 -4
- data/data/kramdown-rfc2629.erb +22 -17
- data/kramdown-rfc2629.gemspec +2 -2
- data/lib/kramdown-rfc/refxml.rb +25 -0
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8f43b8d0d98aa61a451d6e85635aaa71e5a48820a679c5d7338f41dac367995a
|
|
4
|
+
data.tar.gz: 93e1654b15e3c5c226dc00f562fa95c4e6ca41f348af2d64e5f2c410dc6d3f1f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e44c716d95d3d05ac48f1da768241cdd2dcc8472d3ab9b56f4515a17f6e2798b183e21cce8086c0cdb81691c730f0330c95dcdf54e5f6ec06938298012e67f6d
|
|
7
|
+
data.tar.gz: 4176998414bed9502ff2d8a8114dfed8b7a3abee0032546aa9c64d50ba3095b6b75b84df3045235716d104e053060b49c34e6552862659c1a9171a74fc7b5c07
|
data/data/kramdown-rfc2629.erb
CHANGED
|
@@ -26,23 +26,7 @@
|
|
|
26
26
|
<% ps.arr("author") do |au|
|
|
27
27
|
aups = KramdownRFC::authorps_from_hash(au)
|
|
28
28
|
-%>
|
|
29
|
-
|
|
30
|
-
<%= aups.ele("organization=org", aups.attrs("abbrev=orgabbrev",
|
|
31
|
-
*[$options.v3 && "ascii=orgascii"]), "") %>
|
|
32
|
-
<address>
|
|
33
|
-
<% postal = %w{street city region code country}.select{|gi| aups.has(gi)}
|
|
34
|
-
if postal != [] -%>
|
|
35
|
-
<postal>
|
|
36
|
-
<% postal.each do |gi| -%>
|
|
37
|
-
<%= aups.ele(gi) %>
|
|
38
|
-
<% end -%>
|
|
39
|
-
</postal>
|
|
40
|
-
<% end -%>
|
|
41
|
-
<% %w{phone facsimile email uri}.select{|gi| aups.has(gi)}.each do |gi| -%>
|
|
42
|
-
<%= aups.ele(gi) %>
|
|
43
|
-
<% end -%>
|
|
44
|
-
</address>
|
|
45
|
-
</author>
|
|
29
|
+
<%= KramdownRFC::person_element_from_aups("author", aups) -%>
|
|
46
30
|
<% aups.warn_if_leftovers -%>
|
|
47
31
|
<% end -%>
|
|
48
32
|
|
|
@@ -97,6 +81,27 @@
|
|
|
97
81
|
<% end -%>
|
|
98
82
|
|
|
99
83
|
<%= sechash.delete("back") %>
|
|
84
|
+
<% sh = sechash.delete("contributor") -%>
|
|
85
|
+
<% consec = ps.has("contributor") -%>
|
|
86
|
+
<% if sh || consec -%>
|
|
87
|
+
<% if $options.v3 -%>
|
|
88
|
+
<section anchor="contributors" numbered="false" toc="include" removeInRFC="false">
|
|
89
|
+
<name>Contributors</name>
|
|
90
|
+
<% else -%>
|
|
91
|
+
<section anchor="contributors" numbered="false" title="Contributors">
|
|
92
|
+
<% warn "*** Cannot process YAML contributors under V2 rules" if consec -%>
|
|
93
|
+
<% end -%>
|
|
94
|
+
<%= sh -%>
|
|
95
|
+
<% if $options.v3 && consec
|
|
96
|
+
ps.arr("contributor") do |au|
|
|
97
|
+
aups = KramdownRFC::authorps_from_hash(au)
|
|
98
|
+
-%>
|
|
99
|
+
<%= KramdownRFC::person_element_from_aups("contact", aups) -%>
|
|
100
|
+
<% aups.warn_if_leftovers -%>
|
|
101
|
+
<% end -%>
|
|
102
|
+
<% end -%>
|
|
103
|
+
</section>
|
|
104
|
+
<% end -%>
|
|
100
105
|
|
|
101
106
|
</back>
|
|
102
107
|
|
data/kramdown-rfc2629.gemspec
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
spec = Gem::Specification.new do |s|
|
|
2
2
|
s.name = 'kramdown-rfc2629'
|
|
3
|
-
s.version = '1.
|
|
3
|
+
s.version = '1.3.1'
|
|
4
4
|
s.summary = "Kramdown extension for generating RFC 7749 XML."
|
|
5
5
|
s.description = %{An RFC7749 (XML2RFC) generating backend for Thomas Leitner's
|
|
6
6
|
"kramdown" markdown parser. Mostly useful for RFC writers.}
|
|
@@ -10,7 +10,7 @@ spec = Gem::Specification.new do |s|
|
|
|
10
10
|
s.require_path = 'lib'
|
|
11
11
|
s.executables = ['kramdown-rfc2629', 'doilit', 'kramdown-rfc-extract-markdown', 'kdrfc']
|
|
12
12
|
s.default_executable = 'kramdown-rfc2629'
|
|
13
|
-
s.required_ruby_version = '>= 2.
|
|
13
|
+
s.required_ruby_version = '>= 2.3.0'
|
|
14
14
|
# s.requirements = 'wget'
|
|
15
15
|
# s.has_rdoc = true
|
|
16
16
|
s.author = "Carsten Bormann"
|
data/lib/kramdown-rfc/refxml.rb
CHANGED
|
@@ -54,6 +54,31 @@ module KramdownRFC
|
|
|
54
54
|
aups
|
|
55
55
|
end
|
|
56
56
|
|
|
57
|
+
PERSON_ERB = <<~ERB
|
|
58
|
+
<<%= element_name%> <%=aups.attrs("initials", "surname", "fullname=name", "role")%>>
|
|
59
|
+
<%= aups.ele("organization=org", aups.attrs("abbrev=orgabbrev",
|
|
60
|
+
*[$options.v3 && "ascii=orgascii"]), "") %>
|
|
61
|
+
<address>
|
|
62
|
+
<% postal = %w{street city region code country}.select{|gi| aups.has(gi)}
|
|
63
|
+
if postal != [] -%>
|
|
64
|
+
<postal>
|
|
65
|
+
<% postal.each do |gi| -%>
|
|
66
|
+
<%= aups.ele(gi) %>
|
|
67
|
+
<% end -%>
|
|
68
|
+
</postal>
|
|
69
|
+
<% end -%>
|
|
70
|
+
<% %w{phone facsimile email uri}.select{|gi| aups.has(gi)}.each do |gi| -%>
|
|
71
|
+
<%= aups.ele(gi) %>
|
|
72
|
+
<% end -%>
|
|
73
|
+
</address>
|
|
74
|
+
</<%= element_name%>>
|
|
75
|
+
ERB
|
|
76
|
+
|
|
77
|
+
def self.person_element_from_aups(element_name, aups)
|
|
78
|
+
erb = ERB.new(PERSON_ERB, nil, '-')
|
|
79
|
+
erb.result(binding)
|
|
80
|
+
end
|
|
81
|
+
|
|
57
82
|
def self.dateattrs(date)
|
|
58
83
|
begin
|
|
59
84
|
case date
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kramdown-rfc2629
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.3.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Carsten Bormann
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-03-
|
|
11
|
+
date: 2020-03-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: kramdown
|
|
@@ -75,7 +75,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
75
75
|
requirements:
|
|
76
76
|
- - ">="
|
|
77
77
|
- !ruby/object:Gem::Version
|
|
78
|
-
version: 2.
|
|
78
|
+
version: 2.3.0
|
|
79
79
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
80
80
|
requirements:
|
|
81
81
|
- - ">="
|