isodoc 1.0.24 → 1.0.29

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/macos.yml +14 -4
  3. data/.github/workflows/ubuntu.yml +19 -5
  4. data/.github/workflows/windows.yml +14 -4
  5. data/isodoc.gemspec +1 -1
  6. data/lib/isodoc-yaml/i18n-en.yaml +3 -1
  7. data/lib/isodoc-yaml/i18n-fr.yaml +3 -1
  8. data/lib/isodoc-yaml/i18n-zh-Hans.yaml +3 -1
  9. data/lib/isodoc/convert.rb +1 -0
  10. data/lib/isodoc/function/blocks.rb +43 -49
  11. data/lib/isodoc/function/{blocks_example.rb → blocks_example_note.rb} +57 -2
  12. data/lib/isodoc/function/cleanup.rb +16 -2
  13. data/lib/isodoc/function/i18n.rb +1 -0
  14. data/lib/isodoc/function/inline.rb +79 -77
  15. data/lib/isodoc/function/inline_simple.rb +72 -0
  16. data/lib/isodoc/function/lists.rb +12 -6
  17. data/lib/isodoc/function/references.rb +51 -39
  18. data/lib/isodoc/function/reqt.rb +13 -4
  19. data/lib/isodoc/function/section.rb +19 -8
  20. data/lib/isodoc/function/table.rb +3 -4
  21. data/lib/isodoc/function/terms.rb +1 -1
  22. data/lib/isodoc/function/to_word_html.rb +23 -13
  23. data/lib/isodoc/function/utils.rb +13 -6
  24. data/lib/isodoc/function/xref_counter.rb +43 -9
  25. data/lib/isodoc/function/xref_gen.rb +2 -1
  26. data/lib/isodoc/function/xref_gen_seq.rb +11 -10
  27. data/lib/isodoc/function/xref_sect_gen.rb +24 -24
  28. data/lib/isodoc/headlesshtml_convert.rb +5 -0
  29. data/lib/isodoc/html_convert.rb +5 -0
  30. data/lib/isodoc/html_function/footnotes.rb +3 -3
  31. data/lib/isodoc/html_function/html.rb +16 -1
  32. data/lib/isodoc/html_function/postprocess.rb +6 -5
  33. data/lib/isodoc/metadata.rb +10 -3
  34. data/lib/isodoc/metadata_date.rb +19 -7
  35. data/lib/isodoc/pdf_convert.rb +5 -0
  36. data/lib/isodoc/version.rb +1 -1
  37. data/lib/isodoc/word_convert.rb +5 -0
  38. data/lib/isodoc/word_function/body.rb +13 -51
  39. data/lib/isodoc/word_function/footnotes.rb +3 -3
  40. data/lib/isodoc/word_function/inline.rb +75 -0
  41. data/lib/isodoc/word_function/postprocess.rb +13 -2
  42. data/lib/isodoc/word_function/table.rb +3 -3
  43. data/lib/isodoc/xslfo_convert.rb +5 -0
  44. data/spec/assets/i18n.yaml +4 -1
  45. data/spec/assets/odf.emf +0 -0
  46. data/spec/assets/odf.svg +4 -0
  47. data/spec/assets/odf1.svg +4 -0
  48. data/spec/isodoc/blocks_spec.rb +274 -51
  49. data/spec/isodoc/cleanup_spec.rb +317 -25
  50. data/spec/isodoc/footnotes_spec.rb +20 -5
  51. data/spec/isodoc/i18n_spec.rb +12 -12
  52. data/spec/isodoc/inline_spec.rb +299 -4
  53. data/spec/isodoc/lists_spec.rb +8 -8
  54. data/spec/isodoc/metadata_spec.rb +112 -3
  55. data/spec/isodoc/postproc_spec.rb +39 -21
  56. data/spec/isodoc/ref_spec.rb +121 -52
  57. data/spec/isodoc/section_spec.rb +236 -207
  58. data/spec/isodoc/table_spec.rb +28 -28
  59. data/spec/isodoc/terms_spec.rb +57 -13
  60. data/spec/isodoc/xref_spec.rb +218 -71
  61. metadata +10 -5
@@ -70,6 +70,8 @@ RSpec.describe IsoDoc do
70
70
  <title>Acknowledgements</title>
