kramdown-rfc2629 1.7.20 → 1.7.22

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2c12e9311998093f02e4531e98842dc02ade4b420dfdbef00703c4e3e9893c23
4
- data.tar.gz: e2bf61b2ae0f91a9f446e1d4a173ac098574da66af92556264983b0a03b43597
3
+ metadata.gz: 6829cc1f3803f3a5badbe865394e4bd303c26fb2ec5710ed2347cdbabea1f529
4
+ data.tar.gz: 5505e3f40551c0e7a1b4341b2a87ae80aa7e28c5bb773a2b7dc99ad491ab1ded
5
5
  SHA512:
6
- metadata.gz: 49851614d829dc5b9f82f52c75d4e09028a2e5f9cd69ce763ab5a71f6116737f5051f70538bcf26a23506e117614574d8f6104858f1be17f2b639f71d8ca6e8e
7
- data.tar.gz: 14db57344a965dee02bfac13b0fbfbcd516368737d32e029341ec3c7dcc0036c612219cac3336f3ee78d68e84340e4c815e0e1e3cd3f9c31de6f13ccf9bc8ca8
6
+ metadata.gz: fb74883f8051016119e1cfe1a2ae7270919d599e8416bde8fa7632d64e5080d02bfba81ad7ec37fc6a4817ee18c1dcb53ff23cefa3f1d5c32c0888456ac7cc9e
7
+ data.tar.gz: 7f89516975da7b9017642c882c6154173da0116d39db648a298b1c42bb974f9224eec8d6b34f90132008577eba6617b59636b37a40f6dc2851cb1c9f8787b822
@@ -68,10 +68,13 @@ lists.each do |k, v|
68
68
  puts
69
69
  puts "# #{title}"
70
70
  puts "{:unnumbered}"
71
+ puts
72
+ puts "{:compact}"
71
73
  else
72
74
  fail
73
75
  end
74
76
  v.each_with_index do |(ref, ti), n|
77
+ ti.sub!(/,?[\p{Zl}\p{Zp}\p{Cc}].*/, "") # first line of caption only
75
78
  ti = "[#{ti}](##{ref})" if ref
76
79
  puts "#{n+1}. #{ti}"
77
80
  end
@@ -52,6 +52,12 @@
52
52
  <% end -%>
53
53
 
54
54
  <rfc <%=rfcattrs%>>
55
+ <% ps.arr("v3xml2rfc", false) do |pi, val|
56
+ Array(val).each do |el|
57
+ -%>
58
+ <?v3xml2rfc <%=pi%>="<%=ps.escattr(el)%>"?>
59
+ <% end
60
+ end -%>
55
61
  <front>
56
62
  <%= ps.ele("title", ps.attr("abbrev=titleabbrev")) %>
57
63
 
@@ -1,6 +1,6 @@
1
1
  spec = Gem::Specification.new do |s|
2
2
  s.name = 'kramdown-rfc2629'
3
- s.version = '1.7.20'
3
+ s.version = '1.7.22'
4
4
  s.summary = "Kramdown extension for generating RFCXML (RFC 799x)."
5
5
  s.description = %{An RFCXML (RFC 799x) generating backend for Thomas Leitner's
6
6
  "kramdown" markdown parser. Mostly useful for RFC writers.}
@@ -18,6 +18,7 @@ class KDRFC
18
18
  # )))
19
19
 
20
20
  KDRFC_PREPEND = [ENV["KDRFC_PREPEND"]].compact
21
+ KDRFC_XML2RFC_FLAGS = Array(ENV["KDRFC_XML2RFC_FLAGS"]&.split(","))
21
22
 
22
23
  def v3_flag?
