metanorma-ietf 3.5.5 → 3.5.7

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: b2bbef6e584be1dd783e7737b1e05b43a6ed524acc3cd3affb2edbe407d3417b
4
- data.tar.gz: '097b2d98f09a4ff356b7000ba0ccb683194c36a8edfbb9c39895a314f663da68'
3
+ metadata.gz: 5a7a8acefbf989aea665a8fbbb0e60447c921ee34527b9b1ba07526d281c35db
4
+ data.tar.gz: 5fdd90c1ad276336baf77616781b92bde24fa381752f6e8fc523f8d3a79d9c08
5
5
  SHA512:
6
- metadata.gz: aab2b309ce5d38c345ffd952fdcbcc07f723b35b2d3d31a2be9301ed0a390d31a8991c83aa6500ec47cfd1b11004f3ef99961ab89f7509168547b281685dc578
7
- data.tar.gz: 55d97a53151343f37471913d54ee369f847bce6eff6fceb160980e5025a257714a992790562eab342d9be92c071fcbe9ee42309b1185514c14b79bf5698762b7
6
+ metadata.gz: 6e431686a4ed4fae904657b67f891c8dd1dc7f5ef1c33a1dbb04bc9d07b993801ab1b7d0423ff298d73ff4c2319393b9a0890d3d167177a70fcdee0289c80488
7
+ data.tar.gz: e9d77d069d55d1e36b98fa249e0e4ac8e0183a71c6fb53014626ccaa5a2a344d4b1952ef95c3f3bc4bad0160e6fe6bb10c602ef7f33b030e4b4701c11db8bcdf
@@ -57,7 +57,7 @@ module IsoDoc
57
57
  end
58
58
  end
59
59
 
60
- def source_parse(node, out)
60
+ def semx_source_parse(node, out)
61
61
  termref_parse(node, out)
62
62
  end
63
63
 
@@ -127,7 +127,7 @@ module IsoDoc
127
127
  origin = elem.at(ns("./origin"))
128
128
  s = termsource_status(elem["status"]) and origin.next = l10n(", #{s}")
129
129
  termsource_add_modification_text(elem.at(ns("./modification")))
130
- while elem&.next_element&.name == "termsource"
130
+ while elem&.next_element&.name == "source"
131
131
  elem << "; #{to_xml(elem.next_element.remove.children)}"
132
132
  end
133
133
  end
@@ -267,6 +267,10 @@ in a document (e.g. sourcecode annotations)</a:documentation>
267
267
  <value>justified</value>
268
268
  </choice>
269
269
  </define>
270
+ <define name="IdRefType">
271
+ <a:documentation>Type of cross-references to elements. In BasicDoc, these always point to id { xsd:ID } </a:documentation>
272
+ <data type="IDREF"/>
273
+ </define>
270
274
  <define name="RequiredId">
271
275
  <a:documentation>Mandatory anchor of element, to be used for cross-references within the document</a:documentation>
272
276
  <attribute name="id">
@@ -409,13 +413,13 @@ in a document (e.g. sourcecode annotations)</a:documentation>
409
413
  <attribute name="from">
410
414
  <a:documentation>Identifier for the start of the text or point in the text to which the comment applies.
411
415
  If not provided, the comment applies in the vicinity of the place it has been inserted into the text</a:documentation>
412
- <data type="IDREF"/>
416
+ <ref name="IdRefType"/>
413
417
  </attribute>
414
418
  </optional>
415
419
  <optional>
416
420
  <attribute name="to">
417
421
  <a:documentation>Identifier for the end of the text to which the comment applies</a:documentation>
418
- <data type="IDREF"/>
422
+ <ref name="IdRefType"/>
419
423
  </attribute>
420
424
  </optional>
421
425
  </define>
@@ -1504,7 +1508,7 @@ Restricted recursively to contain only other such inline elements with no identi
1504
1508
  <attribute name="to">
1505
1509
  <a:documentation>A reference to an anchor element (typically a bookmark),
1506
1510
  to indicate that the index range covers a range of locations between the current index element and the `to` anchor</a:documentation>