71
71
  </acknowledgements>
72
72
  </preface><sections>
73
+ <note id="NN1"><p>Initial note</p></note>
74
+ <admonition id="NN2" type="warning"><p>Initial admonition</p></admonition>
73
75
  <clause id="D" obligation="normative">
74
76
  <title>Scope</title>
75
77
  <p id="E">Text</p>
@@ -112,16 +114,16 @@ RSpec.describe IsoDoc do
112
114
  <clause id="Q1" inline-header="false" obligation="normative">
113
115
  <title>Annex A.1a</title>
114
116
  </clause>
115
- <references id="Q2"><title>Annex Bibliography</title></references>
117
+ <references id="Q2" normative="false"><title>Annex Bibliography</title></references>
116
118
  </clause>
117
119
  </annex>
118
120
  <annex id="P1" inline-header="false" obligation="normative">
119
121
  </annex>
120
- <bibliography><references id="R" obligation="informative">
122
+ <bibliography><references id="R" obligation="informative" normative="true">
121
123
  <title>Normative References</title>
122
124
  </references><clause id="S" obligation="informative">
123
125
  <title>Bibliography</title>
124
- <references id="T" obligation="informative">
126
+ <references id="T" obligation="informative" normative="false">
125
127
  <title>Bibliography Subsection</title>
126
128
  </references>
127
129
  </clause>
@@ -181,6 +183,16 @@ RSpec.describe IsoDoc do
181
183
  <h1 class='IntroTitle'>Acknowledgements</h1>
182
184
  </div>
183
185
  <p class="zzSTDTitle1"/>
186
+ <div id='NN1' class='Note'>
187
+ <p>
188
+ <span class='note_label'>NOTE</span>
189
+ &#160; Initial note
190
+ </p>
191
+ </div>
192
+ <div id='NN2' class='Admonition'>
193
+ <p class='AdmonitionTitle' style='text-align:center;'>WARNING</p>
194
+ <p>Initial admonition</p>
195
+ </div>
184
196
  <div id="D">
185
197
  <h1>1.&#160; Scope</h1>
186
198
  <p id="E">Text</p>
@@ -188,7 +200,7 @@ RSpec.describe IsoDoc do
188
200
  <div>
189
201
  <h1>2.&#160; Normative references</h1>
190
202
  </div>
191
- <div id="H"><h1>3.&#160; Terms, definitions, symbols and abbreviated terms</h1>
203
+ <div id="H"><h1>3.&#160; Terms, Definitions, Symbols and Abbreviated Terms</h1>
192
204
  <div id="I">
193
205
  <h2>3.1.&#160; Normal Terms</h2>
194
206
  <p class="TermNum" id="J">3.1.1.</p>
@@ -342,11 +354,11 @@ OUTPUT
342
354
  </annex>
343
355
  <annex id="P1" inline-header="false" obligation="normative">
344
356
  </annex>
345
- <bibliography><references id="R" obligation="informative">
357
+ <bibliography><references id="R" obligation="informative" normative="true">
346
358
  <title>Normative References</title>
347
359
  </references><clause id="S" obligation="informative">
348
360
  <title>Bibliography</title>
349
- <references id="T" obligation="informative">
361
+ <references id="T" obligation="informative" normative="false">
350
362
  <title>Bibliography Subsection</title>
351
363
  </references>
352
364
  </clause>
@@ -429,7 +441,7 @@ OUTPUT
429
441
  <div>
430
442
  <h1>2.<span style="mso-tab-count:1">&#160; </span>Normative references</h1>
431
443
  </div>
432
- <div id="H"><h1>3.<span style="mso-tab-count:1">&#160; </span>Terms, definitions, symbols and abbreviated terms</h1>
444
+ <div id="H"><h1>3.<span style="mso-tab-count:1">&#160; </span>Terms, Definitions, Symbols and Abbreviated Terms</h1>
433
445
  <div id="I">
434
446
  <h2>3.1.<span style="mso-tab-count:1">&#160; </span>Normal Terms</h2>
435
447
  <p class="TermNum" id="J">3.1.1.</p>
@@ -579,210 +591,225 @@ OUTPUT
579
591
  <clause id="Q1" inline-header="false" obligation="normative">
