metanorma-standoc 2.1.5 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/lib/metanorma/standoc/base.rb +1 -0
  3. data/lib/metanorma/standoc/blocks.rb +1 -2
  4. data/lib/metanorma/standoc/cleanup.rb +1 -1
  5. data/lib/metanorma/standoc/cleanup_biblio.rb +204 -0
  6. data/lib/metanorma/standoc/cleanup_block.rb +6 -4
  7. data/lib/metanorma/standoc/cleanup_maths.rb +2 -15
  8. data/lib/metanorma/standoc/cleanup_ref.rb +22 -13
  9. data/lib/metanorma/standoc/cleanup_reqt.rb +37 -4
  10. data/lib/metanorma/standoc/cleanup_symbols.rb +1 -1
  11. data/lib/metanorma/standoc/cleanup_text.rb +10 -8
  12. data/lib/metanorma/standoc/cleanup_xref.rb +1 -2
  13. data/lib/metanorma/standoc/converter.rb +2 -0
  14. data/lib/metanorma/standoc/front.rb +1 -1
  15. data/lib/metanorma/standoc/inline.rb +8 -4
  16. data/lib/metanorma/standoc/isodoc.rng +6 -1
  17. data/lib/metanorma/standoc/macros.rb +1 -180
  18. data/lib/metanorma/standoc/macros_inline.rb +194 -0
  19. data/lib/metanorma/standoc/ref_sect.rb +2 -2
  20. data/lib/metanorma/standoc/ref_utility.rb +1 -1
  21. data/lib/metanorma/standoc/reqt.rb +5 -5
  22. data/lib/metanorma/standoc/reqt.rng +1 -1
  23. data/lib/metanorma/standoc/version.rb +1 -1
  24. data/metanorma-standoc.gemspec +2 -3
  25. data/spec/metanorma/{refs_dl_spec.rb → biblio_spec.rb} +84 -1
  26. data/spec/metanorma/blocks_spec.rb +18 -8
  27. data/spec/metanorma/cleanup_blocks_spec.rb +24 -27
  28. data/spec/metanorma/inline_spec.rb +4 -0
  29. data/spec/metanorma/macros_spec.rb +2 -0
  30. data/spec/vcr_cassettes/bsi16341.yml +55 -55
  31. data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +45 -45
  32. data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec1.yml +12 -12
  33. data/spec/vcr_cassettes/hide_refs.yml +59 -59
  34. data/spec/vcr_cassettes/isobib_get_123.yml +12 -12
  35. data/spec/vcr_cassettes/isobib_get_123_1.yml +25 -25
  36. data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +32 -32
  37. data/spec/vcr_cassettes/isobib_get_123_2.yml +22 -22
  38. data/spec/vcr_cassettes/isobib_get_123_2001.yml +13 -13
  39. data/spec/vcr_cassettes/isobib_get_124.yml +12 -12
  40. data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +24 -24
  41. data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +45 -45
  42. data/spec/vcr_cassettes/std-link.yml +11 -11
  43. metadata +7 -6
  44. data/lib/metanorma/standoc/cleanup_ref_dl.rb +0 -113
@@ -764,7 +764,7 @@ RSpec.describe Metanorma::Standoc do
764
764
  ====
765
765
  INPUT
766
766
  output = <<~OUTPUT
767
- #{BLANK_HDR}
767
+ #{BLANK_HDR}
768
768
  <sections>
769
769
  <clause id='_' inline-header='false' obligation='normative'>
770
770
  <title>Clause</title>
@@ -940,6 +940,9 @@ RSpec.describe Metanorma::Standoc do
940
940
 
941
941
  .Final stages: All kernels are fully gelatinized
942
942
  image::spec/examples/rice_images/rice_image3_3.png[]
943
+
944
+ [%key]
945
+ A:: B
943
946
  ====
944
947
  INPUT
945
948
  output = <<~OUTPUT
@@ -956,7 +959,14 @@ RSpec.describe Metanorma::Standoc do
956
959
  <figure id="_">
957
960
  <name>Final stages: All kernels are fully gelatinized</name>
958
961
  <image src="spec/examples/rice_images/rice_image3_3.png" id="_" mimetype="image/png" height="auto" width="auto"/>
959
- </figure></figure>
962
+ </figure>
963
+ <dl id='_' key='true'>
964
+ <dt>A</dt>
965
+ <dd>
966
+ <p id='_'>B</p>
967
+ </dd>
968
+ </dl>
969
+ </figure>
960
970
  </sections>
961
971
  </standard-document>
962
972
  OUTPUT
@@ -1609,7 +1619,7 @@ RSpec.describe Metanorma::Standoc do
1609
1619
  it "processes recommendation" do
1610
1620
  input = <<~"INPUT"
1611
1621
  #{ASCIIDOC_BLANK_HDR}
