metanorma-iso 2.0.8.1 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/lib/html2doc/lists.rb +169 -0
  3. data/lib/isodoc/iso/base_convert.rb +11 -1
  4. data/lib/isodoc/iso/html/html_iso_titlepage.html +7 -0
  5. data/lib/isodoc/iso/html/isodoc-dis.css +407 -427
  6. data/lib/isodoc/iso/html/isodoc-dis.scss +482 -438
  7. data/lib/isodoc/iso/html/isodoc.css +38 -13
  8. data/lib/isodoc/iso/html/isodoc.scss +38 -12
  9. data/lib/isodoc/iso/html/style-human.css +14 -1
  10. data/lib/isodoc/iso/html/style-human.scss +10 -1
  11. data/lib/isodoc/iso/html/style-iso.css +35 -23
  12. data/lib/isodoc/iso/html/style-iso.scss +31 -23
  13. data/lib/isodoc/iso/html/word_iso_intro-dis.html +3 -1
  14. data/lib/isodoc/iso/html/word_iso_titlepage-dis.html +26 -13
  15. data/lib/isodoc/iso/html/word_iso_titlepage-prf.html +58 -0
  16. data/lib/isodoc/iso/html/word_iso_titlepage.html +16 -6
  17. data/lib/isodoc/iso/html/wordstyle-dis.css +168 -48
  18. data/lib/isodoc/iso/html/wordstyle-dis.scss +158 -43
  19. data/lib/isodoc/iso/html_convert.rb +7 -2
  20. data/lib/isodoc/iso/i18n-en.yaml +33 -4
  21. data/lib/isodoc/iso/i18n-fr.yaml +30 -3
  22. data/lib/isodoc/iso/i18n-ru.yaml +33 -4
  23. data/lib/isodoc/iso/i18n-zh-Hans.yaml +33 -3
  24. data/lib/isodoc/iso/i18n.rb +1 -1
  25. data/lib/isodoc/iso/init.rb +17 -1
  26. data/lib/isodoc/iso/iso.amendment.xsl +1711 -367
  27. data/lib/isodoc/iso/iso.international-standard.xsl +1711 -367
  28. data/lib/isodoc/iso/metadata.rb +72 -78
  29. data/lib/isodoc/iso/presentation_bibdata.rb +74 -0
  30. data/lib/isodoc/iso/presentation_xml_convert.rb +52 -100
  31. data/lib/isodoc/iso/presentation_xref.rb +132 -0
  32. data/lib/isodoc/iso/sections.rb +3 -3
  33. data/lib/isodoc/iso/word_cleanup.rb +17 -0
  34. data/lib/isodoc/iso/word_convert.rb +32 -12
  35. data/lib/isodoc/iso/word_dis_cleanup.rb +235 -0
  36. data/lib/isodoc/iso/word_dis_convert.rb +122 -0
  37. data/lib/isodoc/iso/xref.rb +78 -29
  38. data/lib/metanorma/iso/base.rb +20 -1
  39. data/lib/metanorma/iso/biblio.rng +69 -42
  40. data/lib/metanorma/iso/boilerplate-fr.xml +4 -1
  41. data/lib/metanorma/iso/boilerplate-ru.xml +4 -3
  42. data/lib/metanorma/iso/boilerplate.xml +4 -3
  43. data/lib/metanorma/iso/cleanup.rb +29 -1
  44. data/lib/metanorma/iso/front.rb +31 -6
  45. data/lib/metanorma/iso/front_id.rb +2 -0
  46. data/lib/metanorma/iso/isodoc.rng +65 -0
  47. data/lib/metanorma/iso/isostandard.rng +30 -12
  48. data/lib/metanorma/iso/macros.rb +29 -0
  49. data/lib/metanorma/iso/version.rb +1 -1
  50. data/lib/metanorma-iso.rb +1 -0
  51. data/lib/relaton/render/config.yml +4 -0
  52. data/lib/relaton/render/general.rb +13 -0
  53. data/metanorma-iso.gemspec +1 -1
  54. data/spec/isodoc/amd_spec.rb +35 -60
  55. data/spec/isodoc/blocks_spec.rb +783 -179
  56. data/spec/isodoc/i18n_spec.rb +331 -100
  57. data/spec/isodoc/inline_spec.rb +35 -42
  58. data/spec/isodoc/iso_spec.rb +51 -170
  59. data/spec/isodoc/metadata_spec.rb +240 -99
  60. data/spec/isodoc/postproc_spec.rb +68 -7
  61. data/spec/isodoc/ref_spec.rb +66 -69
  62. data/spec/isodoc/section_spec.rb +88 -80
  63. data/spec/isodoc/table_spec.rb +2 -2
  64. data/spec/isodoc/terms_spec.rb +2 -2
  65. data/spec/isodoc/word_dis_spec.rb +1886 -0
  66. data/spec/isodoc/xref_spec.rb +138 -64
  67. data/spec/metanorma/amd_spec.rb +53 -1
  68. data/spec/metanorma/base_spec.rb +195 -20
  69. data/spec/metanorma/blocks_spec.rb +54 -0
  70. data/spec/metanorma/lists_spec.rb +2 -2
  71. data/spec/metanorma/section_spec.rb +2 -2
  72. data/spec/spec_helper.rb +23 -4
  73. data/spec/vcr_cassettes/withdrawn_iso.yml +25 -25
  74. metadata +15 -10
  75. data/docs/asciiiso-syntax.adoc +0 -307
  76. data/docs/guidance.adoc +0 -487
  77. data/docs/navigation.adoc +0 -23
  78. data/docs/quickstart.adoc +0 -179
  79. data/spec/vcr_cassettes/docrels.yml +0 -385