580
592
  <title>Annex A.1a<fn reference="17"><p>A</p></fn></title>
581
593
  </clause>
582
- <references id="Q2"><title>Annex Bibliography<fn reference="18"><p>A</p></fn></title></references>
594
+ <references id="Q2" normative="false"><title>Annex Bibliography<fn reference="18"><p>A</p></fn></title></references>
583
595
  </clause>
584
- </annex><bibliography><references id="R" obligation="informative">
596
+ </annex><bibliography><references id="R" obligation="informative" normative="true">
585
597
  <title>Normative References<fn reference="19"><p>A</p></fn></title>
586
598
  </references><clause id="S" obligation="informative">
587
599
  <title>Bibliography<fn reference="20"><p>A</p></fn></title>
588
- <references id="T" obligation="informative">
600
+ <references id="T" obligation="informative" normative="false">
589
601
  <title>Bibliography Subsection<fn reference="21"><p>A</p></fn></title>
590
602
  </references>
591
603
  </clause>
592
604
  </bibliography>
593
605
  </iso-standard>
594
606
  INPUT
595
- <html xmlns:epub='http://www.idpf.org/2007/ops' lang='en'>
596
- <head/>
597
- <body lang='en'>
598
- <div class='title-section'>
599
- <p>&#160;</p>
600
- </div>
601
- <br/>
602
- <div class='prefatory-section'>
603
- <p>&#160;</p>
604
- </div>
605
- <br/>
606
- <div class='main-section'>
607
- <div class='authority'>
608
- <div class='boilerplate-copyright'>
609
- <div>
610
- <h1>
611
- Copyright
612
- <a rel='footnote' href='#fn:1' epub:type='footnote'>
613
- <sup>1</sup>
614
- </a>
615
- </h1>
616
- </div>
617
- </div>
618
- <div class='boilerplate-license'>
619
- <div>
620
- <h1>
621
- License
622
- <a rel='footnote' href='#fn:2' epub:type='footnote'>
623
- <sup>2</sup>
624
- </a>
625
- </h1>
626
- </div>
627
- </div>
628
- <div class='boilerplate-legal'>
629
- <div>
630
- <h1>
631
- Legal
632
- <a rel='footnote' href='#fn:3' epub:type='footnote'>
633
- <sup>3</sup>
634
- </a>
635
- </h1>
636
- </div>
637
- </div>
638
- <div class='boilerplate-feedback'>
639
- <div>
640
- <h1>
641
- Feedback
642
- <a rel='footnote' href='#fn:4' epub:type='footnote'>
643
- <sup>4</sup>
644
- </a>
645
- </h1>
646
- </div>
647
- </div>
648
- </div>
649
- <br/>
650
- <div>
651
- <h1 class='AbstractTitle'>Abstract</h1>
652
- </div>
653
- <br/>
654
- <div>
655
- <h1 class='ForewordTitle'>Foreword</h1>
656
- <p id='A'>This is a preamble</p>
657
- </div>
658
- <br/>
659
- <div class='Section3' id='B'>
660
- <h1 class='IntroTitle'>Introduction</h1>
661
- <div id='C'>
662
- <h2>
663
- Introduction Subsection
664
- <a rel='footnote' href='#fn:8' epub:type='footnote'>
665
- <sup>8</sup>
666
- </a>
667
- </h2>
668
- </div>
669
- </div>
670
- <p class='zzSTDTitle1'/>
671
- <div id='H'>
672
- <h1>1.&#160; Terms, definitions, symbols and abbreviated terms</h1>
673
- <div id='I'>
674
- <h2>
675
- 1.1.&#160; Normal Terms
676
- <a rel='footnote' href='#fn:11' epub:type='footnote'>
677
- <sup>11</sup>
678
- </a>
679
- </h2>
680
- <p class='TermNum' id='J'>1.1.1.</p>
681
- <p class='Terms' style='text-align:left;'>Term2</p>
682
- </div>
683
- <div id='K'>
684
- <h2>
685
- 1.2.&#160; Definitions
686
- <a rel='footnote' href='#fn:12' epub:type='footnote'>
687
- <sup>12</sup>
688
- </a>
689
- </h2>
690
- <dl>
691
- <dt>
692
- <p>Symbol</p>
693
- </dt>
694
- <dd>Definition</dd>
695
- </dl>
696
- </div>
697
- </div>
698
- <div id='L' class='Symbols'>
699
- <h1>2.&#160; Symbols and abbreviated terms</h1>
700
- <dl>
701
- <dt>
702
- <p>Symbol</p>
703
- </dt>
704
- <dd>Definition</dd>
705
- </dl>
706
- </div>
707
- <div id='D'>
708
- <h1>
709
- 3.&#160; Scope
710
- <a rel='footnote' href='#fn:9' epub:type='footnote'>
711
- <sup>9</sup>
712
- </a>
713
- </h1>
714
- <p id='E'>Text</p>
715
- </div>
716
- <div id='M'>
717
- <h1>
718
- 4.&#160; Clause 4
719
- <a rel='footnote' href='#fn:13' epub:type='footnote'>
720
- <sup>13</sup>
721
- </a>
722
- </h1>
723
- <div id='N'>
724
- <h2>
725
- 4.1.&#160; Introduction
726
- <a rel='footnote' href='#fn:1' epub:type='footnote'>
727
- <sup>1</sup>
728
- </a>
729
- </h2>
730
- </div>
731
- <div id='O'>
732
- <h2>
733
- 4.2.&#160; Clause 4.2
734
- <a rel='footnote' href='#fn:14' epub:type='footnote'>
735
- <sup>14</sup>
736
- </a>
737
- </h2>
738
- </div>
739
- <div id='O1'>
740
- <h2>4.3.&#160; </h2>
741
- </div>
742
- </div>
743
- <br/>
744
- <div id='P' class='Section3'>
745
- <h1 class='Annex'>
746
- <b>Annex A</b>
747
- <br/>
748
- (normative)
749
- <br/>
750
- <br/>
751
- <b>
752
- Annex
753
- <a rel='footnote' href='#fn:15' epub:type='footnote'>
754
- <sup>15</sup>
755
- </a>
756
- </b>
757
- </h1>
758
- <div id='Q'>
759
- <h2>
760
- A.1.&#160; Annex A.1
761
- <a rel='footnote' href='#fn:16' epub:type='footnote'>
762
- <sup>16</sup>
763
- </a>
764
- </h2>
765
- <div id='Q1'>
766
- <h3>
767
- A.1.1.&#160; Annex A.1a
768
- <a rel='footnote' href='#fn:17' epub:type='footnote'>
769
- <sup>17</sup>
770
- </a>
771
- </h3>
772
- </div>
773
- <div>
774
- <h3>
775
- A.1.2.&#160; Annex Bibliography
776
- <a rel='footnote' href='#fn:18' epub:type='footnote'>
777
- <sup>18</sup>
778
- </a>
779
- </h3>
780
- </div>
781
- </div>
782
- </div>
783
- </div>
784
- </body>
785
- </html>
607
+ <html xmlns:epub='http://www.idpf.org/2007/ops' lang='en'>
608
+ <head/>
609
+ <body lang='en'>
610
+ <div class='title-section'>
611
+ <p>&#160;</p>
612
+ </div>
613
+ <br/>
614
+ <div class='prefatory-section'>
615
+ <p>&#160;</p>
616
+ </div>
617
+ <br/>
618
+ <div class='main-section'>
619
+ <div class='authority'>
620
+ <div class='boilerplate-copyright'>
621
+ <div>
622
+ <h1>
623
+ Copyright
624
+ <a class='FootnoteRef' href='#fn:1'>
625
+ <sup>1</sup>
626
+ </a>
627
+ </h1>
628
+ </div>
629
+ </div>
630
+ <div class='boilerplate-license'>
631
+ <div>
632
+ <h1>
633
+ License
634
+ <a class='FootnoteRef' href='#fn:2'>
635
+ <sup>2</sup>
636
+ </a>
637
+ </h1>
638
+ </div>
639
+ </div>
640
+ <div class='boilerplate-legal'>
641
+ <div>
642
+ <h1>
643
+ Legal
644
+ <a class='FootnoteRef' href='#fn:3'>
645
+ <sup>3</sup>
646
+ </a>
647
+ </h1>
648
+ </div>
649
+ </div>
650
+ <div class='boilerplate-feedback'>
651
+ <div>
652
+ <h1>
653
+ Feedback
654
+ <a class='FootnoteRef' href='#fn:4'>
655
+ <sup>4</sup>
656
+ </a>
657
+ </h1>
658
+ </div>
659
+ </div>
660
+ </div>
661
+ <br/>
662
+ <div>
663
+ <h1 class='AbstractTitle'>Abstract</h1>
664
+ </div>
665
+ <br/>
666
+ <div>
667
+ <h1 class='ForewordTitle'>Foreword</h1>
668
+ <p id='A'>This is a preamble</p>
669
+ </div>
670
+ <br/>
671
+ <div class='Section3' id='B'>
672
+ <h1 class='IntroTitle'>Introduction</h1>
673
+ <div id='C'>
674
+ <h2>
675
+ Introduction Subsection
676
+ <a class='FootnoteRef' href='#fn:8'>
677
+ <sup>8</sup>
678
+ </a>
679
+ </h2>
680
+ </div>
681
+ </div>
682
+ <p class='zzSTDTitle1'/>
683
+ <div>
684
+ <h1>1.&#160; Normative references</h1>
685
+ </div>
686
+ <div id='H'>
687
+ <h1>
688
+ 2.&#160; Terms, Definitions, Symbols and Abbreviated Terms
689
+ <a class='FootnoteRef' href='#fn:10'>
690
+ <sup>10</sup>
691
+ </a>
692
+ </h1>
693
+ <div id='I'>
694
+ <h2>
695
+ 2.1.&#160; Normal Terms
696
+ <a class='FootnoteRef' href='#fn:11'>
697
+ <sup>11</sup>
698
+ </a>
699
+ </h2>
700
+ <p class='TermNum' id='J'>2.1.1.</p>
701
+ <p class='Terms' style='text-align:left;'>Term2</p>
702
+ </div>
703
+ <div id='K'>
704
+ <h2>
705
+ 2.2.&#160; Definitions
706
+ <a class='FootnoteRef' href='#fn:12'>
707
+ <sup>12</sup>
708
+ </a>
709
+ </h2>
710
+ <dl>
711
+ <dt>
712
+ <p>Symbol</p>
713
+ </dt>
714
+ <dd>Definition</dd>
715
+ </dl>
716
+ </div>
717
+ </div>
718
+ <div id='L' class='Symbols'>
719
+ <h1>3.&#160; Symbols and abbreviated terms</h1>
720
+ <dl>
721
+ <dt>
722
+ <p>Symbol</p>
723
+ </dt>
724
+ <dd>Definition</dd>
725
+ </dl>
726
+ </div>
727
+ <div id='D'>
728
+ <h1>
729
+ 4.&#160; Scope
730
+ <a class='FootnoteRef' href='#fn:9'>
731
+ <sup>9</sup>
732
+ </a>
733
+ </h1>
734
+ <p id='E'>Text</p>
735
+ </div>
736
+ <div id='M'>
737
+ <h1>
738
+ 5.&#160; Clause 4
739
+ <a class='FootnoteRef' href='#fn:13'>
740
+ <sup>13</sup>
741
+ </a>
742
+ </h1>
743
+ <div id='N'>
744
+ <h2>
745
+ 5.1.&#160; Introduction
746
+ <a class='FootnoteRef' href='#fn:1'>
747
+ <sup>1</sup>
748
+ </a>
749
+ </h2>
750
+ </div>
751
+ <div id='O'>
752
+ <h2>
753
+ 5.2.&#160; Clause 4.2
754
+ <a class='FootnoteRef' href='#fn:14'>
755
+ <sup>14</sup>
756
+ </a>
757
+ </h2>
758
+ </div>
759
+ <div id='O1'>
760
+ <h2>5.3.&#160; </h2>
761
+ </div>
762
+ </div>
763
+ <br/>
764
+ <div id='P' class='Section3'>
765
+ <h1 class='Annex'>
766
+ <b>Annex A</b>
767
+ <br/>
768
+ (normative)
769
+ <br/>
770
+ <br/>
771
+ <b>
772
+ Annex
773
+ <a class='FootnoteRef' href='#fn:15'>
774
+ <sup>15</sup>
775
+ </a>
776
+ </b>
777
+ </h1>
778
+ <div id='Q'>
779
+ <h2>
780
+ A.1.&#160; Annex A.1
781
+ <a class='FootnoteRef' href='#fn:16'>
782
+ <sup>16</sup>
783
+ </a>
784
+ </h2>
785
+ <div id='Q1'>
786
+ <h3>
787
+ A.1.1.&#160; Annex A.1a
788
+ <a class='FootnoteRef' href='#fn:17'>
789
+ <sup>17</sup>
790
+ </a>
791
+ </h3>
792
+ </div>
793
+ <div>
794
+ <h3>
795
+ A.1.2.&#160; Annex Bibliography
796
+ <a class='FootnoteRef' href='#fn:18'>
797
+ <sup>18</sup>
798
+ </a>
799
+ </h3>
800
+ </div>
801
+ </div>
802
+ </div>
803
+ <br/>
804
+ <div>
805
+ <h1 class='Section3'>Bibliography</h1>
806
+ <div>
807
+ <h2 class='Section3'>Bibliography SubsectionA</h2>
808
+ </div>
809
+ </div>
810
+ </div>
811
+ </body>
812
+ </html>
786
813
  OUTPUT
