metanorma-standoc 2.1.0 → 2.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/lib/metanorma/standoc/base.rb +3 -1
  3. data/lib/metanorma/standoc/biblio.rng +134 -39
  4. data/lib/metanorma/standoc/blocks.rb +8 -6
  5. data/lib/metanorma/standoc/blocks_notes.rb +3 -0
  6. data/lib/metanorma/standoc/cleanup.rb +1 -0
  7. data/lib/metanorma/standoc/cleanup_footnotes.rb +14 -9
  8. data/lib/metanorma/standoc/cleanup_inline.rb +17 -0
  9. data/lib/metanorma/standoc/cleanup_reqt.rb +1 -1
  10. data/lib/metanorma/standoc/cleanup_terms.rb +3 -1
  11. data/lib/metanorma/standoc/cleanup_text.rb +9 -4
  12. data/lib/metanorma/standoc/cleanup_xref.rb +2 -1
  13. data/lib/metanorma/standoc/converter.rb +2 -0
  14. data/lib/metanorma/standoc/inline.rb +2 -1
  15. data/lib/metanorma/standoc/isodoc.rng +16 -0
  16. data/lib/metanorma/standoc/lists.rb +8 -3
  17. data/lib/metanorma/standoc/macros.rb +31 -4
  18. data/lib/metanorma/standoc/macros_form.rb +1 -1
  19. data/lib/metanorma/standoc/macros_note.rb +1 -6
  20. data/lib/metanorma/standoc/ref_sect.rb +2 -1
  21. data/lib/metanorma/standoc/reqt.rb +5 -3
  22. data/lib/metanorma/standoc/section.rb +1 -1
  23. data/lib/metanorma/standoc/version.rb +1 -1
  24. data/metanorma-standoc.gemspec +2 -2
  25. data/spec/metanorma/base_spec.rb +41 -5
  26. data/spec/metanorma/blocks_spec.rb +53 -1
  27. data/spec/metanorma/cleanup_sections_spec.rb +5 -5
  28. data/spec/metanorma/cleanup_spec.rb +6 -6
  29. data/spec/metanorma/cleanup_terms_spec.rb +1 -1
  30. data/spec/metanorma/inline_spec.rb +3 -3
  31. data/spec/metanorma/lists_spec.rb +10 -4
  32. data/spec/metanorma/macros_spec.rb +21 -12
  33. data/spec/metanorma/refs_spec.rb +112 -118
  34. data/spec/metanorma/table_spec.rb +24 -6
  35. data/spec/spec_helper.rb +1 -1
  36. data/spec/vcr_cassettes/bsi16341.yml +69 -69
  37. data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +89 -89
  38. data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec1.yml +12 -12
  39. data/spec/vcr_cassettes/hide_refs.yml +55 -55
  40. data/spec/vcr_cassettes/isobib_get_123.yml +14 -14
  41. data/spec/vcr_cassettes/isobib_get_123_1.yml +28 -28
  42. data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +35 -35
  43. data/spec/vcr_cassettes/isobib_get_123_2001.yml +14 -14
  44. data/spec/vcr_cassettes/isobib_get_124.yml +12 -12
  45. data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +228 -52
  46. data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +56 -58
  47. data/spec/vcr_cassettes/std-link.yml +17 -17
  48. metadata +9 -10
  49. data/docs/quickstart.adoc +0 -375
@@ -1656,127 +1656,121 @@ RSpec.describe Metanorma::Standoc do
1656
1656
  <clause id="_" inline-header="false" obligation="normative">
1657
1657
  <title>Clause 4</title>
1658
1658
  <p id="_">
1659
- <eref type="inline" bibitemid="iso123" citeas="RFC 8341"/>
1659
+ <eref type="inline" bibitemid="iso123" citeas="IETF RFC 8341"/>
1660
1660
  </p>
1661
1661
  </clause>
1662
1662
  </sections><bibliography><references id="_" obligation="informative" normative="true">
1663
1663
  <title>Normative references</title>
1664
1664
  #{NORM_REF_BOILERPLATE}