@@ -128,7 +128,7 @@ RSpec.describe IsoDoc do
128
128
  <annex id="annex1" displayorder="5">
129
129
  <title>
130
130
  <strong>Annex A</strong>
131
- <br/>(informative)</title>
131
+ <br/><span class="obligation">(informative)</span></title>
132
132
  <clause id="annex1a" inline-header="true">
133
133
  <title>A.1</title>
134
134
  <note id="AN">
@@ -252,21 +252,21 @@ RSpec.describe IsoDoc do
252
252
  <title>Foreword</title>
253
253
  <p id='A'>
254
254
  This is a preamble
255
- <xref target='C'>0.1</xref>
256
- <xref target='C1'>0.2</xref>
257
- <xref target='D'>Scope</xref>
255
+ <xref target='C'><span class='citesec'>0.1</span></xref>
256
+ <xref target='C1'><span class='citesec'>0.2</span></xref>
257
+ <xref target='D'><span class='citesec'>Scope</span></xref>
258
258
  <xref target='H'>[H]</xref>
259
259
  <xref target='I'>[I]</xref>
260
260
  <xref target='J'>[J]</xref>
261
261
  <xref target='K'>[K]</xref>
262
262
  <xref target='L'>[L]</xref>
263
- <xref target='M'>Clause 4</xref>
264
- <xref target='N'>Introduction</xref>
265
- <xref target='O'>Clause 4.2</xref>
266
- <xref target='P'>Annex A</xref>
267
- <xref target='Q'>A.1</xref>
268
- <xref target='Q1'>A.1.1</xref>
269
- <xref target='Q2'>Annex A, Appendix 1</xref>
263
+ <xref target='M'><span class='citesec'>Clause 4</span></xref>
264
+ <xref target='N'><span class='citesec'>Introduction</span></xref>
265
+ <xref target='O'><span class='citesec'>Clause 4.2</span></xref>
266
+ <xref target='P'><span class='citeapp'>Annex A</span></xref>
267
+ <xref target='Q'><span class='citeapp'>A.1</span></xref>
268
+ <xref target='Q1'><span class='citeapp'>A.1.1</span></xref>
269
+ <xref target='Q2'><span class='citeapp'>Annex A, Appendix 1</span></xref>
270
270
  <xref target='R'>[R]</xref>
