metanorma-ietf 2.3.6 → 2.4.0

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: 1a19bfaee2381bda7dd532941697aa43f6c9804940b9c2f82897f6950d195cc7
4
- data.tar.gz: ba4c70b46014f9c41c4971e99da7608df7f2780855bbdbd005e6e4c542dda215
3
+ metadata.gz: 9a0a93b0a29195d775f23e2ba37414870b8e708a006bba0498b3113aebe787c9
4
+ data.tar.gz: 53a29d58e5c0c601c29de23d0515d43e690458b8b848f67cacf5064403c3b834
5
5
  SHA512:
6
- metadata.gz: 4b3eafc5eccb17ceaa77851f1aef2d66ea2fd6b39213b2537643571ee4f3b827a1b5b4d2fc2f9e3622649302661285035a483567b90d32cdddc693ca0d62f86d
7
- data.tar.gz: 41c2f933072a61553455c06ac46ce40cd49e81fa86e162740b179a3099ad033eafd9a09723cbfe05c6d7b86227bf5fbd2e4121d4c92e6f625927a535e53ee58e
6
+ metadata.gz: e89e41ec81886905668543d6f24ad31ef6ea9cf0a38551f56f1fa3e8007bb6068421b221d0d835951054894146d218b47ae0fe9d1cc1a621f7df6f85a7442e3d
7
+ data.tar.gz: 11d9d25373f48d7fb3197e5107168c64b8230d519f1e45b410dec5403aab6158f81c8f0e34c2553aff7fa1f32f5974d7a8d7a77a6e5233fb0ef65aa1a300a2c6
@@ -8,10 +8,6 @@ module Asciidoctor
8
8
  rfc_anchor_cleanup(xmldoc)
9
9
  end
10
10
 
11
- BCP_KEYWORDS =
12
- ["MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
13
- "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", "OPTIONAL"].freeze
14
-
15
11
  def abstract_cleanup(xmldoc)
16
12
  xmldoc.xpath("//abstract[not(text())]").each do |x|
17
13
  x.remove
@@ -119,7 +119,7 @@ module Asciidoctor
119
119
  strict: node.attr("strict"),
120
120
  compact: node.attr("compact"),
121
121
  subcompact: node.attr("subcompact"),
122
- toc: node.attr("toc-include") == "false" ? "no" : "yes",
122
+ tocinclude: node.attr("toc-include") == "false" ? "no" : "yes",
123
123
  tocdepth: node.attr("toc-depth"),
124
124
  symrefs: node.attr("sym-refs"),
125
125
  sortrefs: node.attr("sort-refs"),
@@ -842,7 +842,7 @@
842
842
  </element>
843
843
  </optional>
844
844
  <optional>
845
- <element name="toc">
845
+ <element name="tocinclude">
846
846
  <text/>
847
847
  </element>
848
848
  </optional>
@@ -1011,8 +1011,14 @@
1011
1011
  <ref name="imagemap"/>
1012
1012
  <ref name="svgmap"/>
1013
1013
  <ref name="inputform"/>
1014
+ <ref name="toc"/>
1014
1015
  </choice>
1015
1016
  </define>
1017
+ <define name="toc">
1018
+ <element name="toc">
1019
+ <ref name="ul"/>
1020
+ </element>
1021
+ </define>
1016
1022
  <define name="inputform">
1017
1023
  <element name="form">
1018
1024
  <attribute name="id">
@@ -1254,6 +1260,12 @@
1254
1260
  <optional>
1255
1261
  <attribute name="type"/>
1256
1262
  </optional>
1263
+ <optional>
1264
+ <attribute name="identifier"/>
1265
+ </optional>
1266
+ <optional>
1267
+ <attribute name="prefix"/>
1268
+ </optional>
1257
1269
  <text/>
1258
1270
  </define>
1259
1271
  <define name="ics">
@@ -1,4 +1,4 @@
1
- require "open-uri"
1
+ require "metanorma/ietf/data/workgroups"
2
2
 
3
3
  module Asciidoctor
4
4
  module Ietf
@@ -34,59 +34,8 @@ module Asciidoctor
34
34
  File.join(File.dirname(__FILE__), "ietf.rng"))