1665
- <bibitem id='iso123' type='standard'>
1666
- <fetched/>
1667
- <title format='text/plain' language='en' script='Latn'>Network Configuration Access Control Model</title>
1668
- <uri type='src'>https://www.rfc-editor.org/info/rfc8341</uri>
1669
- <docidentifier type='RFC' primary="true">RFC 8341</docidentifier>
1670
- <docidentifier type='RFC' scope='anchor'>RFC8341</docidentifier>
1671
- <docidentifier type='DOI'>10.17487/RFC8341</docidentifier>
1672
- <docnumber>RFC8341</docnumber>
1673
- <date type='published'>
1674
- <on>2018-03</on>
1675
- </date>
1676
- <contributor>
1677
- <role type='publisher'/>
1678
- <organization>
1679
- <name>Internet Engineering Task Force</name>
1680
- <abbreviation>IETF</abbreviation>
1681
- </organization>
1682
- </contributor>
1683
- <contributor>
1684
- <role type='author'/>
1685
- <person>
1686
- <name>
1687
- <completename language='en'>A. Bierman</completename>
1688
- </name>
1689
- </person>
1690
- </contributor>
1691
- <contributor>
1692
- <role type='author'/>
1693
- <person>
1694
- <name>
1695
- <completename language='en'>M. Bjorklund</completename>
1696
- </name>
1697
- </person>
1698
- </contributor>
1699
- <language>en</language>
1700
- <script>Latn</script>
1701
- <abstract format='text/html' language='en' script='Latn'>
1702
- <p id='_'>
1703
- The standardization of network configuration interfaces for use with
1704
- the Network Configuration Protocol (NETCONF) or the RESTCONF protocol
1705
- requires a structured and secure operating environment that promotes
1706
- human usability and multi-vendor interoperability. There is a need for
1707
- standard mechanisms to restrict NETCONF or RESTCONF protocol access
1708
- for particular users to a preconfigured subset of all available
1709
- NETCONF or RESTCONF protocol operations and content. This document
1710
- defines such an access control model.</p>
1711
- <p id='_'>This document obsoletes RFC 6536.</p>
1712
- </abstract>
1713
- <series type='main'>
1714
- <title format='text/plain' language='en' script='Latn'>STD</title>
1715
- <number>91</number>
1716
- </series>
1717
- <series type='main'>
1718
- <title format='text/plain' language='en' script='Latn'>RFC</title>
1719
- <number>8341</number>
1720
- </series>
1721
- </bibitem>
1722
- <bibitem id='iso124' type='standard'>
1723
- <fetched/>
1724
- <title format='text/plain' language='en' script='Latn'>Network Configuration Access Control Model</title>
1725
- <uri type='src'>https://www.rfc-editor.org/info/rfc8341</uri>
1726
- <docidentifier type='RFC' primary="true">RFC 8341</docidentifier>
1727
- <docidentifier type='metanorma'>[1]</docidentifier>
1728
- <docidentifier type='RFC' scope='anchor'>RFC8341</docidentifier>
1729
- <docidentifier type='DOI'>10.17487/RFC8341</docidentifier>
1730
- <docnumber>RFC8341</docnumber>
1731
- <date type='published'>
1732
- <on>2018-03</on>
1733
- </date>
1734
- <contributor>
1735
- <role type='publisher'/>
1736
- <organization>
1737
- <name>Internet Engineering Task Force</name>
1738
- <abbreviation>IETF</abbreviation>
1739
- </organization>
1740
- </contributor>
1741
- <contributor>
1742
- <role type='author'/>
1743
- <person>
1744
- <name>
1745
- <completename language='en'>A. Bierman</completename>
1746
- </name>
1747
- </person>
1748
- </contributor>
1749
- <contributor>
1750
- <role type='author'/>
1751
- <person>
1752
- <name>
1753
- <completename language='en'>M. Bjorklund</completename>
1754
- </name>
1755
- </person>
1756
- </contributor>
1757
- <language>en</language>
1758
- <script>Latn</script>
1759
- <abstract format='text/html' language='en' script='Latn'>
1760
- <p id='_'>
1761
- The standardization of network configuration interfaces for use with
1762
- the Network Configuration Protocol (NETCONF) or the RESTCONF protocol
1763
- requires a structured and secure operating environment that promotes
1764
- human usability and multi-vendor interoperability. There is a need for
1765
- standard mechanisms to restrict NETCONF or RESTCONF protocol access
1766
- for particular users to a preconfigured subset of all available
1767
- NETCONF or RESTCONF protocol operations and content. This document
1768
- defines such an access control model.</p>
1769
- <p id='_'>This document obsoletes RFC 6536.</p>
1770
- </abstract>
1771
- <series type='main'>
1772
- <title format='text/plain' language='en' script='Latn'>STD</title>
1773
- <number>91</number>
1774
- </series>
1775
- <series type='main'>
1776
- <title format='text/plain' language='en' script='Latn'>RFC</title>
1777
- <number>8341</number>
1778
- </series>
1779
- </bibitem>
1665
+ <bibitem id='iso123' type='standard'>
1666
+ <fetched/>
1667
+ <title type='main' format='text/plain'>Network Configuration Access Control Model</title>
1668
+ <uri type='src'>https://www.rfc-editor.org/info/rfc8341</uri>
1669
+ <docidentifier type='IETF' primary='true'>RFC 8341</docidentifier>
1670
+ <docidentifier type='IETF' scope='anchor'>RFC8341</docidentifier>
1671
+ <docidentifier type='DOI'>10.17487/RFC8341</docidentifier>
1672
+ <docnumber>RFC8341</docnumber>
1673
+ <date type='published'>
1674
+ <on>2018-03</on>
1675
+ </date>
1676
+ <contributor>
1677
+ <role type='author'/>
1678
+ <person>
1679
+ <name>
1680
+ <completename language='en' script='Latn'>A. Bierman</completename>
1681
+ </name>
1682
+ </person>
1683
+ </contributor>
1684
+ <contributor>
1685
+ <role type='author'/>
1686
+ <person>
1687
+ <name>
1688
+ <completename language='en' script='Latn'>M. Bjorklund</completename>
1689
+ </name>
1690
+ </person>
1691
+ </contributor>
1692
+ <language>en</language>
1693
+ <script>Latn</script>
1694
+ <abstract format='text/html' language='en' script='Latn'>
1695
+ <p id='_'>
1696
+ The standardization of network configuration interfaces for use with
1697
+ the Network Configuration Protocol (NETCONF) or the RESTCONF
1698
+ protocol requires a structured and secure operating environment that
1699
+ promotes human usability and multi-vendor interoperability. There is
1700
+ a need for standard mechanisms to restrict NETCONF or RESTCONF
1701
+ protocol access for particular users to a preconfigured subset of
1702
+ all available NETCONF or RESTCONF protocol operations and content.
1703
+ This document defines such an access control model.
1704
+ </p>
1705
+ <p id='_'>This document obsoletes RFC 6536.</p>
1706
+ </abstract>
1707
+ <series>
1708
+ <title format='text/plain'>STD</title>
1709
+ <number>91</number>
1710
+ </series>
1711
+ <series>
1712
+ <title format='text/plain'>RFC</title>
1713
+ <number>8341</number>
1714
+ </series>
1715
+ <keyword>NETCONF RESTCONF</keyword>
1716
+ <keyword>YANG</keyword>
1717
+ <keyword>XML</keyword>
1718
+ </bibitem>
1719
+ <bibitem id='iso124' type='standard'>
1720
+ <fetched/>
1721
+ <title type='main' format='text/plain'>Network Configuration Access Control Model</title>
1722
+ <uri type='src'>https://www.rfc-editor.org/info/rfc8341</uri>
1723
+ <docidentifier type='IETF' primary='true'>RFC 8341</docidentifier>
1724
+ <docidentifier type='metanorma'>[1]</docidentifier>
1725
+ <docidentifier type='IETF' scope='anchor'>RFC8341</docidentifier>
1726
+ <docidentifier type='DOI'>10.17487/RFC8341</docidentifier>
1727
+ <docnumber>RFC8341</docnumber>
1728
+ <date type='published'>
1729
+ <on>2018-03</on>
1730
+ </date>
1731
+ <contributor>
1732
+ <role type='author'/>
1733
+ <person>
1734
+ <name>
1735
+ <completename language='en' script='Latn'>A. Bierman</completename>
1736
+ </name>
1737
+ </person>
1738
+ </contributor>
1739
+ <contributor>
1740
+ <role type='author'/>
1741
+ <person>
1742
+ <name>
1743
+ <completename language='en' script='Latn'>M. Bjorklund</completename>
1744
+ </name>
1745
+ </person>
1746
+ </contributor>
1747
+ <language>en</language>
1748
+ <script>Latn</script>
1749
+ <abstract format='text/html' language='en' script='Latn'>
1750
+ <p id='_'>
1751
+ The standardization of network configuration interfaces for use with
1752
+ the Network Configuration Protocol (NETCONF) or the RESTCONF
1753
+ protocol requires a structured and secure operating environment that
1754
+ promotes human usability and multi-vendor interoperability. There is
1755
+ a need for standard mechanisms to restrict NETCONF or RESTCONF
1756
+ protocol access for particular users to a preconfigured subset of
1757
+ all available NETCONF or RESTCONF protocol operations and content.
1758
+ This document defines such an access control model.
1759
+ </p>
1760
+ <p id='_'>This document obsoletes RFC 6536.</p>
1761
+ </abstract>
1762
+ <series>
1763
+ <title format='text/plain'>STD</title>
1764
+ <number>91</number>
1765
+ </series>
1766
+ <series>
1767
+ <title format='text/plain'>RFC</title>
1768
+ <number>8341</number>
1769
+ </series>
1770
+ <keyword>NETCONF RESTCONF</keyword>
1771
+ <keyword>YANG</keyword>
1772
+ <keyword>XML</keyword>
1773
+ </bibitem>
1780
1774
  </references>
