metanorma-standoc 1.3.28 → 1.3.29

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: 8ee3fb2a341c932aff7e68ccb8c048151741abcb0faaaeacc7397ec9f2b2d57e
4
- data.tar.gz: d61e8f1944322c8f2d8a43dff3f0dc9fb6f3c74caffd3ce17998e1b7e25ff7a6
3
+ metadata.gz: e964fb25b29d5ecbe775bf397a17f9cf264fa3709e8756be7a9025bcf043250f
4
+ data.tar.gz: d6085180737f332f6aa657eb129bf72f02ca0466b60e22276ddda03cd2cbd788
5
5
  SHA512:
6
- metadata.gz: 88eccb85c42a5a580f6a56a43ebd86122583fda463ceb4d1599671f482e5a6341ab4299f88d40a07aa639953c701a846101bbe3453dbf44a66947c7641d0cda2
7
- data.tar.gz: f4cfbe3757116cb13eda00da0f01fb97b9548ae4eb5b9c5c56b3463ffcd3ab1dcbdddf182799b280ab430e7dbd4ee30179764c332c326238e98a5c1b3ef8a899
6
+ metadata.gz: baccf6cbbb3c32defcac92b95911e83f10f44338a2bb631a8c6ee86a7b00833583d27161b18ad45b2d80aeec8dcbe3dd349a39b4cfa08670f6cdbe1c8492323c
7
+ data.tar.gz: 347739395332e6d3ac88ea0ec5bec557fa0d06dee7f7f2bbafa198e245131dd313c3f229f63bb3afc92c99eb4cd0cec8fc2a9f969e0cbf42a76271e45955e8eb
@@ -6,15 +6,23 @@ on:
6
6
  push:
7
7
  branches: [ master ]
8
8
  pull_request:
9
+ paths-ignore:
10
+ - .github/workflows/ubuntu.yml
11
+ - .github/workflows/windows.yml
9
12
 
10
13
  jobs:
11
14
  test-macos:
12
15
  name: Test on Ruby ${{ matrix.ruby }} macOS
13
16
  runs-on: macos-latest
17
+ continue-on-error: ${{ matrix.experimental }}
14
18
  strategy:
15
19
  fail-fast: false
16
20
  matrix:
17
21
  ruby: [ '2.6', '2.5', '2.4' ]
22
+ experimental: [false]
23
+ include:
24
+ - ruby: '2.7'
25
+ experimental: true
18
26
  steps:
19
27
  - uses: actions/checkout@master
20
28
  - name: Use Ruby
@@ -6,15 +6,23 @@ on:
6
6
  push:
7
7
  branches: [ master ]
8
8
  pull_request:
9
+ paths-ignore:
10
+ - .github/workflows/macos.yml
11
+ - .github/workflows/windows.yml
9
12
 
10
13
  jobs:
11
14
  test-linux:
12
15
  name: Test on Ruby ${{ matrix.ruby }} Ubuntu
13
16
  runs-on: ubuntu-latest
17
+ continue-on-error: ${{ matrix.experimental }}
14
18
  strategy:
15
19
  fail-fast: false
16
20
  matrix:
17
21
  ruby: [ '2.6', '2.5', '2.4' ]
22
+ experimental: [false]
23
+ include:
24
+ - ruby: '2.7'
25
+ experimental: true
18
26
  steps:
19
27
  - uses: actions/checkout@master
20
28
  - name: Use Ruby
@@ -6,15 +6,23 @@ on:
6
6
  push:
7
7
  branches: [ master ]
8
8
  pull_request:
9
+ paths-ignore:
10
+ - .github/workflows/macos.yml
11
+ - .github/workflows/ubuntu.yml
9
12
 
10
13
  jobs:
11
14
  test-windows:
12
15
  name: Test on Ruby ${{ matrix.ruby }} Windows
13
16
  runs-on: windows-latest
17
+ continue-on-error: ${{ matrix.experimental }}
14
18
  strategy:
15
19
  fail-fast: false
16
20
  matrix:
17
21
  ruby: [ '2.6', '2.5', '2.4' ]
22
+ experimental: [false]
23
+ include:
24
+ - ruby: '2.7'
25
+ experimental: true
18
26
  steps:
19
27
  - uses: actions/checkout@master