1507
- <data type="IDREF"/>
1511
+ <ref name="IdRefType"/>
1508
1512
  </attribute>
1509
1513
  </optional>
1510
1514
  <ref name="index-primary">
@@ -1662,7 +1666,7 @@ which can be bookmarks as well as block or section references</a:documentation>
1662
1666
  <define name="XrefAttributes">
1663
1667
  <attribute name="target">
1664
1668
  <a:documentation>The identifier of a section, block or inlined element being referenced</a:documentation>
1665
- <data type="IDREF"/>
1669
+ <ref name="IdRefType"/>
1666
1670
  </attribute>
1667
1671
  <optional>
1668
1672
  <attribute name="type">
@@ -1723,7 +1727,7 @@ The target of a footnote is the location it is embedded in within the text</a:do
1723
1727
  <attribute name="target">
1724
1728
  <a:documentation>The target of the callout is understood to be the location of the callout within the source code;
1725
1729
  the extent of the target is not expressed overtly</a:documentation>
1726
- <data type="IDREF"/>
1730
+ <ref name="IdRefType"/>
1727
1731
  </attribute>
1728
1732
  <text>
1729
1733
  <a:documentation>The label of the callout, used to identify its target within the source code</a:documentation>
@@ -2,36 +2,40 @@ module Metanorma
2
2
  module Ietf
3
3
  class Converter < ::Metanorma::Standoc::Converter
4
4
  def para_attrs(node)
5
- attr_code("keep-with-next": node.attr("keepWithNext") ||
6
- node.attr("keep-with-next"),
7
- "keep-with-previous": node.attr("keepWithPrevious") ||
8
- node.attr("keep-with-previous"),
9
- indent: node.attr("indent"),
10
- id: ::Metanorma::Utils::anchor_or_uuid(node))
5
+ attr_code(id_attr(node).merge(
6
+ "keep-with-next": node.attr("keepWithNext") ||
7
+ node.attr("keep-with-next"),
8
+ "keep-with-previous": node.attr("keepWithPrevious") ||
9
+ node.attr("keep-with-previous"),
10
+ indent: node.attr("indent"),
11
+ ))
11
12
  end
12
13
 
13
14
  def ul_attrs(node)
14
- attr_code(id: ::Metanorma::Utils::anchor_or_uuid(node),
15
- nobullet: node.attr("nobullet") || node.attr("empty"),
16
- indent: node.attr("indent"),
17
- bare: node.attr("bare"),
18
- spacing: node.attr("spacing"))
15
+ attr_code(id_attr(node).merge(
16
+ nobullet: node.attr("nobullet") || node.attr("empty"),
17
+ indent: node.attr("indent"),
18
+ bare: node.attr("bare"),
19
+ spacing: node.attr("spacing"),
20
+ ))
19
21
  end
20
22
 
21
23
  def ol_attrs(node)
22
- attr_code(id: ::Metanorma::Utils::anchor_or_uuid(node),
23
- type: node.attr("format") || olist_style(node.style),
24
- group: node.attr("group"),
25
- spacing: node.attr("spacing"),
26
- indent: node.attr("indent"),
27
- start: node.attr("start"))
24
+ attr_code(id_attr(node).merge(
25
+ type: node.attr("format") || olist_style(node.style),
26
+ group: node.attr("group"),
27
+ spacing: node.attr("spacing"),
28
+ indent: node.attr("indent"),
29
+ start: node.attr("start"),
30
+ ))
28
31
  end
29
32
 
30
33
  def dl_attrs(node)
31
- attr_code(id: ::Metanorma::Utils::anchor_or_uuid(node),
32
- newline: node.attr("newline"),
33
- indent: node.attr("indent"),
34
- spacing: node.attr("spacing"))
34
+ attr_code(id_attr(node).merge(
35
+ newline: node.attr("newline"),
36
+ indent: node.attr("indent"),
37
+ spacing: node.attr("spacing"),
38
+ ))
35
39
  end
36
40
 
37
41
  def todo_attrs(node)
