metanorma-iso 2.0.7 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/lib/asciidoctor/iso/base.rb +0 -1
  3. data/lib/asciidoctor/iso/cleanup.rb +0 -1
  4. data/lib/asciidoctor/iso/converter.rb +0 -1
  5. data/lib/asciidoctor/iso/deprecated.rb +4 -2
  6. data/lib/asciidoctor/iso/front.rb +0 -1
  7. data/lib/asciidoctor/iso/front_id.rb +0 -1
  8. data/lib/asciidoctor/iso/section.rb +0 -1
  9. data/lib/asciidoctor/iso/validate.rb +0 -1
  10. data/lib/asciidoctor/iso/validate_image.rb +0 -1
  11. data/lib/asciidoctor/iso/validate_requirements.rb +0 -1
  12. data/lib/asciidoctor/iso/validate_section.rb +0 -1
  13. data/lib/asciidoctor/iso/validate_style.rb +0 -1
  14. data/lib/asciidoctor/iso/validate_title.rb +0 -1
  15. data/lib/html2doc/lists.rb +37 -0
  16. data/lib/isodoc/iso/html/html_iso_titlepage.html +7 -2
  17. data/lib/isodoc/iso/html/isodoc-dis.css +196 -156
  18. data/lib/isodoc/iso/html/isodoc-dis.scss +193 -156
  19. data/lib/isodoc/iso/html/word_iso_intro-dis.html +7 -0
  20. data/lib/isodoc/iso/html/word_iso_titlepage-dis.html +3 -2
  21. data/lib/isodoc/iso/html/word_iso_titlepage.html +8 -2
  22. data/lib/isodoc/iso/html/wordstyle-dis.css +204 -34
  23. data/lib/isodoc/iso/html/wordstyle-dis.scss +198 -34
  24. data/lib/isodoc/iso/i18n-en.yaml +2 -1
  25. data/lib/isodoc/iso/i18n-fr.yaml +1 -0
  26. data/lib/isodoc/iso/i18n-ru.yaml +1 -0
  27. data/lib/isodoc/iso/i18n-zh-Hans.yaml +1 -0
  28. data/lib/isodoc/iso/index.rb +1 -1
  29. data/lib/isodoc/iso/init.rb +17 -1
  30. data/lib/isodoc/iso/iso.amendment.xsl +726 -299
  31. data/lib/isodoc/iso/iso.international-standard.xsl +726 -299
  32. data/lib/isodoc/iso/metadata.rb +75 -63
  33. data/lib/isodoc/iso/presentation_inline.rb +90 -0
  34. data/lib/isodoc/iso/presentation_xml_convert.rb +39 -100
  35. data/lib/isodoc/iso/presentation_xref.rb +126 -0
  36. data/lib/isodoc/iso/word_cleanup.rb +16 -2
  37. data/lib/isodoc/iso/word_convert.rb +27 -10
  38. data/lib/isodoc/iso/word_dis_convert.rb +174 -0
  39. data/lib/isodoc/iso/xref.rb +50 -30
  40. data/lib/metanorma/iso/biblio.rng +62 -10
  41. data/lib/metanorma/iso/boilerplate-fr.xml +1 -1
  42. data/lib/metanorma/iso/boilerplate-ru.xml +1 -3
  43. data/lib/metanorma/iso/boilerplate.xml +1 -3
  44. data/lib/metanorma/iso/cleanup.rb +7 -6
  45. data/lib/metanorma/iso/front_id.rb +28 -11
  46. data/lib/metanorma/iso/isodoc.rng +56 -0
  47. data/lib/metanorma/iso/version.rb +1 -1
  48. data/lib/metanorma-iso.rb +1 -0
  49. data/lib/relaton/render/config.yml +4 -0
  50. data/lib/relaton/render/general.rb +13 -0
  51. data/metanorma-iso.gemspec +1 -1
  52. data/spec/isodoc/amd_spec.rb +15 -14
  53. data/spec/isodoc/blocks_spec.rb +286 -179
  54. data/spec/isodoc/i18n_spec.rb +296 -133
  55. data/spec/isodoc/inline_spec.rb +35 -42
  56. data/spec/isodoc/iso_spec.rb +43 -27
  57. data/spec/isodoc/postproc_spec.rb +25 -0
  58. data/spec/isodoc/ref_spec.rb +66 -69
  59. data/spec/isodoc/section_spec.rb +78 -76
  60. data/spec/isodoc/table_spec.rb +2 -2
  61. data/spec/isodoc/terms_spec.rb +2 -2
  62. data/spec/isodoc/word_dis_spec.rb +760 -0
  63. data/spec/isodoc/xref_spec.rb +51 -51
  64. data/spec/metanorma/amd_spec.rb +39 -16
  65. data/spec/metanorma/base_spec.rb +17 -9
  66. data/spec/metanorma/blocks_spec.rb +4 -4
  67. data/spec/metanorma/cleanup_spec.rb +11 -11
  68. data/spec/metanorma/section_spec.rb +3 -3
  69. data/spec/spec_helper.rb +5 -2
  70. data/spec/vcr_cassettes/withdrawn_iso.yml +26 -26
  71. metadata +11 -5
  72. data/spec/vcr_cassettes/docrels.yml +0 -385