1781
1775
  </bibliography>
1782
1776
  </standard-document>
@@ -1906,7 +1900,7 @@ RSpec.describe Metanorma::Standoc do
1906
1900
  <from>#{Date.today.year}</from>
1907
1901
  </copyright>
1908
1902
  <ext>
1909
- <doctype>article</doctype>
1903
+ <doctype>standard</doctype>
1910
1904
  </ext>
1911
1905
  </bibdata>
1912
1906
  <sections>
@@ -2495,7 +2489,7 @@ RSpec.describe Metanorma::Standoc do
2495
2489
  <foreword id='_' obligation='informative'>
2496
2490
  <title>Foreword</title>
2497
2491
  <p id='_'>
2498
- <eref type='inline' bibitemid='iso124' citeas='[&amp;#x3c;strong&amp;#x3e;A&amp;#x3c;/strong&amp;#x3e;.&amp;#x3c;fn reference=&amp;#x22;1&amp;#x22;&amp;#x3e;&amp;#x3c;p&amp;#x3e;hello&amp;#x3c;/p&amp;#x3e;&amp;#xa;&amp;#x3c;/fn&amp;#x3e;]'/>
2492
+ <eref type='inline' bibitemid='iso124' citeas='[&lt;strong&gt;A&lt;/strong&gt;.&lt;fn reference=&quot;1&quot;&gt;&lt;p&gt;hello&lt;/p&gt;&#10;&lt;/fn&gt;]'/>
2499
2493
  </p>