@@ -39,11 +43,10 @@ module Metanorma
39
43
  end
40
44
 
41
45
  def sidebar(node)
42
- return unless draft?
43
-
46
+ draft? or return
44
47
  noko do |xml|
45
48
  xml.review **sidebar_attrs(node) do |r|
46
- node.title.nil? or r.name { |name| name << node.title }
49
+ block_title(node, r)
47
50
  wrap_in_para(node, r)
48
51
  end
49
52
  end
@@ -51,9 +54,10 @@ module Metanorma
51
54
 
52
55
  def note(node)
53
56
  noko do |xml|
54
- xml.note **attr_code(id: ::Metanorma::Utils::anchor_or_uuid(nil),
55
- removeInRFC: node.attr("remove-in-rfc")) do |c|
56
- node.title.nil? or c.name { |name| name << node.title }
57
+ xml.note **attr_code(id_attr(node).merge(
58
+ removeInRFC: node.attr("remove-in-rfc"),
59
+ )) do |c|
60
+ block_title(node, c)
57
61
  wrap_in_para(node, c)
58
62
  end
59
63
  end
@@ -62,11 +66,9 @@ module Metanorma
62
66
  def literal(node)
63
67
  noko do |xml|
64
68
  xml.figure **literal_attrs(node) do |f|
65
- figure_title(node, f)
69
+ block_title(node, f)
66
70
  f.pre node.lines.join("\n"),
67
- **attr_code(align: node.attr("align"),
68
- id: ::Metanorma::Utils::anchor_or_uuid(nil),
69
- alt: node.attr("alt"))
71
+ **attr_code(align: node.attr("align"), alt: node.attr("alt"))
70
72
  end
71
73
  end
72
74
  end
@@ -26,7 +26,7 @@ module Metanorma
26
26
 
27
27
  def cref_cleanup(xmldoc)
28
28
  xmldoc.xpath("//crefref").each do |r|
29
- if c = xmldoc.at("//review[@id = '#{r.text}']")
29
+ if c = xmldoc.at("//review[@anchor = '#{r.text}']")
30
30
  id = "_#{UUIDTools::UUID.random_create}"
31
31
  c["from"] = id
32
32
  c["to"] = id
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <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">
3
- <!-- VERSION v2.0.4 -->
3
+ <!-- VERSION v2.0.7 -->
4
4
 
5
5
  <!--
6
6
  ALERT: cannot have root comments, because of https://github.com/metanorma/metanorma/issues/437
@@ -36,6 +36,12 @@
36
36
  </zeroOrMore>
37
37
  </element>
38
38
  </define>
39
+ <define name="IdRefType">
40
+ <a:documentation>Cross-references are not normalised to xsd:IDREF in Semantic XML: that is deferred to Presentation XML.
41
+ All IdRefType instances point not to `@id` in Semantic XML, which is the Content GUID for an element,
42
+ but to `@anchor`, the user-supplied cross-reference</a:documentation>
43
+ <text/>
44
+ </define>
39
45
  <define name="index-primary">
40
46
  <element name="primary">
41
47
  <oneOrMore>
@@ -70,6 +76,7 @@
70
76
  <a:documentation>Title(s) of a clause</a:documentation>
71
77
  <element name="title">
72
78
  <a:documentation>Title proper for a clause</a:documentation>
79
+ <ref name="RequiredId"/>
73
80
  <zeroOrMore>
74
81
  <ref name="TextElement"/>
75
82
  </zeroOrMore>
@@ -77,10 +84,19 @@
77
84
  <zeroOrMore>
78
85
  <element name="variant-title">
79
86
  <a:documentation>Alternate title for a clause</a:documentation>
87
+ <ref name="RequiredId"/>
80
88
  <ref name="TypedTitleString"/>
81
89
  </element>
82
90
  </zeroOrMore>
83
91
  </define>
92
+ <define name="tname">
93
+ <element name="name">
94
+ <ref name="RequiredId"/>
95
+ <oneOrMore>
96
+ <ref name="NestedTextElement"/>
97
+ </oneOrMore>
98
+ </element>
99
+ </define>
84
100
  <define name="UlBody">