271
271
  </p>
272
272
  </foreword>
@@ -297,7 +297,7 @@ RSpec.describe IsoDoc do
297
297
  <title>
298
298
  <strong>Annex A</strong>
299
299
  <br/>
300
- (normative)
300
+ <span class="obligation">(normative)</span>
301
301
  <br/>
302
302
  <br/>
303
303
  <strong>Annex</strong>
@@ -503,7 +503,7 @@ RSpec.describe IsoDoc do
503
503
  </clause>
504
504
  </sections>
505
505
  <annex id="P" inline-header="false" obligation="normative" displayorder="10">
506
- <title><strong>Annex A</strong><br/>(normative)<br/><br/><strong>Annex</strong></title>
506
+ <title><strong>Annex A</strong><br/><span class="obligation">(normative)</span><br/><br/><strong>Annex</strong></title>
507
507
  <clause id="Q" inline-header="false" obligation="normative">
508
508
  <title depth="2">A.1<tab/>Annex A.1</title>
509
509
  <clause id="Q1" inline-header="false" obligation="normative">
@@ -511,7 +511,8 @@ RSpec.describe IsoDoc do
511
511
  </clause>
512
512
  </clause>
513
513
  </annex>
514
- <annex id="P1" inline-header="false" obligation="normative" displayorder="11"><title><strong>Annex B</strong><br/>(normative)</title></annex>
514
+ <annex id="P1" inline-header="false" obligation="normative" displayorder="11">
515
+ <title><strong>Annex B</strong><br/><span class="obligation">(normative)</span></title></annex>
515
516
  <bibliography>
516
517
  <references id="R" normative="true" obligation="informative" displayorder="7">
517
518
  <title depth="1">Normative References</title>
@@ -744,32 +745,28 @@ RSpec.describe IsoDoc do
744
745
  </iso-standard>
745
746
  INPUT
746
747
  output = <<~OUTPUT