35
35
  end
36
36
 
37
- def wgcache_name
38
- "#{Dir.home}/.metanorma-ietf-workgroup-cache.json"
39
- end
40
-
41
- def open_wg_cache(node)
42
- node.attr("flush-caches") == "true" and
43
- FileUtils.rm wgcache_name, force: true
44
- wg = []
45
- if Pathname.new(wgcache_name).file?
46
- begin
47
- File.open(wgcache_name, "r") { |f| wg = JSON.parse(f.read) }
48
- rescue Exception => e
49
- warn "Cache #{wgcache_name} is invalid, drop it"
50
- end
51
- end
52
- [wg, wgcache_name]
53
- end
54
-
55
- def cache_workgroup_ietf(wg, _b)
56
- warn "Reading workgroups from https://tools.ietf.org/wg/..."
57
- URI.open("https://tools.ietf.org/wg/") do |f|
58
- f.each_line do |l|
59
- l.scan(%r{<td width="50%" style='padding: 0 1ex'>([^<]+)</td>}) do |w|
60
- wg << w[0].gsub(/\s+$/, "").gsub(/ Working Group$/, "")
61
- end
62
- end
63
- end
64
- wg
65
- end
66
-
67
- def cache_workgroup_irtf(wg, _b)
68
- warn "Reading workgroups from https://irtf.org/groups..."
69
- URI.open("https://irtf.org/groups", ssl_verify_mode: OpenSSL::SSL::VERIFY_NONE) do |f|
70
- f.each_line do |l|
71
- l.scan(%r{<a title="([^"]+) Research Group"[^>]+>([^<]+)<}) do |w|
72
- wg << w[0].gsub(/\s+$/, "")
73
- wg << w[1].gsub(/\s+$/, "") # abbrev
74
- end
75
- end
76
- end
77
- wg
78
- end
79
-
80
- def cache_workgroup(node)
81
- wg, wgcache_name = open_wg_cache(node)
82
- if wg.empty?
83
- File.open(wgcache_name, "w") do |b|
84
- wg = cache_workgroup_ietf(wg, b)
85
- wg = cache_workgroup_irtf(wg, b)
86
- b << wg.to_json
87
- end
88
- end
89
- wg
37
+ def cache_workgroup(_node)
38
+ Metanorma::Ietf::Data::WORKGROUPS
90
39
  end
91
40
  end
92
41
  end
@@ -33,7 +33,7 @@ module IsoDoc::Ietf
33
33
  strict: node&.at(ns("//pi/strict"))&.text || "yes",
34
34
  compact: node&.at(ns("//pi/compact"))&.text || "yes",
35
35
  subcompact: node&.at(ns("//pi/subcompact"))&.text || "no",
36
- toc: node&.at(ns("//pi/toc-include"))&.text,
36
+ toc: node&.at(ns("//pi/tocinclude"))&.text,
37
37
  tocdepth: node&.at(ns("//pi/toc-depth"))&.text || "4",
38
38
  symrefs: node&.at(ns("//pi/sym-refs"))&.text || "yes",
39
39
  sortrefs: node&.at(ns("//pi/sort-refs"))&.text || "yes",
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ietf
3
- VERSION = "2.3.6".freeze
3
+ VERSION = "2.4.0".freeze
4
4
  end
5
5
  end
@@ -38,6 +38,7 @@ Gem::Specification.new do |spec|
38
38
  spec.add_dependency "isodoc", "~> 1.7.0"
39
39
  spec.add_dependency "mathml2asciimath"
40
40
  spec.add_dependency "metanorma-standoc", "~> 1.10.0"
41
+ spec.add_dependency "metanorma-ietf-data"
41
42
  spec.add_dependency "nokogiri", "~> 1.11.6"
42
43
  spec.add_dependency "open-uri"
43
44
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-ietf
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.6
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-07-19 00:00:00.000000000 Z
11
+ date: 2021-08-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: isodoc
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: 1.10.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: metanorma-ietf-data
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: nokogiri
57
71
  requirement: !ruby/object:Gem::Requirement