85
101
  <optional>
86
102
  <ref name="tname">
@@ -238,7 +254,7 @@
238
254
  <a:documentation>Notes specific to this block</a:documentation>
239
255
  </ref>
240
256
  </zeroOrMore>
241
- <ref name="TermSource">
257
+ <ref name="BlockSource">
242
258
  <a:documentation>A source for the table</a:documentation>
243
259
  </ref>
244
260
  </define>
@@ -262,10 +278,112 @@ and is intended to be referenced by a callout within the source code</a:document
262
278
  <a:documentation>Notes whose scope is the current block</a:documentation>
263
279
  </ref>
264
280
  </zeroOrMore>
265
- <ref name="TermSource">
281
+ <ref name="BlockSource">
282
+ <a:documentation>A source for the block</a:documentation>
283
+ </ref>
284
+ </define>
285
+ <define name="FigureBody">
286
+ <optional>
287
+ <ref name="tname">
288
+ <a:documentation>The caption of the block</a:documentation>
289
+ </ref>
290
+ </optional>
291
+ <choice>
292
+ <a:documentation>Content of the figure</a:documentation>
293
+ <ref name="image"/>
294
+ <ref name="video"/>
295
+ <ref name="audio"/>
296
+ <ref name="pre"/>
297
+ <oneOrMore>
298
+ <ref name="paragraph-with-footnote"/>
299
+ </oneOrMore>
300
+ <zeroOrMore>
301
+ <ref name="figure"/>
302
+ </zeroOrMore>
303
+ </choice>
304
+ <zeroOrMore>
305
+ <ref name="fn">
306
+ <a:documentation>Footnotes specific to the figure</a:documentation>
307
+ </ref>
308
+ </zeroOrMore>
309
+ <optional>
310
+ <ref name="dl">
311
+ <a:documentation>An optional definitions list defining any symbols used in the figure</a:documentation>
312
+ </ref>
313
+ </optional>
314
+ <zeroOrMore>
315
+ <ref name="note">
316
+ <a:documentation>Notes whose scope is the current block</a:documentation>
317
+ </ref>
318
+ </zeroOrMore>
319
+ <ref name="BlockSource">
320
+ <a:documentation>A source for the block</a:documentation>
321
+ </ref>
322
+ </define>
323
+ <define name="FigureNoIdBody">
324
+ <optional>
325
+ <ref name="source">
326
+ <a:documentation>A URI or other reference intended to link to an externally hosted image (or equivalent)</a:documentation>
327
+ </ref>
328
+ </optional>
329
+ <optional>
330
+ <ref name="tname">
331
+ <a:documentation>The caption of the block</a:documentation>
332
+ </ref>
333
+ </optional>
334
+ <choice>
335
+ <a:documentation>Content of the figure</a:documentation>
336
+ <ref name="image-no-id"/>
337
+ <ref name="video-no-id"/>
338
+ <ref name="audio-no-id"/>
339
+ <ref name="pre-no-id"/>
340
+ <oneOrMore>
341
+ <ref name="paragraph-with-footnote-no-id"/>
342
+ </oneOrMore>
343
+ <zeroOrMore>
344
+ <ref name="figure-no-id"/>
345
+ </zeroOrMore>
346
+ </choice>
347
+ <zeroOrMore>
348
+ <ref name="fn">
349
+ <a:documentation>Footnotes specific to the figure</a:documentation>
350
+ </ref>
351
+ </zeroOrMore>
352
+ <optional>
353
+ <ref name="dl-no-id">
354
+ <a:documentation>An optional definitions list defining any symbols used in the figure</a:documentation>
355
+ </ref>
356
+ </optional>
357
+ <zeroOrMore>
358
+ <ref name="note-no-id">
359
+ <a:documentation>Notes whose scope is the current block</a:documentation>
360
+ </ref>
361
+ </zeroOrMore>
362
+ <ref name="BlockSource">
266
363
  <a:documentation>A source for the block</a:documentation>
267
364
  </ref>