20
28
  - name: Use Ruby
@@ -169,9 +169,13 @@ module Asciidoctor
169
169
  html_converter(node).convert(@filename + ".xml")
170
170
  doc_converter(node).convert(@filename + ".xml")
171
171
  end
172
+ clean_exit
173
+ ret
174
+ end
175
+
176
+ def clean_exit
172
177
  @log.write(@localdir + @filename + ".err") unless @novalid
173
178
  @files_to_delete.each { |f| FileUtils.rm f }
174
- ret
175
179
  end
176
180
 
177
181
  def makexml1(node)
@@ -88,7 +88,7 @@
88
88
  <text/>
89
89
  </element>
90
90
  </define>
91
- <define name="LocalizedString">
91
+ <define name="LocalizedString1">
92
92
  <optional>
93
93
  <!-- multiple languages and scripts possible: comma delimit them if so -->
94
94
  <attribute name="language"/>
@@ -98,6 +98,16 @@
98
98
  </optional>
99
99
  <text/>
100
100
  </define>
101
+ <define name="LocalizedString">
102
+ <choice>
103
+ <ref name="LocalizedString1"/>
104
+ <oneOrMore>
105
+ <element name="variant">
106
+ <ref name="LocalizedString1"/>
107
+ </element>
108
+ </oneOrMore>
109
+ </choice>
110
+ </define>
101
111
  <!--
102
112
  Unlike UML, change type to format: type is overloaded
103
113
  Would be need if plain were default value and could omit the attribute
@@ -121,7 +131,7 @@
121
131
  </optional>
122
132
  <ref name="LocalizedStringOrXsAny"/>
123
133
  </define>
124
- <define name="LocalizedStringOrXsAny">
134
+ <define name="LocalizedStringOrXsAny1">
125
135
  <optional>
126
136
  <!-- multiple languages and scripts possible: comma delimit them if so -->
127
137
  <attribute name="language"/>
@@ -136,6 +146,16 @@
136
146
  </choice>
137
147
  </oneOrMore>
138
148
  </define>
149
+ <define name="LocalizedStringOrXsAny">
150
+ <choice>
151
+ <ref name="LocalizedStringOrXsAny1"/>
152
+ <oneOrMore>
153
+ <element name="variant">
154
+ <ref name="LocalizedStringOrXsAny1"/>
155
+ </element>
156
+ </oneOrMore>
157
+ </choice>
158
+ </define>
139
159
  <define name="contributor">
140
160
  <element name="contributor">
141
161
  <zeroOrMore>
@@ -21,6 +21,10 @@ module Asciidoctor
21
21
  subsequence: node.attr("subsequence") )
22
22
  end
23
23
 
24
+ def note_attr(node)
25
+ attr_code(id_attr(node).merge("keep-separate": node.attr("keep-separate")))
26
+ end
27
+
24
28
  # We append each contained block to its parent
25
29
  def open(node)
26
30
  role = node.role || node.attr("style")
@@ -91,7 +95,7 @@ module Asciidoctor
91
95
 
92
96
  def termnote(n)
93
97
  noko do |xml|
94
- xml.termnote **id_attr(n) do |ex|
98
+ xml.termnote **note_attr(n) do |ex|
95
99
  wrap_in_para(n, ex)
96
100
  end
97
101
  end.join("\n")
@@ -99,7 +103,7 @@ module Asciidoctor
99
103
 
100
104
  def note(n)
101
105
  noko do |xml|
102
- xml.note **id_attr(n) do |c|
106
+ xml.note **note_attr(n) do |c|
103
107
  wrap_in_para(n, c)
104
108
  end
105
109
  end.join("\n")
@@ -146,8 +150,7 @@ module Asciidoctor
146
150
 
147
151
  def pseudocode_example(node)
148
152
  noko do |xml|
149
- xml.figure **{id: Asciidoctor::Standoc::Utils::anchor_or_uuid(node),
150
- class: "pseudocode"} do |ex|
153
+ xml.figure **id_unnum_attr(node).merge(class: "pseudocode") do |ex|
151
154
  figure_title(node, ex)
152
155
  wrap_in_para(node, ex)
153
156
  end
@@ -131,10 +131,13 @@ module Asciidoctor
131
131
  def note_cleanup(xmldoc)