@@ -137,7 +137,7 @@ RSpec.describe IsoDoc do
137
137
  </clause>
138
138
  </sections>
139
139
  <annex id="P" inline-header="false" obligation="normative" displayorder="8">
140
- <title><strong>Annex A</strong><br/>(normative)<br/><br/><strong>Annex</strong></title>
140
+ <title><strong>Annex A</strong><br/><span class='obligation'>(normative)</span><br/><br/><strong>Annex</strong></title>
141
141
  <clause id="Q" inline-header="false" obligation="normative">
142
142
  <title depth="2">A.1<tab/>Annex A.1</title>
143
143
  <clause id="Q1" inline-header="false" obligation="normative">
@@ -369,7 +369,7 @@ RSpec.describe IsoDoc do
369
369
  </p>
370
370
  <div class="Section3" id="P">
371
371
  <h1 class="Annex">
372
- <br/>(normative)
372
+ <br/><span style='font-weight:normal;'>(normative)</span>
373
373
  <br/>
374
374
  <br/>
375
375
  <b>Annex</b></h1>
@@ -563,81 +563,81 @@ RSpec.describe IsoDoc do
563
563
  <status>
564
564
  <stage abbreviation='IS' language=''>60</stage>
565
565
  <stage abbreviation='IS' language='en'>International standard</stage>
566
- <substage language=''>60</substage>
566
+ <substage>60</substage>
567
567
  </status>
568
- <copyright>
569
- <from>#{Time.new.year}</from>
570
- <owner>
571
- <organization>
572
- <name>International Organization for Standardization</name>
573
- <abbreviation>ISO</abbreviation>
574
- </organization>
575
- </owner>
576
- </copyright>
577
- <ext>
578
- <doctype language=''>article</doctype>
579
- <subdoctype>vocabulary</subdoctype>
580
- <editorialgroup>
581
- <technical-committee/>
582
- <subcommittee/>
583
- <workgroup/>
584
- </editorialgroup>
585
- <stagename>International standard</stagename>
586
- </ext>
587
- </bibdata>
588
- <sections>
589
- <terms id='A' obligation='normative' displayorder='1'>
590
- <title depth='1'>
591
- 1
592
- <tab/>
593
- Terms and definitions
594
- </title>
595
- <p id='A1'>No terms and definitions are listed in this document.</p>
596
- </terms>
597
- <clause id='B' inline-header='false' obligation='normative' displayorder='2'>
598
- <title depth='1'>
599
- 2
600
- <tab/>
601
- Clause
602
- </title>
603
- </clause>
604
- <terms id='C' obligation='normative' displayorder='3'>
605
- <title depth='1'>
606
- 3
607
- <tab/>
608
- More terms
609
- </title>
610
- </terms>
611
- </sections>
612
- </iso-standard>
568
+ <copyright>
569
+ <from>#{Time.new.year}</from>
570
+ <owner>
571
+ <organization>
572
+ <name>International Organization for Standardization</name>
573
+ <abbreviation>ISO</abbreviation>
574
+ </organization>
575
+ </owner>
576
+ </copyright>
577
+ <ext>
578
+ <doctype>article</doctype>
579
+ <subdoctype>vocabulary</subdoctype>
580
+ <editorialgroup>
581
+ <technical-committee/>
582
+ <subcommittee/>
583
+ <workgroup/>
584
+ </editorialgroup>
585
+ <stagename>International standard</stagename>
586
+ </ext>
587
+ </bibdata>
588
+ <sections>
589
+ <terms id='A' obligation='normative' displayorder='1'>
590
+ <title depth='1'>
591
+ 1
592
+ <tab/>
593
+ Terms and definitions
594
+ </title>
595
+ <p id='A1'>No terms and definitions are listed in this document.</p>
596
+ </terms>
597
+ <clause id='B' inline-header='false' obligation='normative' displayorder='2'>
598
+ <title depth='1'>
599
+ 2
600
+ <tab/>
601
+ Clause
602
+ </title>
603
+ </clause>
604
+ <terms id='C' obligation='normative' displayorder='3'>
605
+ <title depth='1'>
606
+ 3
607
+ <tab/>
608
+ More terms
609
+ </title>
610
+ </terms>
611
+ </sections>
612
+ </iso-standard>
613
613
  OUTPUT
614
614
  output = <<~OUTPUT