268
365
  </define>
366
+ <define name="source">
367
+ <element name="source">
368
+ <attribute name="status">
369
+ <a:documentation>The status of the term as it is used in this document, relative to its definition in the original document</a:documentation>
370
+ <ref name="SourceStatusType"/>
371
+ </attribute>
372
+ <attribute name="type">
373
+ <a:documentation>The type of the managed term in the present context</a:documentation>
374
+ <ref name="SourceTypeType"/>
375
+ </attribute>
376
+ <ref name="origin">
377
+ <a:documentation>The original document and location where the term definition has been obtained from</a:documentation>
378
+ </ref>
379
+ <optional>
380
+ <ref name="modification">
381
+ <a:documentation>Any changes that the definition of the term has undergone relative to the original document,
382
+ in order to be applicable in this standardisation document</a:documentation>
383
+ </ref>
384
+ </optional>
385
+ </element>
386
+ </define>
269
387
  <define name="sourcecodebody">
270
388
  <a:documentation>The computer code or other such text presented in the block, as a single unformatted string.
271
389
  (The string should be treated as pre-formatted text, with whitespace treated as significant)</a:documentation>
@@ -367,6 +485,7 @@ normative or informative references, some split references into sections organiz
367
485
  <!-- exclude figures? -->
368
486
  <define name="dd">
369
487
  <element name="dd">
488
+ <ref name="OptionalId"/>
370
489
  <zeroOrMore>
371
490
  <!-- exclude figures? -->
372
491
  <ref name="BasicBlock"/>
@@ -418,6 +537,7 @@ normative or informative references, some split references into sections organiz
418
537
  </choice>
419
538
  </define>
420
539
  <define name="TrAttributes">
540
+ <ref name="OptionalId"/>
421
541
  <optional>
422
542
  <attribute name="style">
423
543
  <a:documentation>CSS style: only background-color supported</a:documentation>
@@ -487,6 +607,7 @@ gives an explicit page orientation</a:documentation>
487
607
  </include>
488
608
  <!-- end overrides -->
489
609
  <define name="FnAttributes" combine="interleave">
610
+ <ref name="RequiredId"/>
490
611
  <optional>
491
612
  <attribute name="hiddenref">
492
613
  <a:documentation>If true, number the footnote as normal, but suppress display of the footnote reference in the document body.
@@ -496,6 +617,7 @@ This is done if the footnote reference is already presented in some other form,
496
617
  </optional>
497
618
  </define>
498
619
  <define name="TdAttributes" combine="interleave">
620
+ <ref name="RequiredId"/>
499
621
  <optional>
500
622
  <attribute name="style">
501
623
  <a:documentation>CSS style: only background-color supported</a:documentation>
@@ -687,6 +809,32 @@ titlecase, or lowercase</a:documentation>
687
809
  </attribute>
688
810
  </optional>
689
811
  </define>
812
+ <define name="RequiredId" combine="interleave">
813
+ <optional>
814
+ <attribute name="anchor">
815
+ <a:documentation>User-supplied anchor of element; replaced by content-based id, with all references to the anchor updated accordingly</a:documentation>
816
+ </attribute>
817
+ </optional>
818
+ <optional>
819
+ <attribute name="source">
820
+ <a:documentation>Sourcing of the current element in an external data model</a:documentation>
821
+ <ref name="IdRefType"/>
822
+ </attribute>
823
+ </optional>
824
+ </define>
825
+ <define name="OptionalId" combine="interleave">
826
+ <optional>
827
+ <attribute name="anchor">
828
+ <a:documentation> User-supplied anchor of element; replaced by content-based id, with all references to the anchor updated accordingly</a:documentation>
829
+ </attribute>
830
+ </optional>
831
+ <optional>
832
+ <attribute name="source">
833
+ <a:documentation>Sourcing of the current element in an external data model</a:documentation>
834
+ <ref name="IdRefType"/>
835
+ </attribute>
836
+ </optional>
837
+ </define>
690
838
  <define name="ObligationType">
691
839
  <a:documentation>The force of a clause in a standard document: whether it has normative or informative effect</a:documentation>