1612
- [.recommendation,label="/ogc/recommendation/wfs/2",subject="user;developer, implementer",inherit="/ss/584/2015/level/1; /ss/584/2015/level/2",options="unnumbered",type=verification,model=ogc,tag=X,multilingual-rendering=common]
1622
+ [.recommendation,identifier="/ogc/recommendation/wfs/2",subject="user;developer, implementer",inherit="/ss/584/2015/level/1; /ss/584/2015/level/2",options="unnumbered",type=verification,model=ogc,tag=X,multilingual-rendering=common]
1613
1623
  ====
1614
1624
  I recommend this
1615
1625
  ====
@@ -1618,7 +1628,7 @@ RSpec.describe Metanorma::Standoc do
1618
1628
  #{BLANK_HDR}
1619
1629
  <sections>
1620
1630
  <recommendation id="_" unnumbered="true" type="verification" model="ogc" tag='X' multilingual-rendering='common'>
1621
- <label>/ogc/recommendation/wfs/2</label>
1631
+ <identifier>/ogc/recommendation/wfs/2</identifier>
1622
1632
  <subject>user</subject>
1623
1633
  <subject>developer, implementer</subject>
1624
1634
  <inherit>/ss/584/2015/level/1</inherit>
@@ -1719,7 +1729,7 @@ RSpec.describe Metanorma::Standoc do
1719
1729
  . List
1720
1730
  =====
1721
1731
 
1722
- [requirement,type="general",label="/req/core/quantities-uom"]
1732
+ [requirement,type="general",identifier="/req/core/quantities-uom"]
1723
1733
  ======
1724
1734
  ======
1725
1735
  ====
@@ -1744,7 +1754,7 @@ RSpec.describe Metanorma::Standoc do
1744
1754
  </description>
1745
1755
  </permission>
1746
1756
  <requirement id='_' type='general'>
1747
- <label>/req/core/quantities-uom</label>
1757
+ <identifier>/req/core/quantities-uom</identifier>
1748
1758
  </requirement>
1749
1759
  </permission>
1750
1760
  </sections>
@@ -1760,7 +1770,7 @@ RSpec.describe Metanorma::Standoc do
1760
1770
  #{ASCIIDOC_BLANK_HDR}
1761
1771
 
1762
1772
  [[ABC]]
1763
- [.recommendation,label="/ogc/recommendation/wfs/2",subject="user",classification="control-class:Technical;priority:P0;family:System &amp; Communications Protection,System and Communications Protocols",obligation="permission,recommendation",filename="reqt1.rq"]
1773
+ [.recommendation,identifier="/ogc/recommendation/wfs/2",subject="user",classification="control-class:Technical;priority:P0;family:System &amp; Communications Protection,System and Communications Protocols",obligation="permission,recommendation",filename="reqt1.rq"]
1764
1774
  ====
1765
1775
  I recommend _this_.
1766
1776
 
@@ -1819,7 +1829,7 @@ RSpec.describe Metanorma::Standoc do
1819
1829
  output = <<~"OUTPUT"
1820
1830
  #{BLANK_HDR}
1821
1831
  <sections>
1822
- <recommendation id="ABC" obligation="permission,recommendation" filename="reqt1.rq"><label>/ogc/recommendation/wfs/2</label><subject>user</subject>
1832
+ <recommendation id="ABC" obligation="permission,recommendation" filename="reqt1.rq"><identifier>/ogc/recommendation/wfs/2</identifier><subject>user</subject>
1823
1833
  <classification><tag>control-class</tag><value>Technical</value></classification><classification><tag>priority</tag><value>P0</value></classification><classification><tag>family</tag><value>System &amp; Communications Protection</value></classification><classification><tag>family</tag><value>System and Communications Protocols</value></classification>
1824
1834
  <description><p id="_">I recommend <em>this</em>.</p>
1825
1835
  </description><specification exclude="false" type="tabular" keep-with-next="true" keep-lines-together="true"><p id="_">This is the object of the recommendation:</p><table id="_"> <tbody> <tr> <td valign="top" align="left">Object</td> <td valign="top" align="left">Value</td> </tr> <tr> <td valign="top" align="left">Mission</td> <td valign="top" align="left">Accomplished</td> </tr> </tbody></table></specification><description>
@@ -803,7 +803,7 @@ RSpec.describe Metanorma::Standoc do
803
803
  [%metadata]
804
804
  model:: ogc
805
805
  type:: class
806
- label:: http://www.opengis.net/spec/waterml/2.0/req/xsd-xml-rules[*req/core*]
806
+ identifier:: http://www.opengis.net/spec/waterml/2.0/req/xsd-xml-rules[*req/core*]
807
807
  subject:: Encoding of logical models
808
808
  inherit:: urn:iso:dis:iso:19156:clause:7.2.2
809
809
  inherit:: urn:iso:dis:iso:19156:clause:8
@@ -812,6 +812,7 @@ RSpec.describe Metanorma::Standoc do
812
812
  inherit:: http://www.opengis.net/spec/SWE/2.0/req/core/core-concepts-used