787
814
  end
788
815
 
@@ -840,11 +867,11 @@ OUTPUT
840
867
  <title>Annex A.1a</title>
841
868
  </clause>
842
869
  </clause>
843
- </annex><bibliography><references id="R" obligation="informative">
870
+ </annex><bibliography><references id="R" obligation="informative" normative="true">
844
871
  <title>Normative References</title>
845
872
  </references><clause id="S" obligation="informative">
846
873
  <title>Bibliography</title>
847
- <references id="T" obligation="informative">
874
+ <references id="T" obligation="informative" normative="false">
848
875
  <title>Bibliography Subsection</title>
849
876
  </references>
850
877
  </clause>
@@ -872,7 +899,7 @@ OUTPUT
872
899
  <div>
873
900
  <h1>Normative references</h1>
874
901
  </div>
875
- <div id="H"><h1>Terms, definitions, symbols and abbreviated terms</h1>
902
+ <div id="H"><h1>Terms, Definitions, Symbols and Abbreviated Terms</h1>
876
903
  <div id="I"><h2>Normal Terms</h2>
877
904
 
878
905
  <p class="TermNum" id="J">3.1.1.</p>
@@ -964,7 +991,7 @@ OUTPUT
964
991
  INPUT
965
992
  #{HTML_HDR}