2500
2494
  </foreword>
2501
2495
  </preface>
@@ -2,7 +2,7 @@ require "spec_helper"
2
2
 
3
3
  RSpec.describe Metanorma::Standoc do
4
4
  it "processes basic tables" do
5
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
5
+ input = <<~INPUT
6
6
  #{ASCIIDOC_BLANK_HDR}
7
7
  .Table Name
8
8
  |===
@@ -11,6 +11,7 @@ RSpec.describe Metanorma::Standoc do
11
11
  h|1 |2 |3
12
12
  |===
13
13
  INPUT
14
+ output = <<~OUTPUT
14
15
  #{BLANK_HDR}
15
16
  <sections>
16
17
  <table id="_">
@@ -33,10 +34,12 @@ RSpec.describe Metanorma::Standoc do
33
34
  </sections>
34
35
  </standard-document>
35
36
  OUTPUT
37
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
38
+ .to be_equivalent_to xmlpp(output)
36
39
  end
37
40
 
38
41
  it "processes table widths" do
39
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
42
+ input = <<~INPUT
40
43
  #{ASCIIDOC_BLANK_HDR}
41
44
  [width=75%]
42
45
  |===
@@ -57,6 +60,7 @@ RSpec.describe Metanorma::Standoc do
57
60
  |===
58
61
 
59
62
  INPUT
63
+ output = <<~OUTPUT
60
64
  #{BLANK_HDR}
61
65
  <sections>
62
66
  <table id='_' width='75%'>
@@ -93,10 +97,12 @@ RSpec.describe Metanorma::Standoc do
93
97
  </standard-document>
94
98
 
95
99
  OUTPUT