813
813
  inherit:: <<ref2>>
814
814
  inherit:: <<ref3>>
815
+ target:: http://www.example.com
815
816
  classification:: priority:P0
816
817
  classification:: domain:Hydrology,Groundwater
817
818
  classification:: control-class:Technical
@@ -826,22 +827,14 @@ RSpec.describe Metanorma::Standoc do
826
827
  <clause id='_' inline-header='false' obligation='normative'>
827
828
  <title>Clause</title>
828
829
  <requirement id='_' subsequence='A' obligation='recommendation,requirement' model='ogc' type='class'>
829
- <label>
830
- <link target='http://www.opengis.net/spec/waterml/2.0/req/xsd-xml-rules'>
831
- <strong>req/core</strong>
832
- </link>
833
- </label>
830
+ <identifier>http://www.opengis.net/spec/waterml/2.0/req/xsd-xml-rules</identifier>
834
831
  <subject>Encoding of logical models</subject>
835
832
  <inherit>/ss/584/2015/level/1 &amp; /ss/584/2015/level/2</inherit>
836
833
  <inherit>urn:iso:dis:iso:19156:clause:7.2.2</inherit>
837
834
  <inherit>urn:iso:dis:iso:19156:clause:8</inherit>
838
- <inherit>
839
- <link target='http://www.opengis.net/doc/IS/GML/3.2/clause/2.4'/>
840
- </inherit>
835
+ <inherit>http://www.opengis.net/doc/IS/GML/3.2/clause/2.4</inherit>
841
836
  <inherit>O&amp;M Abstract model, OGC 10-004r3, clause D.3.4</inherit>
842
- <inherit>
843
- <link target='http://www.opengis.net/spec/SWE/2.0/req/core/core-concepts-used'/>
844
- </inherit>
837
+ <inherit>http://www.opengis.net/spec/SWE/2.0/req/core/core-concepts-used</inherit>
845
838
  <inherit>
846
839
  <xref target='ref2'/>
847
840
  </inherit>
@@ -849,21 +842,25 @@ RSpec.describe Metanorma::Standoc do
849
842
  <xref target='ref3'/>
850
843
  </inherit>
851
844
  <classification>
852
- <tag>control-class</tag>
853
- <value>Technical</value>
854
- </classification>
855
- <classification>
856
- <tag>domain</tag>
857
- <value>Groundwater</value>
858
- </classification>
859
- <classification>
860
- <tag>domain</tag>
861
- <value>Hydrology</value>
862
- </classification>
863
- <classification>
864
- <tag>priority</tag>
865
- <value>P0</value>
866
- </classification>
845
+ <tag>priority</tag>
846
+ <value>P0</value>
847
+ </classification>
848
+ <classification>
849
+ <tag>domain</tag>
850
+ <value>Hydrology</value>
851
+ </classification>
852
+ <classification>
853
+ <tag>domain</tag>
854
+ <value>Groundwater</value>
855
+ </classification>
856
+ <classification>
857
+ <tag>control-class</tag>
858
+ <value>Technical</value>
859
+ </classification>
860
+ <classification>
861
+ <tag>target</tag>
862
+ <value><link target='http://www.example.com'/></value>
863
+ </classification>
867
864
  <description>
868
865
  <p id='_'>I recommend this</p>
869
866
  </description>
@@ -59,6 +59,8 @@ RSpec.describe Metanorma::Standoc do
59
59
  [underline]#underline#
60
60
  [smallcap]#smallcap#
61
61
  [keyword]#keyword#
62
+ [css font-family:"Noto Sans JP"]#text#
63
+ [css font-family:'Noto Sans JP']#text#
62
64
  INPUT
63
65
  output = <<~OUTPUT
64
66
  #{BLANK_HDR}
@@ -80,6 +82,8 @@ RSpec.describe Metanorma::Standoc do
80
82
  <underline>underline</underline>
81
83
  <smallcap>smallcap</smallcap>
82
84
  <keyword>keyword</keyword>
85
+ <span style="font-family:&quot;Noto Sans JP&quot;">text</span>
86
+ <span style="font-family:'Noto Sans JP'">text</span>
83
87
  </sections>
84
88
  </standard-document>
85
89
  OUTPUT
@@ -13,6 +13,7 @@ RSpec.describe Metanorma::Standoc do
13
13
  autonumber:table[3]
14
14
  add:[a <<clause>>] del:[B]
15
15
  identifier:[a http://example.com]
16
+ s:category[text]
16
17
 
17
18
  [bibliography]
18
19
  == Bibliography
@@ -38,6 +39,7 @@ RSpec.describe Metanorma::Standoc do
38
39
  </add>
39
40
  <del>B</del>
40
41
  <identifier>a http://example.com</identifier>
42
+ <span class='category'>text</span>
41
43
  </foreword>
42
44
  </preface>
43
45
  <sections> </sections>