966
993
  <p class="zzSTDTitle1"/>
967
- <div id="H"><h1>1.&#160; Terms and definitions</h1>
994
+ <div id="H"><h1>1.&#160; Terms, Definitions, Symbols and Abbreviated Terms</h1>
968
995
  <p class="TermNum" id="J">1.1.</p>
969
996
  <p class="Terms" style="text-align:left;">Term2</p>
970
997
  </div>
@@ -984,6 +1011,7 @@ OUTPUT
984
1011
  </clause>
985
1012
  <clause id="O" inline-header="true" obligation="normative">
986
1013
  <title>Clause 4.2</title>
1014
+ <p>ABC</p>
987
1015
  </clause></clause>
988
1016
 
989
1017
  </sections>
@@ -997,7 +1025,8 @@ OUTPUT
997
1025
  <h2>1.1.&#160; Introduction</h2>
998
1026
  </div>
999
1027
  <div id="O">
1000
- <span class="zzMoveToFollowing"><b>1.2.&#160; Clause 4.2 </b></span>
1028
+ <span class="zzMoveToFollowing"><b>1.2.&#160; Clause 4.2&#160; </b></span>
1029
+ <p>ABC</p>
1001
1030
  </div>
1002
1031
  </div>
1003
1032
  </div>
@@ -1028,7 +1057,7 @@ OUTPUT
1028
1057
  <h2>Introduction</h2>
1029
1058
  </div>
1030
1059
  <div id="O">
1031
- <span class="zzMoveToFollowing"><b>Clause 4.2 </b></span>
1060
+ <span class="zzMoveToFollowing"><b>Clause 4.2&#160; </b></span>
1032
1061
  </div>
1033
1062
  </div>
1034
1063
  </div>