metanorma-ietf 3.1.5 → 3.1.6

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: b1de8bb90257472a5f374f7fd19856322e1f69e0510eedafde925e2f935883f8
4
- data.tar.gz: d6b838f193f84b6c78df8ccad0e4d15f2ba46f1cd81a58d05751287561a96bfd
3
+ metadata.gz: 964f8ef59757342a374a94bb7aafa59e6486f54333a72e22d9b4d6de87c13277
4
+ data.tar.gz: a146d584aed9903007f40ab0d899bb517ec247c49adb40e1e5abcc1bb4cfabac
5
5
  SHA512:
6
- metadata.gz: d75bd0f7b1c507efaae0514a050fa41ab81b14e4cd10677dbeed3f194a609c325a12931ff015c1bcac305a921c9d798d4153ebb87ff5db4ba321d04db32b7d64
7
- data.tar.gz: dd62ea88a5a93d0b22f189ed4c9268b9d9bfcae0d2fa3b8c59d2e41fdab7d5d8a3e6eabe48b0fa454ce927c6e85947eca3b0bae9534a3e52e5f043fc1bc3d758
6
+ metadata.gz: 02cb6e4655562acc988f616a222d415369677abcdf759fd2883e05401b535f8f6d30ec31b6be095f5ef9e0f638c643f541f73e3687c956141a06c6121e0d43b0
7
+ data.tar.gz: 5cb6eb0d2e991ff34419b62f07b9fd7d386fe52bb6af1bae8f51b599ed5ec61eea698c86d6225f1e8130a2979754b90e9263b6ca3a3283db59c9810aab7946b3
@@ -93,7 +93,7 @@ module IsoDoc
93
93
 
94
94
  def image_title_parse(out, caption)
95
95
  unless caption.nil?
96
- out.t **{ align: "center", keepWithPrevious: "true" } do |p|
96
+ out.t align: "center", keepWithPrevious: "true" do |p|
97
97
  p << caption.to_s
98
98
  end
99
99
  end
@@ -141,6 +141,14 @@ module IsoDoc
141
141
  &.sub(/,$/, "") || ""
142
142
  end
143
143
 
144
+ def origin_parse(node, out)
145
+ if t = node.at(ns("./termref"))
146
+ termrefelem_parse(t, out)
147
+ else
148
+ eref_parse(node, out)
149
+ end
150
+ end
151
+
144
152
  def index_parse(node, out)
145
153
  out.iref nil, **attr_code(item: node.at(ns("./primary")).text,
146
154
  primary: node["primary"],
@@ -37,13 +37,6 @@ module IsoDoc
37
37
  note_parse(node, out)
38
38
  end
39
39
 
40
- def termref_parse(node, out)
41
- out.t do |p|
42
- p << "SOURCE: "
43
- node.children.each { |n| parse(n, p) }
44
- end
45
- end
46
-
47
40
  def termdef_parse(node, out)
48
41
  set_termdomain("")
49
42
  node.xpath(ns("./definition")).size > 1 and
@@ -65,6 +58,38 @@ module IsoDoc
65
58
  parse(r, out)
66
59
  out << "]"
67
60
  end
61
+
62
+ def termsource_status(status)
63
+ case status
64
+ when "modified" then @i18n.modified
65
+ when "adapted" then @i18n.adapted
66
+ end
67
+ end
68
+
69
+ def termsource_add_modification_text(mod)
70
+ mod or return
71
+ mod.text.strip.empty? or mod.previous = " &#x2013; "
72
+ mod.elements.size == 1 and
73
+ mod.elements[0].replace(mod.elements[0].children)
74
+ mod.replace(mod.children)
75
+ end
76
+
77
+ def preprocess_termref(elem)
78
+ origin = elem.at(ns("./origin"))
79
+ s = termsource_status(elem["status"]) and origin.next = l10n(", #{s}")
80
+ termsource_add_modification_text(elem.at(ns("./modification")))
81
+ while elem&.next_element&.name == "termsource"
82
+ elem << "; #{to_xml(elem.next_element.remove.children)}"
83
+ end
84
+ end
85
+
86
+ def termref_parse(elem, out)
87
+ preprocess_termref(elem)
88
+ elem.children = l10n("[#{@i18n.source}: #{to_xml(elem.children).strip}]")
89
+ out.t do |p|
90
+ elem.children.each { |n| parse(n, p) }
91
+ end
92
+ end
68
93
  end
69
94
  end
70
95
  end
@@ -1,6 +1,7 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <grammar ns="https://www.metanorma.org/ns/ietf" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
2
+ <grammar ns='https://www.metanorma.org/ns/ietf' xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
3
  <!--
4
+ VERSION v1.2.1
4
5
  Currently we inherit from a namespaced grammar, isostandard. Until we inherit from isodoc,
5
6
  we cannot have a new default namespace: we will end up with a grammar with two different
6
7
  namespaces, one for isostandard and one for ietf additions. And we do not want that.
@@ -584,13 +585,7 @@
584
585
  </define>
585
586
  <define name="ietf-standard">
586
587
  <element name="ietf-standard">
587
- <attribute name="version"/>
588
- <attribute name="type">
589
- <choice>
590
- <value>semantic</value>
591
- <value>presentation</value>
592
- </choice>
593
- </attribute>
588
+ <ref name="Root-Attributes"/>
594
589
  <ref name="bibdata"/>
595
590
  <zeroOrMore>
596
591
  <ref name="termdocsource"/>
@@ -17,6 +17,7 @@
17
17
  these elements; we just want one namespace for any child grammars
18
18
  of this.
19
19
  -->
20
+ <!-- VERSION v1.2.2 -->
20
21
  <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
21
22
  <include href="reqt.rng"/>
22
23
  <include href="basicdoc.rng">
@@ -210,6 +211,9 @@
210
211
  <data type="boolean"/>
211
212
  </attribute>
212
213
  </optional>
214
+ <optional>
215
+ <attribute name="style"/>
216
+ </optional>
213
217
  <ref name="CitationType"/>
214
218
  <oneOrMore>
215
219
  <ref name="PureTextElement"/>
@@ -1349,15 +1353,19 @@
1349
1353
  </choice>
1350
1354
  </element>
1351
1355
  </define>
1356
+ <define name="Root-Attributes">
1357
+ <attribute name="version"/>
1358
+ <attribute name="schema-version"/>
1359
+ <attribute name="type">
1360
+ <choice>
1361
+ <value>semantic</value>
1362
+ <value>presentation</value>
1363
+ </choice>
1364
+ </attribute>
1365
+ </define>
1352
1366
  <define name="standard-document">
1353
1367
  <element name="standard-document">
1354
- <attribute name="version"/>
1355
- <attribute name="type">
1356
- <choice>
1357
- <value>semantic</value>
1358
- <value>presentation</value>
1359
- </choice>
1360
- </attribute>
1368
+ <ref name="Root-Attributes"/>
1361
1369
  <ref name="bibdata"/>
1362
1370
  <optional>
1363
1371
  <ref name="misccontainer"/>
@@ -2131,6 +2139,7 @@
2131
2139
  <choice>
2132
2140
  <value>identical</value>
2133
2141
  <value>modified</value>
2142
+ <value>adapted</value>
2134
2143
  <value>restyled</value>
2135
2144
  <value>context-added</value>
2136
2145
  <value>generalisation</value>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ietf
3
- VERSION = "3.1.5".freeze
3
+ VERSION = "3.1.6".freeze
4
4
  end
5
5
  end
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: 3.1.5
4
+ version: 3.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-04-10 00:00:00.000000000 Z
11
+ date: 2023-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mathml2asciimath