100
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
101
+ .to be_equivalent_to xmlpp(output)
96
102
  end
97
103
 
98
104
  it "processes column widths in tables" do
99
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
105
+ input = <<~INPUT
100
106
  #{ASCIIDOC_BLANK_HDR}
101
107
  [cols=".<,.^,^.>"]
102
108
  |===
@@ -120,6 +126,7 @@ RSpec.describe Metanorma::Standoc do
120
126
  |1 |2 |3
121
127
  |===
122
128
  INPUT
129
+ output = <<~OUTPUT
123
130
  #{BLANK_HDR}
124
131
  <sections>
125
132
  <table id='_'>
@@ -178,10 +185,12 @@ RSpec.describe Metanorma::Standoc do
178
185
  </sections>
179
186
  </standard-document>
180
187
  OUTPUT
188
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
189
+ .to be_equivalent_to xmlpp(output)
181
190
  end
182
191
 
183
192
  it "inserts header rows in a table with a name and no header" do
184
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
193
+ input = <<~INPUT
185
194
  #{ASCIIDOC_BLANK_HDR}
186
195
  [headerrows=2]
187
196
  .Table Name
@@ -191,6 +200,7 @@ RSpec.describe Metanorma::Standoc do
191
200
  h|1 |2 |3
192
201
  |===
193
202
  INPUT
203
+ output = <<~OUTPUT
194
204
  #{BLANK_HDR}
195
205
  <sections>
196
206
  <table id="_">
@@ -217,10 +227,12 @@ RSpec.describe Metanorma::Standoc do
217
227
  </sections>
218
228
  </standard-document>
219
229
  OUTPUT
230
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
231
+ .to be_equivalent_to xmlpp(output)
220
232
  end
221
233
 
222
234
  it "inserts header rows in a table without a name and no header" do
223
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
235
+ input = <<~INPUT
224
236
  #{ASCIIDOC_BLANK_HDR}
225
237
  [headerrows=2]
226
238
  |===
@@ -229,6 +241,7 @@ RSpec.describe Metanorma::Standoc do
229
241
  h|1 |2 |3
230
242
  |===
231
243
  INPUT
244
+ output = <<~OUTPUT
232
245
  #{BLANK_HDR}
233
246
  <sections>
234
247
  <table id="_"><thead><tr>
@@ -253,10 +266,12 @@ RSpec.describe Metanorma::Standoc do
253
266
  </sections>
254
267
  </standard-document>
255
268
  OUTPUT
269
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
270
+ .to be_equivalent_to xmlpp(output)
256
271
  end
257
272
 
258
273
  it "processes complex tables" do
259
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
274
+ input = <<~INPUT
260
275
  #{ASCIIDOC_BLANK_HDR}
261
276
  [cols="<.^,^.<,^.>,^,^",options="header,footer",headerrows=2,alt="An extensive summary, and illustration, of tables",subsequence="A",options="unnumbered",summary="This is an extremely long, convoluted summary",width=70%,number="3",keep-with-next=true,keep-lines-together=true]
262
277
  .Maximum _permissible_ mass fraction of defects
@@ -286,6 +301,7 @@ RSpec.describe Metanorma::Standoc do
286
301
  5+a| Live insects shall not be present. Dead insects shall be included in extraneous matter.
287
302
  |===
288
303
  INPUT
304
+ output = <<~OUTPUT
289
305
  #{BLANK_HDR}
290
306
  <sections>
291
307
  <table id="_" alt="An extensive summary, and illustration, of tables" unnumbered="true" subsequence="A" summary="This is an extremely long, convoluted summary" width="70%" number="3" keep-with-next="true" keep-lines-together="true">
@@ -452,5 +468,7 @@ RSpec.describe Metanorma::Standoc do
452
468
  </sections>
453
469
  </standard-document>
454
470
  OUTPUT
471
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
472
+ .to be_equivalent_to xmlpp(output)
455
473
  end
456
474
  end
data/spec/spec_helper.rb CHANGED
@@ -161,7 +161,7 @@ BLANK_HDR = <<~"HDR".freeze
161
161
  <from>#{Time.new.year}</from>
162
162
  </copyright>
163
163
  <ext>
164
- <doctype>article</doctype>
164
+ <doctype>standard</doctype>
165
165
  </ext>
166
166
  </bibdata>
167
167
  HDR