132
132
  q = "//note[following-sibling::*[not(local-name() = 'note')]]"
133
133
  xmldoc.xpath(q).each do |n|
134
+ next if n["keep-separate"] == "true"
134
135
  next unless n.ancestors("table").empty?
135
136
  prev = n.previous_element || next
136
137
  n.parent = prev if ELEMS_ALLOW_NOTES.include? prev.name
137
138
  end
139
+ xmldoc.xpath("//note[@keep-separate]").each { |n| n.delete("keep-separate") }
140
+ xmldoc.xpath("//termnote[@keep-separate]").each { |n| n.delete("keep-separate") }
138
141
  end
139
142
 
140
143
  def requirement_cleanup(x)
@@ -25,7 +25,6 @@ module Asciidoctor
25
25
  @iev = init_iev or return
26
26
  iev = @iev.fetch(locality, xmldoc&.at("//language")&.text || "en") or next
27
27
  pref.include?(iev.downcase) or
28
- #warn %(Term "#{pref[0]}" does not match IEV #{locality} "#{iev}")
29
28
  @log.add("Bibliography", t, %(Term "#{pref[0]}" does not match IEV #{locality} "#{iev}"))
30
29
  end
31
30
  end
@@ -38,14 +37,20 @@ module Asciidoctor
38
37
 
39
38
  def repeat_id_validate(doc)
40
39
  ids = {}
40
+ crash = false
41
41
  doc.xpath("//*[@id]").each do |x|
42
42
  if ids[x["id"]]
43
- @log.add("Anchors", x, "Anchor #{x['id']} has already been used at line #{ids[x['id']]}")
43
+ @log.add("Anchors", x, "Anchor #{x['id']} has already been used at line #{ids[x['id']]}")
44
+ crash = true
44
45
  else
45
46
  ids[x["id"]] = x.line
46
47
  end
47
48
  end
49
+ if crash
50
+ clean_exit
51
+ abort("Cannot deal with multiple instances of same ID")
48
52
  end
53
+ end
49
54
 
50
55
  def schema_validate(doc, schema)
51
56
  Tempfile.open(["tmp", ".xml"], :encoding => 'UTF-8') do |f|
@@ -58,6 +63,7 @@ module Asciidoctor
58
63
  @log.add("Syntax", "XML Line #{"%06d" % error[:line]}:#{error[:column]}", error[:message])
59
64
  end
60
65
  rescue Jing::Error => e
66
+ clean_exit
61
67
  abort "Jing failed with error: #{e}"
62
68
  ensure
63
69
  f.close!
@@ -14,7 +14,6 @@ module Asciidoctor
14
14
  callouts = x.elements.select { |e| e.name == "callout" }
15
15
  annotations = x.elements.select { |e| e.name == "annotation" }
16
16
  if callouts.size != annotations.size
17
- #warn "#{x['id']}: mismatch of callouts and annotations"
18
17
  @log.add("AsciiDoc Input", x, "mismatch of callouts and annotations")
19
18
  end
20
19
  end
@@ -23,7 +22,6 @@ module Asciidoctor
23
22
  def style_warning(node, msg, text = nil)
24
23
  w = msg
25
24
  w += ": #{text}" if text
26
- #warn w
27
25
  @log.add("Style Warning", node, w)
28
26
  end
29
27
 
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Standoc
3
- VERSION = "1.3.28".freeze
3
+ VERSION = "1.3.29".freeze
4
4
  end
5
5
  end
@@ -310,6 +310,11 @@ RSpec.describe Asciidoctor::Standoc do
310
310
  === Term1
311
311
 
312
312
  NOTE: This is a note
313
+
314
+ [NOTE,keep-separate=true]
315
+ ====
316
+ XYZ
317
+ ====
313
318
  INPUT
314
319
  #{BLANK_HDR}
315
320
  <sections>
@@ -321,6 +326,9 @@ RSpec.describe Asciidoctor::Standoc do
321
326
  <termnote id="_">
322
327
  <p id="_">This is a note</p>
323
328
  </termnote>
329
+ <termnote id='_'>
330
+ <p id='_'>XYZ</p>
331
+ </termnote>
324
332
  </term>
325
333
  </terms>
326
334
  </sections>
@@ -395,6 +403,11 @@ RSpec.describe Asciidoctor::Standoc do
395
403
 
396
404
  [[ABC]]
397
405
  NOTE: This is a note
406
+
407
+ [NOTE,keep-separate=true]
408
+ ====
409
+ XYZ
410
+ ====
398
411
  INPUT
399
412
  #{BLANK_HDR}
400
413
  <preface><foreword id="_" obligation="informative">
@@ -408,6 +421,9 @@ RSpec.describe Asciidoctor::Standoc do
408
421
  <note id="ABC">
409
422
  <p id="_">This is a note</p>
410
423
  </note>
424
+ <note id='_'>
425
+ <p id='_'>XYZ</p>
426
+ </note>
411
427
  </clause></sections>
412
428
 
413
429
  </standard-document>
@@ -293,6 +293,35 @@ RSpec.describe Asciidoctor::Standoc do
293
293
  OUTPUT
294
294
  end
295
295
 
296
+ it "does not move notes inside preceding blocks, if they are marked as keep-separate" do
297
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
298
+ #{ASCIIDOC_BLANK_HDR}
299
+
300
+ [stem]
301
+ ++++
302
+ r = 1 %
303
+ r = 1 %
304
+ ++++
305
+
306
+ [NOTE,keep-separate=true]
307
+ ====
308
+ That formula does not do much
309
+ ====
310
+
311
+ Indeed.
312
+ INPUT
313
+ #{BLANK_HDR}
314
+ <sections><formula id="_">
315
+ <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>r</mi><mo>=</mo><mn>1</mn><mi>%</mi><mi>r</mi><mo>=</mo><mn>1</mn><mi>%</mi></math></stem></formula>
316
+ <note id="_">
317
+ <p id="_">That formula does not do much</p>
318
+ </note>
319
+
320
+ <p id="_">Indeed.</p></sections>
321
+ </standard-document>
322
+ OUTPUT
323
+ end
324
+
296
325
  it "does not move notes inside preceding blocks, if they are at clause end" do
297
326
  expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
298
327
  #{ASCIIDOC_BLANK_HDR}
@@ -223,7 +223,8 @@ OUTPUT
223
223
  expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
224
224
  #{ASCIIDOC_BLANK_HDR}
225
225
 
226
- [pseudocode]
226
+ [pseudocode,subsequence="A"]
227
+ [%unnumbered]
227
228
  ====
228
229
  *A* +
229
230
  [smallcap]#B#
@@ -233,7 +234,7 @@ OUTPUT
233
234
  INPUT
234
235
  #{BLANK_HDR}
235
236
  <sections>
236
- <figure id="_" class="pseudocode"><p id="_">  <strong>A</strong><br/>
237
+ <figure id="_" subsequence='A' class="pseudocode" unnumbered="true"><p id="_">  <strong>A</strong><br/>
237
238
          <smallcap>B</smallcap></p>
238
239
  <p id="_">  <em>C</em></p></figure>
239
240
  </sections>
@@ -231,7 +231,7 @@ RSpec.describe Asciidoctor::Standoc do
231
231
  == Normative References
232
232
 
233
233
  * [[[iso123,ISO 123]]] _Standard_
234
- * [[[iso123,(1)ISO 123]]] _Standard_
234
+ * [[[iso124,(1)ISO 123]]] _Standard_
235
235
  INPUT
236
236
  #{BLANK_HDR}
237
237
  <sections>
@@ -344,7 +344,7 @@ RSpec.describe Asciidoctor::Standoc do
344
344
  </relation>
345
345
  <place>Geneva</place>
346
346
  </bibitem>
347
- <bibitem id='iso123' type='standard'>
347
+ <bibitem id='iso124' type='standard'>
348
348
  <fetched>#{Date.today}</fetched>
349
349
  <title type='title-intro' format='text/plain' language='en' script='Latn'>Rubber latex</title>
350
350
  <title type='title-main' format='text/plain' language='en' script='Latn'>Sampling</title>
@@ -543,6 +543,7 @@ RSpec.describe Asciidoctor::Standoc do
543
543
  <uri>www.iso.org</uri>
544
544
  </organization>
545
545
  </contributor>
546
+ <!--
546
547
  <contributor>
547
548
  <role type="publisher"/>
548
549
  <organization>
@@ -551,6 +552,7 @@ RSpec.describe Asciidoctor::Standoc do
551
552
  <uri>www.iec.ch</uri>
552
553
  </organization>
553
554
  </contributor>
555
+ -->
554
556
  <edition>2</edition>
555
557
  <language>en</language>
556
558
  <language>fr</language>
@@ -643,6 +645,7 @@ RSpec.describe Asciidoctor::Standoc do
643
645
  <uri>www.iso.org</uri>
644
646
  </organization>
645
647
  </contributor>
648
+ <!--
646
649
  <contributor>
647
650
  <role type="publisher"/>
648
651
  <organization>
@@ -651,6 +654,7 @@ RSpec.describe Asciidoctor::Standoc do
651
654
  <uri>www.iec.ch</uri>
652
655
  </organization>
653
656
  </contributor>
657
+ -->
654
658
  <edition>2</edition>
655
659
  <language>en</language>
656
660
  <language>fr</language>
@@ -990,7 +994,7 @@ OUTPUT
990
994
  </name>
991
995
  <affiliation>
992
996
  <organization>
993
- <name>IETF</name>
997
+ <name>Internet Engineering Task Force</name>
994
998
  <abbreviation>IETF</abbreviation>
995
999
  </organization>
996
1000
  </affiliation>
@@ -1004,12 +1008,19 @@ OUTPUT
1004
1008
  </name>
1005
1009
  <affiliation>
1006
1010
  <organization>
1007
- <name>IETF</name>
1011
+ <name>Internet Engineering Task Force</name>
1008
1012
  <abbreviation>IETF</abbreviation>
1009
1013
  </organization>
1010
1014
  </affiliation>
1011
1015
  </person>
1012
1016
  </contributor>
1017
+ <contributor>
1018
+ <role type='publisher'/>
1019
+ <organization>
1020
+ <name>Internet Engineering Task Force</name>
1021
+ <abbreviation>IETF</abbreviation>
1022
+ </organization>
1023
+ </contributor>
1013
1024
  <language>en</language>
1014
1025
  <script>Latn</script>
1015
1026
  <abstract format="text/plain" language="en" script="Latn">The standardization of network configuration interfaces for use with the Network Configuration Protocol (NETCONF) or the RESTCONF protocol requires a structured and secure operating environment that promotes human usability and multi-vendor interoperability. There is a need for standard mechanisms to restrict NETCONF or RESTCONF protocol access for particular users to a preconfigured subset of all available NETCONF or RESTCONF protocol operations and content. This document defines such an access control model.This document obsoletes RFC 6536.</abstract>
@@ -1043,7 +1054,7 @@ OUTPUT
1043
1054
  </name>
1044
1055
  <affiliation>
1045
1056
  <organization>
1046
- <name>IETF</name>
1057
+ <name>Internet Engineering Task Force</name>
1047
1058
  <abbreviation>IETF</abbreviation>
1048
1059
  </organization>
1049
1060
  </affiliation>
@@ -1057,12 +1068,19 @@ OUTPUT
1057
1068
  </name>
1058
1069
  <affiliation>
1059
1070
  <organization>
1060
- <name>IETF</name>
1071
+ <name>Internet Engineering Task Force</name>
1061
1072
  <abbreviation>IETF</abbreviation>
1062
1073
  </organization>
1063
1074
  </affiliation>
1064
1075
  </person>
1065
1076
  </contributor>
1077
+ <contributor>
1078
+ <role type='publisher'/>
1079
+ <organization>
1080
+ <name>Internet Engineering Task Force</name>
1081
+ <abbreviation>IETF</abbreviation>
1082
+ </organization>
1083
+ </contributor>
1066
1084
  <language>en</language>
1067
1085
  <script>Latn</script>
1068
1086
  <abstract format="text/plain" language="en" script="Latn">The standardization of network configuration interfaces for use with the Network Configuration Protocol (NETCONF) or the RESTCONF protocol requires a structured and secure operating environment that promotes human usability and multi-vendor interoperability. There is a need for standard mechanisms to restrict NETCONF or RESTCONF protocol access for particular users to a preconfigured subset of all available NETCONF or RESTCONF protocol operations and content. This document defines such an access control model.This document obsoletes RFC 6536.</abstract>