692
840
  <choice>
@@ -832,6 +980,7 @@ titlecase, or lowercase</a:documentation>
832
980
  is used in particular to capture mutually agreed definitions of codepoints in Unicode Private Use Area</a:documentation>
833
981
  </attribute>
834
982
  </optional>
983
+ <ref name="OptionalId"/>
835
984
  <oneOrMore>
836
985
  <ref name="TextElement">
837
986
  <a:documentation>Textual content of span</a:documentation>
@@ -1081,7 +1230,7 @@ That concept may be defined as a term within the current document, or it may be
1081
1230
  <element name="label">
1082
1231
  <!-- Identifier of form input element that this element is a label of -->
1083
1232
  <attribute name="for">
1084
- <data type="IDREF"/>
1233
+ <ref name="IdRefType"/>
1085
1234
  </attribute>
1086
1235
  <zeroOrMore>
1087
1236
  <ref name="PureTextElement"/>
@@ -1686,7 +1835,7 @@ used in document amendments</a:documentation>
1686
1835
  </element>
1687
1836
  </define>
1688
1837
  <define name="TermAttributes">
1689
- <ref name="OptionalId"/>
1838
+ <ref name="RequiredId"/>
1690
1839
  <ref name="LocalizedStringAttributes"/>
1691
1840
  <ref name="BlockAttributes"/>
1692
1841
  </define>
@@ -2029,6 +2178,7 @@ used in document amendments</a:documentation>
2029
2178
  <define name="termdefinition">
2030
2179
  <a:documentation>The definition of a term applied in the current document</a:documentation>
2031
2180
  <element name="definition">
2181
+ <ref name="RequiredId"/>
2032
2182
  <optional>
2033
2183
  <attribute name="type">
2034
2184
  <a:documentation>Type of definition, used to differentiate it from other definitions of the same term if present</a:documentation>
@@ -2050,6 +2200,7 @@ used in document amendments</a:documentation>
2050
2200
  </define>
2051
2201
  <define name="verbaldefinition">
2052
2202
  <element name="verbal-definition">
2203
+ <ref name="RequiredId"/>
2053
2204
  <oneOrMore>
2054
2205
  <choice>
2055
2206
  <a:documentation>Content of the verbal representation of the term</a:documentation>
@@ -2070,6 +2221,7 @@ used in document amendments</a:documentation>
2070
2221
  <define name="nonverbalrep">
2071
2222
  <a:documentation>Non-verbal representation of the term</a:documentation>
2072
2223
  <element name="non-verbal-representation">
2224
+ <ref name="RequiredId"/>
2073
2225
  <oneOrMore>
2074
2226
  <choice>
2075
2227
  <a:documentation>Content of the non-verbal representation of the term</a:documentation>
@@ -2121,7 +2273,7 @@ used in document amendments</a:documentation>
2121
2273
  </define>
2122
2274
  <define name="termsource">
2123
2275
  <a:documentation>The bibliographic source where a term is defined in the sense applicable in this standardisation document</a:documentation>
2124
- <element name="termsource">
2276
+ <element name="source">
2125
2277
  <attribute name="status">
2126
2278
  <a:documentation>The status of the term as it is used in this document, relative to its definition in the original document</a:documentation>
2127
2279
  <ref name="SourceStatusType"/>
@@ -2503,6 +2655,11 @@ Normative References contents contain normative references, but as a clause in t
2503
2655
  <ref name="termsource"/>
2504
2656
  </zeroOrMore>
2505
2657
  </define>
2658
+ <define name="BlockSource">
2659
+ <zeroOrMore>
2660
+ <ref name="source"/>
2661
+ </zeroOrMore>
2662
+ </define>
2506
2663
  <start>
2507
2664
  <ref name="standard-document"/>
2508
2665
  </start>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ietf
3
- VERSION = "3.5.5".freeze
3
+ VERSION = "3.5.7".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.5.5
4
+ version: 3.5.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-04-29 00:00:00.000000000 Z
11
+ date: 2025-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-ietf-data