23
24
  [*(@options.v3 ? ["--v3"] : []),
@@ -37,6 +38,15 @@ def process_mkd(input, output)
37
38
  end
38
39
  end
39
40
 
41
+ def filename_ct(fn, ext)
42
+ bn = File.basename(fn, ".*")
43
+ if r = ENV["KRAMDOWN_RFC_DOCREV"]
44
+ bn << "-#{r}"
45
+ end
46
+ {filename: "#{bn}.#{ext}",
47
+ content_type: "text/plain"}
48
+ end
49
+
40
50
  def run_idnits(*args)
41
51
  if @options.remote
42
52
  run_idnits_remotely(*args)
@@ -62,8 +72,7 @@ def run_idnits_remotely(txt_fn)
62
72
  url = URI(IDNITS_WEBSERVICE)
63
73
  req = Net::HTTP::Post.new(url)
64
74
  form = [["file", File.open(txt_fn),
65
- {filename: "input.txt",
66
- content_type: "text/plain"}],
75
+ filename_ct(txt_fn, "txt")],
67
76
  ["hidetext", "true"]]
68
77
  diag = ["url/form: ", url, form].inspect
69
78
  req.set_form(form, 'multipart/form-data')
@@ -105,7 +114,7 @@ end
105
114
  def process_xml_locally(input, output, *flags)
106
115
  warn "* converting locally from xml #{input} to txt #{output}" if @options.verbose
107
116
  begin
108
- o, s = Open3.capture2(*KDRFC_PREPEND, "xml2rfc", *v3_flag?, *flags, input)
117
+ o, s = Open3.capture2(*KDRFC_PREPEND, "xml2rfc", *v3_flag?, *flags, *KDRFC_XML2RFC_FLAGS, input)
109
118
  puts o
110
119
  if s.success?
111
120
  warn "* #{output} written" if @options.verbose
@@ -152,8 +161,7 @@ def process_xml_remotely(input, output, *flags)
152
161
  url = URI(XML2RFC_WEBSERVICE + maf)
153
162
  req = Net::HTTP::Post.new(url)
154
163
  form = [["file", File.open(input),
155
- {filename: "input.xml",
156
- content_type: "text/plain"}]]
164
+ filename_ct(input, "xml")]]
157
165
  diag = ["url/form: ", url, form].inspect
158
166
  req.set_form(form, 'multipart/form-data')
159
167
  warn "* requesting at #{url}" if @options.verbose
@@ -1306,9 +1306,16 @@ COLORS
1306
1306
  "#{XML_RESOURCE_ORG_PREFIX}/bibxml-rfcsubseries/#{name}"] # FOR NOW
1307
1307
  end
1308
1308
 
1309
+ KRAMDOWN_REFCACHETTL = (e = ENV["KRAMDOWN_REFCACHETTL"]) ? e.to_i : 3600
1310
+
1311
+ KRAMDOWN_REFCACHETTL_RFC = (e = ENV["KRAMDOWN_REFCACHETTL_RFC"]) ? e.to_i : 86400*7
1312
+ KRAMDOWN_REFCACHETTL_DOI_IANA = (e = ENV["KRAMDOWN_REFCACHETTL_DOI_IANA"]) ? e.to_i : 86400
1313
+ KRAMDOWN_REFCACHETTL_DOI = (e = ENV["KRAMDOWN_REFCACHETTL_DOI"]) ? e.to_i : KRAMDOWN_REFCACHETTL_DOI_IANA
1314
+ KRAMDOWN_REFCACHETTL_IANA = (e = ENV["KRAMDOWN_REFCACHETTL_IANA"]) ? e.to_i : KRAMDOWN_REFCACHETTL_DOI_IANA
1315
+
1309
1316
  # [subdirectory name, cache ttl in seconds, does it provide for ?anchor=]