615
- <html lang='en'>
616
- <head/>
617
- <body lang='en'>
618
- <div class='title-section'>
619
- <p>&#160;</p>
620
- </div>
621
- <br/>
622
- <div class='prefatory-section'>
623
- <p>&#160;</p>
624
- </div>
625
- <br/>
626
- <div class='main-section'>
627
- <p class='zzSTDTitle1'/>
628
- <div id='A'>
629
- <h1> 1 &#160; Terms and definitions </h1>
630
- <p id='A1'>No terms and definitions are listed in this document.</p>
631
- </div>
632
- <div id='B'>
633
- <h1> 2 &#160; Clause </h1>
634
- </div>
635
- <div id='C'>
636
- <h1> 3 &#160; More terms </h1>
637
- </div>
638
- </div>
639
- </body>
640
- </html>
615
+ <html lang='en'>
616
+ <head/>
617
+ <body lang='en'>
618
+ <div class='title-section'>
619
+ <p>&#160;</p>
620
+ </div>
621
+ <br/>
622
+ <div class='prefatory-section'>
623
+ <p>&#160;</p>
624
+ </div>
625
+ <br/>
626
+ <div class='main-section'>
627
+ <p class='zzSTDTitle1'/>
628
+ <div id='A'>
629
+ <h1> 1 &#160; Terms and definitions </h1>
630
+ <p id='A1'>No terms and definitions are listed in this document.</p>
631
+ </div>
632
+ <div id='B'>
633
+ <h1> 2 &#160; Clause </h1>
634
+ </div>
635
+ <div id='C'>
636
+ <h1> 3 &#160; More terms </h1>
637
+ </div>
638
+ </div>
639
+ </body>
640
+ </html>
641
641
  OUTPUT
642
642
  expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
643
643
  .convert("test", input, true)
@@ -695,7 +695,8 @@ RSpec.describe IsoDoc do
695
695
  <sections/>
696
696
  </iso-standard>
697
697
  INPUT
698
- expect(xmlpp(output.sub(/^.*<body /m, "<body ").sub(%r{</body>.*$}m, "</body>")))
698
+ expect(xmlpp(output.sub(/^.*<body /m, "<body ").sub(%r{</body>.*$}m,
699
+ "</body>")))
699
700
  .to be_equivalent_to xmlpp(<<~"OUTPUT")
700
701
  <body lang="EN-US" link="blue" vlink="#954F72">
701
702
  <div class="WordSection1">
@@ -726,7 +727,8 @@ RSpec.describe IsoDoc do
726
727
  <sections/>
727
728
  </iso-standard>
728
729
  INPUT
729
- expect(xmlpp(output.sub(/^.*<body /m, "<body ").sub(%r{</body>.*$}m, "</body>")))
730
+ expect(xmlpp(output.sub(/^.*<body /m, "<body ").sub(%r{</body>.*$}m,
731
+ "</body>")))
730
732
  .to be_equivalent_to xmlpp(<<~"OUTPUT")
731
733
  <body lang="EN-US" link="blue" vlink="#954F72">
732
734
  <div class="WordSection1">
@@ -154,7 +154,7 @@ RSpec.describe IsoDoc do
154
154
  <title>
155
155
  <strong>Annex A</strong>
156
156
  <br/>
157
- (informative)
157
+ <span class="obligation">(informative)</span>
158
158
  <br/>
159
159
  <br/>
160
160
  <strong>Annex</strong>
@@ -382,7 +382,7 @@ RSpec.describe IsoDoc do
382
382
  <a name='Annex' id='Annex'/>
383
383
  <p class='ANNEX'>
384
384
  <br/>
385
- (informative)
385
+ <span style='font-weight:normal;'>(informative)</span>
386
386
  <br/>
387
387
  <br/>
388
388
  <b>Annex</b>
@@ -90,7 +90,7 @@ RSpec.describe IsoDoc do
90
90
  </ul>
91
91
  </termexample>
92
92
  <termsource status='modified'>[SOURCE:
93
- <origin bibitemid='ISO7301' type='inline' citeas='ISO 7301:2011'><locality type='clause'><referenceFrom>3.1</referenceFrom></locality>ISO 7301:2011, 3.1</origin>, modified &#x2013; The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here]
93
+ <origin bibitemid='ISO7301' type='inline' citeas='ISO 7301:2011'><locality type='clause'><referenceFrom>3.1</referenceFrom></locality><span class='stdpublisher'>ISO</span> <span class='stddocNumber'>7301</span>:<span class='stdyear'>2011</span>, <span class='citesec'>3.1</span></origin>, modified &#x2013; The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here]
94
94
  </termsource>
95
95
  </term>
96
96
  <term id='paddy'><name>1.2</name>
@@ -121,7 +121,7 @@ RSpec.describe IsoDoc do
121
121
  </ul>
122
122
  </termexample>
123
123
  <termsource status='identical'>[SOURCE:
124
- <origin bibitemid='ISO7301' type='inline' citeas='ISO 7301:2011'><locality type='clause'><referenceFrom>3.1</referenceFrom></locality>ISO 7301:2011, 3.1</origin>]
124
+ <origin bibitemid='ISO7301' type='inline' citeas='ISO 7301:2011'><locality type='clause'><referenceFrom>3.1</referenceFrom></locality><span class='stdpublisher'>ISO</span> <span class='stddocNumber'>7301</span>:<span class='stdyear'>2011</span>, <span class='citesec'>3.1</span></origin>]
125
125
  </termsource>
126
126
  </term>
127
127
  <term id='A'>