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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9b934f2d9f03ae4a49d7e8418204e7f49ae58823e7d9b8296a96542886d51bf4
4
- data.tar.gz: ae5b986a513758cfd4e18c8e9db69defac54414a5a463c89fc307dbadb3bc598
3
+ metadata.gz: 8f43b8d0d98aa61a451d6e85635aaa71e5a48820a679c5d7338f41dac367995a
4
+ data.tar.gz: 93e1654b15e3c5c226dc00f562fa95c4e6ca41f348af2d64e5f2c410dc6d3f1f
5
5
  SHA512:
6
- metadata.gz: 5aaa104840d4721edcca4552d554a07475fe2b962de2434c135505e4565d82b5ec15f55f79d7dbf589282400ed907639cc70ed43e9d2444e52221096b4e36993
7
- data.tar.gz: 266256e390d2b267f8c05317543728fb7f4956a51303b14a4f74d3e08c0dccb508a17f126f218a2bbe2e85f1ad910adbfeafe6158fbd3dd01aac9be8b1161dbf
6
+ metadata.gz: e44c716d95d3d05ac48f1da768241cdd2dcc8472d3ab9b56f4515a17f6e2798b183e21cce8086c0cdb81691c730f0330c95dcdf54e5f6ec06938298012e67f6d
7
+ data.tar.gz: 4176998414bed9502ff2d8a8114dfed8b7a3abee0032546aa9c64d50ba3095b6b75b84df3045235716d104e053060b49c34e6552862659c1a9171a74fc7b5c07
@@ -26,23 +26,7 @@
26
26
  <% ps.arr("author") do |au|
27
27
  aups = KramdownRFC::authorps_from_hash(au)
28
28
  -%>
29
- <author <%=aups.attrs("initials", "surname", "fullname=name", "role")%>>
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
 
@@ -1,6 +1,6 @@
1
1
  spec = Gem::Specification.new do |s|
2
2
  s.name = 'kramdown-rfc2629'
3
- s.version = '1.2.14'
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.0.0'
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"
@@ -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.2.14
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-06 00:00:00.000000000 Z
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.0.0
78
+ version: 2.3.0
79
79
  required_rubygems_version: !ruby/object:Gem::Requirement
80
80
  requirements:
81
81
  - - ">="