kramdown-rfc2629 1.5.17 → 1.5.21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/data/kramdown-rfc2629.erb +42 -9
- data/kramdown-rfc2629.gemspec +1 -1
- data/lib/kramdown-rfc/parameterset.rb +7 -2
- 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: a2f9b627799934e130561b80d0625ee127bb67e340742ab9df6f309f069d2487
|
4
|
+
data.tar.gz: fd3bb7cbbe1a54316d809844f12070836e18c5eb38286a00fc322c915bebd363
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d588638f3ae60b71555a23236546f0639f612774e38d8325515d9304154038cbedba463fa2c3fe3dedf028ab1b44ee9386325215114ef9a8a5c11029d57d9a6
|
7
|
+
data.tar.gz: 6307e13b08a45165813ceec0ea1cc5e5cc9e788fcdc0024fee168979e87803eac96dca878288b7eee628f5a167a35c1079dcc1c411b2ad88fda0fcf11757eaf7
|
data/README.md
CHANGED
@@ -28,7 +28,8 @@ structure provided by kramdown. `bin/kramdown-rfc2629` started out as
|
|
28
28
|
a simple command-line program showing how to use this, but can now do
|
29
29
|
much more (see below).
|
30
30
|
|
31
|
-
To use kramdown-rfc2629, you'll need
|
31
|
+
To use kramdown-rfc2629, you'll need Ruby (at least version 2.3, but
|
32
|
+
preferably a current version), and maybe
|
32
33
|
[XML2RFC][] if you want to see the fruits of your work.
|
33
34
|
|
34
35
|
kramdown-rfc2629 mydraft.mkd >mydraft.xml
|
data/data/kramdown-rfc2629.erb
CHANGED
@@ -12,14 +12,37 @@
|
|
12
12
|
<% end -%>
|
13
13
|
]>
|
14
14
|
|
15
|
-
<%
|
16
|
-
|
15
|
+
<%
|
16
|
+
ps.rest.fetch("consensus") do
|
17
|
+
# consensus not given -- default intelligently
|
18
|
+
cat = ps.has("category") || ps.has("cat")
|
19
|
+
MUST_CONSENSUS = {"std" => true, "bcp" => true}
|
20
|
+
ps["consensus"] = true if MUST_CONSENSUS[cat]
|
21
|
+
end
|
22
|
+
rfcattrs = ps.attrs("ipr", "docName=docname", "category=cat",
|
23
|
+
"consensus", "submissionType=submissiontype", "xml:lang=lang",
|
24
|
+
"number", "obsoletes", "updates", "seriesNo=seriesno")
|
25
|
+
TRUE_FALSE = {nil => "true", false => "false", true => "true",
|
26
|
+
"yes" => "true", "no" => "false"}
|
27
|
+
YES_NO = {"true" => "yes", "false" => "no"}
|
28
|
+
pis = KramdownRFC::ParameterSet.new({})
|
29
|
+
ps.arr("pi", false) do |pi, val|
|
30
|
+
pis[pi] = TRUE_FALSE[val] || val
|
31
|
+
end
|
32
|
+
if $options.v3
|
33
|
+
piattrs = pis.attrs("tocDepth=tocdepth", "tocInclude=toc",
|
34
|
+
"sortRefs=sortrefs", "symRefs=symrefs", "indexInclude=index")
|
35
|
+
if piattrs != ""
|
36
|
+
rfcattrs << " " << piattrs
|
37
|
+
end
|
38
|
+
end
|
39
|
+
pis.rest.each do |pi, val|
|
40
|
+
v = YES_NO[val] || pis.escattr(val)
|
41
|
+
-%>
|
42
|
+
<?rfc <%=pi%>="<%=v%>"?>
|
17
43
|
<% end -%>
|
18
44
|
|
19
|
-
<rfc <%=
|
20
|
-
"consensus", "submissionType=submissiontype", "xml:lang=lang",
|
21
|
-
"number", "obsoletes", "updates", "seriesNo=seriesno") %>>
|
22
|
-
|
45
|
+
<rfc <%=rfcattrs%>>
|
23
46
|
<front>
|
24
47
|
<%= ps.ele("title", ps.attr("abbrev=titleabbrev")) %>
|
25
48
|
|
@@ -46,15 +69,24 @@
|
|
46
69
|
<% venue = ps[:venue] -%>
|
47
70
|
<% if venue -%>
|
48
71
|
<% venue = KramdownRFC::ParameterSet.new(venue) -%>
|
49
|
-
<note title="
|
72
|
+
<note title="About This Document" removeInRFC="true">
|
73
|
+
<% if (dn = ps.av[:docName]) &&
|
74
|
+
(dt = dn.rpartition('-')[0]) != ""
|
75
|
+
-%>
|
76
|
+
<t>
|
77
|
+
<% if latest = venue[:latest] -%>
|
78
|
+
The latest revision of this draft can be found at <eref target="<%=latest%>"/>.
|
79
|
+
<% end -%>
|
80
|
+
Status information for this document may be found at <eref target="https://datatracker.ietf.org/doc/<%=dt%>/"/>.
|
81
|
+
</t>
|
82
|
+
<% end -%>
|
50
83
|
<% mail = venue[:mail] -%>
|
51
84
|
<% homepage = venue[:home] -%>
|
52
85
|
<% gtype = venue[:type] -%>
|
53
86
|
<% if mail || homepage -%>
|
54
87
|
<t>
|
55
88
|
<% end -%>
|
56
|
-
<% if mail -%>
|
57
|
-
<% mail_local, mail_host = mail.split("@", 2) -%>
|
89
|
+
<% if mail && (mail_local, mail_host = mail.split("@", 2)) && mail_host -%>
|
58
90
|
<% mail_subdomain, mail_domain = mail_host.split(".", 2) -%>
|
59
91
|
<% group = venue[:group] || mail_local # XXX -%>
|
60
92
|
<% arch = venue[:arch] || "https://mailarchive.ietf.org/arch/browse/#{mail_local}/" -%>
|
@@ -74,6 +106,7 @@
|
|
74
106
|
<t>Source for this draft and an issue tracker can be found at
|
75
107
|
<eref target="<%=repo%>"/>.</t>
|
76
108
|
<% end -%>
|
109
|
+
<%= venue.ele("t=text", nil, nil, true) -%>
|
77
110
|
</note>
|
78
111
|
<% venue.warn_if_leftovers -%>
|
79
112
|
<% end -%>
|
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.5.
|
3
|
+
s.version = '1.5.21'
|
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.}
|
@@ -7,10 +7,15 @@ module KramdownRFC
|
|
7
7
|
def initialize(y)
|
8
8
|
raise "*** invalid parameter set #{y.inspect}" unless Hash === y
|
9
9
|
@f = y
|
10
|
+
@av = {}
|
10
11
|
end
|
12
|
+
attr :av
|
11
13
|
def [](pn)
|
12
14
|
@f.delete(pn.to_s)
|
13
15
|
end
|
16
|
+
def []=(pn, val)
|
17
|
+
@f[pn] = val
|
18
|
+
end
|
14
19
|
def has(pn)
|
15
20
|
@f[pn.to_s]
|
16
21
|
end
|
@@ -24,10 +29,11 @@ module KramdownRFC
|
|
24
29
|
end
|
25
30
|
def attr(pn)
|
26
31
|
val, an = van(pn)
|
32
|
+
@av[an.intern] = val
|
27
33
|
%{#{an}="#{escattr(val)}"} if val
|
28
34
|
end
|
29
35
|
def attrs(*pns)
|
30
|
-
pns.map{ |pn| attr(pn) }.compact.join(" ")
|
36
|
+
pns.map{ |pn| attr(pn) if pn }.compact.join(" ")
|
31
37
|
end
|
32
38
|
def ele(pn, attr=nil, defcontent=nil, markdown=false)
|
33
39
|
val, an = van(pn)
|
@@ -59,5 +65,4 @@ module KramdownRFC
|
|
59
65
|
end
|
60
66
|
end
|
61
67
|
|
62
|
-
|
63
68
|
end
|
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.5.
|
4
|
+
version: 1.5.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carsten Bormann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: kramdown
|