isodoc 1.0.25 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/macos.yml +12 -2
  3. data/.github/workflows/ubuntu.yml +15 -3
  4. data/.github/workflows/windows.yml +12 -2
  5. data/isodoc.gemspec +2 -2
  6. data/lib/isodoc.rb +2 -0
  7. data/lib/isodoc/common.rb +0 -4
  8. data/lib/isodoc/convert.rb +18 -8
  9. data/lib/isodoc/function/blocks.rb +46 -52
  10. data/lib/isodoc/function/blocks_example_note.rb +108 -0
  11. data/lib/isodoc/function/cleanup.rb +14 -2
  12. data/lib/isodoc/function/i18n.rb +1 -0
  13. data/lib/isodoc/function/inline.rb +76 -82
  14. data/lib/isodoc/function/inline_simple.rb +72 -0
  15. data/lib/isodoc/function/lists.rb +12 -6
  16. data/lib/isodoc/function/references.rb +49 -53
  17. data/lib/isodoc/function/reqt.rb +14 -5
  18. data/lib/isodoc/function/section.rb +10 -12
  19. data/lib/isodoc/function/table.rb +4 -5
  20. data/lib/isodoc/function/terms.rb +3 -3
  21. data/lib/isodoc/function/to_word_html.rb +22 -12
  22. data/lib/isodoc/function/utils.rb +9 -3
  23. data/lib/isodoc/headlesshtml_convert.rb +12 -6
  24. data/lib/isodoc/html_convert.rb +7 -1
  25. data/lib/isodoc/html_function/footnotes.rb +1 -1
  26. data/lib/isodoc/html_function/html.rb +16 -1
  27. data/lib/isodoc/html_function/postprocess.rb +6 -5
  28. data/lib/isodoc/metadata.rb +6 -0
  29. data/lib/isodoc/metadata_date.rb +19 -7
  30. data/lib/isodoc/pdf_convert.rb +13 -6
  31. data/lib/isodoc/presentation_xml_convert.rb +29 -0
  32. data/lib/isodoc/version.rb +1 -1
  33. data/lib/isodoc/word_convert.rb +7 -1
  34. data/lib/isodoc/word_function/body.rb +14 -48
  35. data/lib/isodoc/word_function/footnotes.rb +1 -1
  36. data/lib/isodoc/word_function/inline.rb +75 -0
  37. data/lib/isodoc/word_function/postprocess.rb +1 -0
  38. data/lib/isodoc/word_function/table.rb +3 -3
  39. data/lib/isodoc/xref.rb +59 -0
  40. data/lib/isodoc/{function → xref}/xref_anchor.rb +10 -21
  41. data/lib/isodoc/xref/xref_counter.rb +74 -0
  42. data/lib/isodoc/{function → xref}/xref_gen.rb +11 -23
  43. data/lib/isodoc/{function → xref}/xref_gen_seq.rb +41 -32
  44. data/lib/isodoc/{function → xref}/xref_sect_gen.rb +54 -40
  45. data/lib/isodoc/xslfo_convert.rb +21 -4
  46. data/spec/assets/i18n.yaml +4 -1
  47. data/spec/assets/odf.emf +0 -0
  48. data/spec/assets/odf.svg +4 -0
  49. data/spec/assets/odf1.svg +4 -0
  50. data/spec/isodoc/blocks_spec.rb +271 -48
  51. data/spec/isodoc/cleanup_spec.rb +139 -17
  52. data/spec/isodoc/footnotes_spec.rb +20 -5
  53. data/spec/isodoc/i18n_spec.rb +8 -8
  54. data/spec/isodoc/inline_spec.rb +299 -4
  55. data/spec/isodoc/lists_spec.rb +8 -8
  56. data/spec/isodoc/metadata_spec.rb +110 -3
  57. data/spec/isodoc/postproc_spec.rb +10 -14
  58. data/spec/isodoc/presentation_xml_spec.rb +20 -0
  59. data/spec/isodoc/ref_spec.rb +121 -52
  60. data/spec/isodoc/section_spec.rb +232 -208
  61. data/spec/isodoc/table_spec.rb +28 -28
  62. data/spec/isodoc/terms_spec.rb +7 -7
  63. data/spec/isodoc/xref_spec.rb +206 -59
  64. metadata +24 -17
  65. data/lib/isodoc/function/blocks_example.rb +0 -53
  66. data/lib/isodoc/function/xref_counter.rb +0 -50