1310
1317
  XML_RESOURCE_ORG_MAP = {
1311
- "RFC" => ["bibxml", 86400*7, false,
1318
+ "RFC" => ["bibxml", KRAMDOWN_REFCACHETTL_RFC, false,
1312
1319
  ->(fn, n){ [name = "reference.RFC.#{"%04d" % n.to_i}.xml",
1313
1320
  "https://bib.ietf.org/public/rfc/bibxml/#{name}"] }
1314
1321
  # was "https://www.rfc-editor.org/refs/bibxml/#{name}"] }
@@ -1317,10 +1324,10 @@ COLORS
1317
1324
  ->(fn, n){ [fn,
1318
1325
  "https://datatracker.ietf.org/doc/bibxml3/draft-#{n.sub(/\Adraft-/, '')}.xml"] }
1319
1326
  ],
1320
- "BCP" => ["bibxml-rfcsubseries", 86400*7, false,
1327
+ "BCP" => ["bibxml-rfcsubseries", KRAMDOWN_REFCACHETTL_RFC, false,
1321
1328
  ->(fn, n){ Rfc2629::bcp_std_ref("BCP", n) }
1322
1329
  ],
1323
- "STD" => ["bibxml-rfcsubseries", 86400*7, false,
1330
+ "STD" => ["bibxml-rfcsubseries", KRAMDOWN_REFCACHETTL_RFC, false,
1324
1331
  ->(fn, n){ Rfc2629::bcp_std_ref("STD", n) }
1325
1332
  ],
1326
1333
  "W3C" => "bibxml4",
@@ -1336,9 +1343,10 @@ COLORS
1336
1343
  "NIST" => "bibxml2",
1337
1344
  "OASIS" => "bibxml2",
1338
1345
  "PKCS" => "bibxml2",
1339
- "DOI" => ["bibxml7", 86400, true, ->(fn, n){ ["computed-#{fn}", [:DOI, n] ] }, true # always_altproc
1346
+ "DOI" => ["bibxml7", KRAMDOWN_REFCACHETTL_DOI, true,
1347
+ ->(fn, n){ ["computed-#{fn}", [:DOI, n] ] }, true # always_altproc
1340
1348
  ], # emulate old 24 h cache
1341
- "IANA" => ["bibxml8", 86400, true], # ditto
1349
+ "IANA" => ["bibxml8", KRAMDOWN_REFCACHETTL_IANA, true], # ditto
1342
1350
  }
1343
1351
 
1344
1352
  # XML_RESOURCE_ORG_HOST = ENV["XML_RESOURCE_ORG_HOST"] || "xml.resource.org"
@@ -1348,8 +1356,6 @@ COLORS
1348
1356
  "https://#{XML_RESOURCE_ORG_HOST}/public/rfc"
1349
1357
  KRAMDOWN_USE_TOOLS_SERVER = ENV["KRAMDOWN_USE_TOOLS_SERVER"]
1350
1358
 
1351
- KRAMDOWN_REFCACHETTL = (e = ENV["KRAMDOWN_REFCACHETTL"]) ? e.to_i : 3600
1352
-
1353
1359
  KRAMDOWN_NO_TARGETS = ENV['KRAMDOWN_NO_TARGETS']
1354
1360
  KRAMDOWN_KEEP_TARGETS = ENV['KRAMDOWN_KEEP_TARGETS']
1355
1361
 
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kramdown-rfc2629
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.20
4
+ version: 1.7.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carsten Bormann
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-10-30 00:00:00.000000000 Z
10
+ date: 2025-01-24 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: kramdown
@@ -209,7 +208,6 @@ homepage: http://github.com/cabo/kramdown-rfc
209
208
  licenses:
210
209
  - MIT
211
210
  metadata: {}
212
- post_install_message:
213
211
  rdoc_options: []
214
212
  require_paths:
215
213
  - lib
@@ -224,8 +222,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
224
222
  - !ruby/object:Gem::Version
225
223
  version: '0'
226
224
  requirements: []
227
- rubygems_version: 3.5.14
228
- signing_key:
225
+ rubygems_version: 3.6.2
229
226
  specification_version: 4
230
227
  summary: Kramdown extension for generating RFCXML (RFC 799x).
231
228
  test_files: []