747
- {:accesseddate=>"XXX",
748
- :agency=>"ISO",
749
- :circulateddate=>"XXX",
750
- :confirmeddate=>"XXX",
751
- :copieddate=>"XXX",
748
+ {:agency=>"ISO",
752
749
  :createddate=>"2016-05-01",
753
750
  :docnumber=>"ISO/PreNWIP3 17301-1:2016/Amd.1",
754
751
  :docnumber_lang=>"ISO/PreNWIP3 17301-1:2016/Amd.1(E)",
755
752
  :docnumber_reference=>"ISO/PreNWIP3 17301-1:2016/Amd.1:2017(E)",
756
753
  :docnumeric=>"17301",
757
- :docsubtitle=>"Introduction Fran&#xe7;aise&nbsp;&mdash; Titre Principal&nbsp;&mdash; Partie&nbsp;1: Part du Titre",
754
+ :docsubtitle=>"Introduction Fran&#xe7;aise&#xa0;&#x2014; Titre Principal&#xa0;&#x2014; Partie&#xa0;1: Part du Titre",
758
755
  :docsubtitleamd=>"Fraction massique de mati&#xe8;re &#xe9;trang&#xe8;re, riz usin&#xe9; (non gluant), diviseurs d&#x2019;&#xe9;chantillon et recommandations relatives aux conditions d&#x2019;entreposage et de transport",
759
- :docsubtitleamdlabel=>"AMENDMENT&nbsp;1",
760
- :docsubtitlecorrlabel=>"RECTIFICATIF TECHNIQUE&nbsp;2",
756
+ :docsubtitleamdlabel=>"AMENDMENT&#xa0;1",
757
+ :docsubtitlecorrlabel=>"RECTIFICATIF TECHNIQUE&#xa0;2",
761
758
  :docsubtitleintro=>"Introduction Fran&#xe7;aise",
762
759
  :docsubtitlemain=>"Titre Principal",
763
760
  :docsubtitlepart=>"Part du Titre",
764
- :docsubtitlepartlabel=>"Partie&nbsp;1",
765
- :doctitle=>"Introduction&nbsp;&mdash; Main Title&#x2009;&#x2014;&#x2009;Title&nbsp;&mdash; Part&nbsp;1: Title Part",
761
+ :docsubtitlepartlabel=>"Partie&#xa0;1",
762
+ :doctitle=>"Introduction&#xa0;&#x2014; Main Title&#x2009;&#x2014;&#x2009;Title&#xa0;&#x2014; Part&#xa0;1: Title Part",
766
763
  :doctitleamd=>"Mass fraction of extraneous matter, milled rice (nonglutinous), sample dividers and recommendations relating to storage and transport conditions",
767
- :doctitleamdlabel=>"AMENDMENT&nbsp;1",
768
- :doctitlecorrlabel=>"TECHNICAL CORRIGENDUM&nbsp;2",
764
+ :doctitleamdlabel=>"AMENDMENT&#xa0;1",
765
+ :doctitlecorrlabel=>"TECHNICAL CORRIGENDUM&#xa0;2",
769
766
  :doctitleintro=>"Introduction",
770
767
  :doctitlemain=>"Main Title&#x2009;&#x2014;&#x2009;Title",
771
768
  :doctitlepart=>"Title Part",
772
- :doctitlepartlabel=>"Part&nbsp;1",
769
+ :doctitlepartlabel=>"Part&#xa0;1",
773
770
  :doctype=>"Amendment",
774
771
  :doctype_display=>"Amendment",
775
772
  :docyear=>"2017",
@@ -778,13 +775,8 @@ RSpec.describe IsoDoc do
778
775
  :edition=>"2",
779
776
  :editorialgroup=>["A 1", "B 2", "C 3"],
780
777
  :ics=>"1, 2, 3",
781
- :implementeddate=>"XXX",
782
- :issueddate=>"XXX",
783
778
  :lang=>"en",
784
- :obsoleteddate=>"XXX",
785
- :publisheddate=>"XXX",
786
779
  :publisher=>"International Organization for Standardization",
787
- :receiveddate=>"XXX",
788
780
  :revdate=>"2000-01-01",
789
781
  :revdate_monthyear=>"January 2000",
790
782
  :sc=>"B 2",
@@ -794,13 +786,9 @@ RSpec.describe IsoDoc do
794
786
  :stage_int=>10,
795
787
  :stageabbr=>"NWIP",
796
788
  :statusabbr=>"PreNWIP3",
789
+ :substage_int=>"20",
797
790
  :tc=>"A 1",
798
- :transmitteddate=>"XXX",
799
- :unchangeddate=>"XXX",
800
791
  :unpublished=>true,
801
- :updateddate=>"XXX",
802
- :vote_endeddate=>"XXX",
803
- :vote_starteddate=>"XXX",
804
792
  :wg=>"C 3"}
805
793
  OUTPUT
806
794
  expect(metadata(c.info(Nokogiri::XML(input), nil)))
@@ -909,32 +897,28 @@ RSpec.describe IsoDoc do
909
897
  </iso-standard>
910
898
  INPUT
911
899
  output = <<~OUTPUT
912
- {:accesseddate=>"XXX",
913
- :agency=>"ISO",
914
- :circulateddate=>"XXX",
915
- :confirmeddate=>"XXX",
916
- :copieddate=>"XXX",
900
+ {:agency=>"ISO",
917
901
  :createddate=>"2016-05-01",
918
902
  :docnumber=>"ISO/PreNWIP3 17301-1:2016/Amd.1",
919
903
  :docnumber_lang=>"ISO/PreNWIP3 17301-1:2016/Amd.1(E)",
920
904
  :docnumber_reference=>"ISO/PreNWIP3 17301-1:2016/Amd.1:2017(E)",
921
905
  :docnumeric=>"17301",
922
- :docsubtitle=>"Introduction&nbsp;&mdash; Main Title&#x2009;&#x2014;&#x2009;Title&nbsp;&mdash; Part&nbsp;1: Title Part",
906
+ :docsubtitle=>"Introduction&#xa0;&#x2014; Main Title&#x2009;&#x2014;&#x2009;Title&#xa0;&#x2014; Part&#xa0;1: Title Part",
923
907
  :docsubtitleamd=>"Mass fraction of extraneous matter, milled rice (nonglutinous), sample dividers and recommendations relating to storage and transport conditions",
924
- :docsubtitleamdlabel=>"AMENDMENT&nbsp;1",
925
- :docsubtitlecorrlabel=>"TECHNICAL CORRIGENDUM&nbsp;2",
908
+ :docsubtitleamdlabel=>"AMENDMENT&#xa0;1",
909
+ :docsubtitlecorrlabel=>"TECHNICAL CORRIGENDUM&#xa0;2",
926
910
  :docsubtitleintro=>"Introduction",
927
911
  :docsubtitlemain=>"Main Title&#x2009;&#x2014;&#x2009;Title",
928
912
  :docsubtitlepart=>"Title Part",
929
- :docsubtitlepartlabel=>"Part&nbsp;1",
930
- :doctitle=>"Introduction Fran&#xe7;aise&nbsp;&mdash; Titre Principal&nbsp;&mdash; Partie&nbsp;1: Part du Titre",
913
+ :docsubtitlepartlabel=>"Part&#xa0;1",
914
+ :doctitle=>"Introduction Fran&#xe7;aise&#xa0;&#x2014; Titre Principal&#xa0;&#x2014; Partie&#xa0;1: Part du Titre",
931
915
  :doctitleamd=>"Fraction massique de mati&#xe8;re &#xe9;trang&#xe8;re, riz usin&#xe9; (non gluant), diviseurs d&#x2019;&#xe9;chantillon et recommandations relatives aux conditions d&#x2019;entreposage et de transport",
932
- :doctitleamdlabel=>"AMENDMENT&nbsp;1",
933
- :doctitlecorrlabel=>"RECTIFICATIF TECHNIQUE&nbsp;2",
916
+ :doctitleamdlabel=>"AMENDMENT&#xa0;1",
917
+ :doctitlecorrlabel=>"RECTIFICATIF TECHNIQUE&#xa0;2",
934
918
  :doctitleintro=>"Introduction Fran&#xe7;aise",
935
919
  :doctitlemain=>"Titre Principal",
936
920
  :doctitlepart=>"Part du Titre",
937
- :doctitlepartlabel=>"Partie&nbsp;1",
921
+ :doctitlepartlabel=>"Partie&#xa0;1",
938
922
  :doctype=>"Amendment",
939
923
  :doctype_display=>"Amendment",
940
924
  :docyear=>"2017",
@@ -943,13 +927,8 @@ RSpec.describe IsoDoc do
943
927
  :edition=>"2",
944
928
  :editorialgroup=>["A 1", "B 2", "C 3"],
945
929
  :ics=>"1, 2, 3",
946
- :implementeddate=>"XXX",
947
- :issueddate=>"XXX",
948
930
  :lang=>"fr",
949
- :obsoleteddate=>"XXX",
950
- :publisheddate=>"XXX",
951
931
  :publisher=>"International Organization for Standardization",
952
- :receiveddate=>"XXX",
953
932
  :revdate=>"2000-01-01",
954
933
  :revdate_monthyear=>"Janvier 2000",
955
934
  :sc=>"B 2",
@@ -959,13 +938,9 @@ RSpec.describe IsoDoc do
959
938
  :stage_int=>10,
960
939
  :stageabbr=>"NWIP",
961
940
  :statusabbr=>"PreNWIP3",
941
+ :substage_int=>"20",
962
942
  :tc=>"A 1",
963
- :transmitteddate=>"XXX",
964
- :unchangeddate=>"XXX",
965
943
  :unpublished=>true,
966
- :updateddate=>"XXX",
967
- :vote_endeddate=>"XXX",
968
- :vote_starteddate=>"XXX",
969
944
  :wg=>"C 3"}
970
945
  OUTPUT
971
946
  expect(metadata(c.info(Nokogiri::XML(input), nil)))