@@ -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>
@@ -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>
@@ -579,215 +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>
673
- 1.&#160; Terms, Definitions, Symbols and Abbreviated Terms
674
- <a rel='footnote' href='#fn:10' epub:type='footnote'>
675
- <sup>10</sup>
676
- </a>
677
- </h1>
678
- <div id='I'>
679
- <h2>
680
- 1.1.&#160; Normal Terms
681
- <a rel='footnote' href='#fn:11' epub:type='footnote'>
682
- <sup>11</sup>
683
- </a>
684
- </h2>
685
- <p class='TermNum' id='J'>1.1.1.</p>
686
- <p class='Terms' style='text-align:left;'>Term2</p>
687
- </div>
688
- <div id='K'>
689
- <h2>
690
- 1.2.&#160; Definitions
691
- <a rel='footnote' href='#fn:12' epub:type='footnote'>
692
- <sup>12</sup>
693
- </a>
694
- </h2>
695
- <dl>
696
- <dt>
697
- <p>Symbol</p>
698
- </dt>
699
- <dd>Definition</dd>
700
- </dl>
701
- </div>
702
- </div>
703
- <div id='L' class='Symbols'>
704
- <h1>2.&#160; Symbols and abbreviated terms</h1>
705
- <dl>
706
- <dt>
707
- <p>Symbol</p>
708
- </dt>
709
- <dd>Definition</dd>
710
- </dl>
711
- </div>
712
- <div id='D'>
713
- <h1>
714
- 3.&#160; Scope
715
- <a rel='footnote' href='#fn:9' epub:type='footnote'>
716
- <sup>9</sup>
717
- </a>
718
- </h1>
719
- <p id='E'>Text</p>
720
- </div>
721
- <div id='M'>
722
- <h1>
723
- 4.&#160; Clause 4
724
- <a rel='footnote' href='#fn:13' epub:type='footnote'>
725
- <sup>13</sup>
726
- </a>
727
- </h1>
728
- <div id='N'>
729
- <h2>
730
- 4.1.&#160; Introduction
731
- <a rel='footnote' href='#fn:1' epub:type='footnote'>
732
- <sup>1</sup>
733
- </a>
734
- </h2>
735
- </div>
736
- <div id='O'>
737
- <h2>
738
- 4.2.&#160; Clause 4.2
739
- <a rel='footnote' href='#fn:14' epub:type='footnote'>
740
- <sup>14</sup>
741
- </a>
742
- </h2>
743
- </div>
744
- <div id='O1'>
745
- <h2>4.3.&#160; </h2>
746
- </div>
747
- </div>
748
- <br/>
749
- <div id='P' class='Section3'>
750
- <h1 class='Annex'>
751
- <b>Annex A</b>
752
- <br/>
753
- (normative)
754
- <br/>
755
- <br/>
756
- <b>
757
- Annex
758
- <a rel='footnote' href='#fn:15' epub:type='footnote'>
759
- <sup>15</sup>
760
- </a>
761
- </b>
762
- </h1>
763
- <div id='Q'>
764
- <h2>
765
- A.1.&#160; Annex A.1
766
- <a rel='footnote' href='#fn:16' epub:type='footnote'>
767
- <sup>16</sup>
768
- </a>
769
- </h2>
770
- <div id='Q1'>
771
- <h3>
772
- A.1.1.&#160; Annex A.1a
773
- <a rel='footnote' href='#fn:17' epub:type='footnote'>
774
- <sup>17</sup>
775
- </a>
776
- </h3>
777
- </div>
778
- <div>
779
- <h3>
780
- A.1.2.&#160; Annex Bibliography
781
- <a rel='footnote' href='#fn:18' epub:type='footnote'>
782
- <sup>18</sup>
783
- </a>
784
- </h3>
785
- </div>
786
- </div>
787
- </div>
788
- </div>
789
- </body>
790
- </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>
791
813
  OUTPUT
792
814
  end
793
815
 
@@ -845,11 +867,11 @@ OUTPUT
845
867
  <title>Annex A.1a</title>
846
868
  </clause>
847
869
  </clause>
848
- </annex><bibliography><references id="R" obligation="informative">
870
+ </annex><bibliography><references id="R" obligation="informative" normative="true">
849
871
  <title>Normative References</title>
850
872
  </references><clause id="S" obligation="informative">
851
873
  <title>Bibliography</title>
852
- <references id="T" obligation="informative">
874
+ <references id="T" obligation="informative" normative="false">
853
875
  <title>Bibliography Subsection</title>
854
876
  </references>
855
877
  </clause>
@@ -989,6 +1011,7 @@ OUTPUT
989
1011
  </clause>
990
1012
  <clause id="O" inline-header="true" obligation="normative">
991
1013
  <title>Clause 4.2</title>
1014
+ <p>ABC</p>
992
1015
  </clause></clause>
993
1016
 
994
1017
  </sections>
@@ -1002,7 +1025,8 @@ OUTPUT
1002
1025
  <h2>1.1.&#160; Introduction</h2>
1003
1026
  </div>
1004
1027
  <div id="O">
1005
- <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>
1006
1030
  </div>
1007
1031
  </div>
1008
1032
  </div>
@@ -1033,7 +1057,7 @@ OUTPUT
1033
1057
  <h2>Introduction</h2>
1034
1058
  </div>
1035
1059
  <div id="O">
1036
- <span class="zzMoveToFollowing"><b>Clause 4.2 </b></span>
1060
+ <span class="zzMoveToFollowing"><b>Clause 4.2&#160; </b></span>
1037
1061
  </div>
1038
1062
  </div>
1039
1063
  </div>