metanorma-iso 1.3.22 → 1.3.27
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/macos.yml +8 -7
- data/.github/workflows/ubuntu.yml +8 -7
- data/.github/workflows/windows.yml +8 -8
- data/Gemfile +2 -0
- data/lib/asciidoctor/iso/base.rb +22 -0
- data/lib/asciidoctor/iso/biblio.rng +89 -32
- data/lib/asciidoctor/iso/cleanup.rb +20 -3
- data/lib/asciidoctor/iso/front.rb +16 -107
- data/lib/asciidoctor/iso/front_id.rb +196 -0
- data/lib/asciidoctor/iso/isodoc.rng +475 -2
- data/lib/asciidoctor/iso/isostandard-amd.rng +98 -0
- data/lib/asciidoctor/iso/isostandard.rng +12 -1
- data/lib/asciidoctor/iso/macros.rb +21 -0
- data/lib/asciidoctor/iso/reqt.rng +23 -0
- data/lib/asciidoctor/iso/section.rb +18 -32
- data/lib/asciidoctor/iso/term_lookup_cleanup.rb +87 -0
- data/lib/asciidoctor/iso/validate.rb +41 -25
- data/lib/asciidoctor/iso/validate_requirements.rb +1 -1
- data/lib/asciidoctor/iso/validate_section.rb +2 -2
- data/lib/asciidoctor/iso/validate_style.rb +6 -5
- data/lib/asciidoctor/iso/validate_title.rb +1 -1
- data/lib/isodoc/iso/base_convert.rb +77 -107
- data/lib/isodoc/iso/html/header.html +10 -6
- data/lib/isodoc/iso/html/html_iso_titlepage.html +27 -18
- data/lib/isodoc/iso/html/isodoc.scss +53 -28
- data/lib/isodoc/iso/html/scripts.html +23 -21
- data/lib/isodoc/iso/html/style-human.scss +23 -0
- data/lib/isodoc/iso/html/style-iso.scss +18 -0
- data/lib/isodoc/iso/html/word_iso_intro.html +4 -0
- data/lib/isodoc/iso/html/word_iso_titlepage.html +23 -2
- data/lib/isodoc/iso/html/wordstyle.scss +80 -39
- data/lib/isodoc/iso/html_convert.rb +7 -9
- data/lib/isodoc/iso/iso.amendment.xsl +4597 -0
- data/lib/isodoc/iso/iso.international-standard.xsl +4597 -0
- data/lib/isodoc/iso/metadata.rb +71 -23
- data/lib/isodoc/iso/pdf_convert.rb +39 -0
- data/lib/isodoc/iso/sections.rb +66 -0
- data/lib/isodoc/iso/sts_convert.rb +29 -0
- data/lib/isodoc/iso/xref.rb +105 -0
- data/lib/metanorma-iso.rb +2 -0
- data/lib/metanorma/iso/processor.rb +16 -1
- data/lib/metanorma/iso/version.rb +1 -1
- data/metanorma-iso.gemspec +4 -1
- data/spec/asciidoctor-iso/amd_spec.rb +726 -0
- data/spec/asciidoctor-iso/base_spec.rb +38 -21
- data/spec/asciidoctor-iso/blocks_spec.rb +6 -6
- data/spec/asciidoctor-iso/cleanup_spec.rb +195 -174
- data/spec/asciidoctor-iso/inline_spec.rb +2 -1
- data/spec/asciidoctor-iso/macros_spec.rb +289 -0
- data/spec/asciidoctor-iso/refs_spec.rb +8 -5
- data/spec/asciidoctor-iso/section_spec.rb +8 -8
- data/spec/assets/iso.xml +64 -1
- data/spec/isodoc/amd_spec.rb +652 -0
- data/spec/isodoc/blocks_spec.rb +112 -27
- data/spec/isodoc/i18n_spec.rb +12 -20
- data/spec/isodoc/inline_spec.rb +4 -4
- data/spec/isodoc/iso_spec.rb +1 -1
- data/spec/isodoc/metadata_spec.rb +92 -4
- data/spec/isodoc/postproc_spec.rb +21 -120
- data/spec/isodoc/ref_spec.rb +9 -9
- data/spec/isodoc/section_spec.rb +36 -13
- data/spec/isodoc/table_spec.rb +30 -30
- data/spec/isodoc/terms_spec.rb +6 -6
- data/spec/isodoc/xref_spec.rb +43 -37
- data/spec/metanorma/processor_spec.rb +2 -2
- data/spec/spec_helper.rb +11 -0
- metadata +58 -5
- data/asciidoctor-iso.gemspec.old +0 -50
@@ -91,6 +91,12 @@ RSpec.describe IsoDoc do
|
|
91
91
|
expect(word).to match(/<style>/)
|
92
92
|
end
|
93
93
|
|
94
|
+
it "generates Pdf output docs with null configuration from file" do
|
95
|
+
FileUtils.rm_f "spec/assets/iso.pdf"
|
96
|
+
IsoDoc::Iso::PdfConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.css"}).convert("spec/assets/iso.xml", nil, false)
|
97
|
+
expect(File.exist?("spec/assets/iso.pdf")).to be true
|
98
|
+
end
|
99
|
+
|
94
100
|
it "converts annex subheadings to h2Annex class for Word" do
|
95
101
|
FileUtils.rm_f "test.doc"
|
96
102
|
FileUtils.rm_f "test.html"
|
@@ -153,7 +159,7 @@ RSpec.describe IsoDoc do
|
|
153
159
|
expect(xmlpp(word)).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
154
160
|
<div class="WordSection3">
|
155
161
|
<p class="zzSTDTitle1"></p>
|
156
|
-
<div><a name="_terms_and_definitions" id="_terms_and_definitions"></a><h1>1<span style="mso-tab-count:1">  </span>Terms and
|
162
|
+
<div><a name="_terms_and_definitions" id="_terms_and_definitions"></a><h1>1<span style="mso-tab-count:1">  </span>Terms and Definitions</h1>
|
157
163
|
<p class="TermNum"><a name="paddy1" id="paddy1"></a>1.1</p><p class="Terms" style="text-align:left;">paddy</p>
|
158
164
|
<p class="MsoNormal"><a name="_eb29b35e-123e-4d1c-b50b-2714d41e747f" id="_eb29b35e-123e-4d1c-b50b-2714d41e747f"></a>rice retaining its husk after threshing</p>
|
159
165
|
<p class="MsoNormal">[SOURCE: <a href="#ISO7301">ISO 7301:2011, 3.1</a>, modified — The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here]</p></div>
|
@@ -285,26 +291,26 @@ RSpec.describe IsoDoc do
|
|
285
291
|
<main xmlns:epub="epub" class="main-section"><button onclick="topFunction()" id="myBtn" title="Go to top">Top</button>
|
286
292
|
<p class="zzSTDTitle1"></p>
|
287
293
|
<div id="A">
|
288
|
-
<h1>1  Clause 4</h1>
|
289
|
-
<a
|
294
|
+
<h1 id="toc0">1  Clause 4</h1>
|
295
|
+
<a href="#fn:3" class="FootnoteRef" id="fnref:1">
|
290
296
|
<sup>1)</sup>
|
291
297
|
</a>
|
292
298
|
<div id="N">
|
293
299
|
|
294
|
-
<h2>1.1  Introduction to this<a
|
300
|
+
<h2 id="toc1">1.1  Introduction to this<a href="#fn:2" class="FootnoteRef" id="fnref:2"><sup>2)</sup></a></h2>
|
295
301
|
</div>
|
296
302
|
<div id="O">
|
297
|
-
<h2>1.2  Clause 4.2</h2>
|
298
|
-
<p>A<a
|
303
|
+
<h2 id="toc2">1.2  Clause 4.2</h2>
|
304
|
+
<p>A<a class="FootnoteRef" href="#fn:2"><sup>2)</sup></a></p>
|
299
305
|
</div>
|
300
306
|
</div>
|
301
307
|
<aside id="fn:3" class="footnote">
|
302
|
-
<p id="_ff27c067-2785-4551-96cf-0a73530ff1e6"><a
|
308
|
+
<p id="_ff27c067-2785-4551-96cf-0a73530ff1e6"><a class="FootnoteRef" href="#fn:3">
|
303
309
|
<sup>1)</sup>
|
304
310
|
</a>This is a footnote.</p>
|
305
311
|
<a href="#fnref:1">↩</a></aside>
|
306
312
|
<aside id="fn:2" class="footnote">
|
307
|
-
<p id="_ff27c067-2785-4551-96cf-0a73530ff1e6"><a
|
313
|
+
<p id="_ff27c067-2785-4551-96cf-0a73530ff1e6"><a href="#fn:2" class="FootnoteRef"><sup>2)</sup></a>Formerly denoted as 15 % (m/m).</p>
|
308
314
|
<a href="#fnref:2">↩</a></aside>
|
309
315
|
|
310
316
|
</main>
|
@@ -347,7 +353,7 @@ RSpec.describe IsoDoc do
|
|
347
353
|
Clause 4
|
348
354
|
</h1>
|
349
355
|
<span style='mso-bookmark:_Ref'>
|
350
|
-
<a href='#_ftn1' epub:type='footnote' style='mso-footnote-id:ftn1' name='_ftnref1' title='' id='_ftnref1'>
|
356
|
+
<a href='#_ftn1' class='FootnoteRef' epub:type='footnote' style='mso-footnote-id:ftn1' name='_ftnref1' title='' id='_ftnref1'>
|
351
357
|
<span class='MsoFootnoteReference'>
|
352
358
|
<span style='mso-special-character:footnote'/>
|
353
359
|
</span>
|
@@ -361,7 +367,7 @@ RSpec.describe IsoDoc do
|
|
361
367
|
<span style='mso-tab-count:1'>  </span>
|
362
368
|
Introduction to this
|
363
369
|
<span style='mso-bookmark:_Ref'>
|
364
|
-
<a href='#_ftn2' epub:type='footnote' style='mso-footnote-id:ftn2' name='_ftnref2' title='' id='_ftnref2'>
|
370
|
+
<a href='#_ftn2' epub:type='footnote' class='FootnoteRef' style='mso-footnote-id:ftn2' name='_ftnref2' title='' id='_ftnref2'>
|
365
371
|
<span class='MsoFootnoteReference'>
|
366
372
|
<span style='mso-special-character:footnote'/>
|
367
373
|
</span>
|
@@ -380,7 +386,7 @@ RSpec.describe IsoDoc do
|
|
380
386
|
<p class='MsoNormal'>
|
381
387
|
A
|
382
388
|
<span style='mso-bookmark:_Ref'>
|
383
|
-
<a href='#_ftn3' epub:type='footnote' style='mso-footnote-id:ftn3' name='_ftnref3' title='' id='_ftnref3'>
|
389
|
+
<a href='#_ftn3' class='FootnoteRef' epub:type='footnote' style='mso-footnote-id:ftn3' name='_ftnref3' title='' id='_ftnref3'>
|
384
390
|
<span class='MsoFootnoteReference'>
|
385
391
|
<span style='mso-special-character:footnote'/>
|
386
392
|
</span>
|
@@ -459,7 +465,7 @@ RSpec.describe IsoDoc do
|
|
459
465
|
<main class="main-section"><button onclick="topFunction()" id="myBtn" title="Go to top">Top</button>
|
460
466
|
<br />
|
461
467
|
<div>
|
462
|
-
<h1 class="ForewordTitle">Foreword</h1>
|
468
|
+
<h1 class="ForewordTitle" id="toc0">Foreword</h1>
|
463
469
|
<div id="_" class="figure">
|
464
470
|
<img src="test_htmlimages/_.png" height="776" width="922" />
|
465
471
|
<img src="test_htmlimages/_.png" height="800" width="53" />
|
@@ -672,8 +678,8 @@ documentation.
|
|
672
678
|
</iso-standard>
|
673
679
|
INPUT
|
674
680
|
word = File.read("test.html", encoding: "UTF-8")
|
675
|
-
expect(
|
676
|
-
expect(
|
681
|
+
expect((word)).to include '<h1 class="IntroTitle">Warning for Stuff</h1>'
|
682
|
+
expect((word)).to include "I am the Walrus."
|
677
683
|
end
|
678
684
|
|
679
685
|
it "processes boilerplate (Word)" do
|
@@ -724,7 +730,7 @@ end
|
|
724
730
|
<a name='boilerplate-place' id='boilerplate-place'/>
|
725
731
|
Dilbert Associates
|
726
732
|
</p>
|
727
|
-
<p align='left' style='text-align:left' class='zzAddress'>
|
733
|
+
<p align='left' style='text-align:left;' class='zzAddress'>
|
728
734
|
<a name='boilerplate-address' id='boilerplate-address'/>
|
729
735
|
Elbonia 5000
|
730
736
|
</p>
|
@@ -734,109 +740,4 @@ end
|
|
734
740
|
expect(word).to include '<p class="zzWarning">I am the Walrus</p>'
|
735
741
|
end
|
736
742
|
|
737
|
-
it "skips internal hyperlinks" do
|
738
|
-
FileUtils.rm_f "test.html"
|
739
|
-
FileUtils.rm_f "test.doc"
|
740
|
-
IsoDoc::Iso::HtmlConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.css"}).convert("test", <<~"INPUT", false)
|
741
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
742
|
-
<preface>
|
743
|
-
<foreword>
|
744
|
-
<p>
|
745
|
-
<xref target="scope"/>
|
746
|
-
<xref target="terms"/>
|
747
|
-
<xref target="_waxy_rice"/>
|
748
|
-
<xref target="N"/>
|
749
|
-
<xref target="N1"/>
|
750
|
-
<xref target="N2"/>
|
751
|
-
<xref target="N3"/>
|
752
|
-
<xref target="N4"/>
|
753
|
-
<xref target="N5"/>
|
754
|
-
<xref target="N6"/>
|
755
|
-
<xref target="N7"/>
|
756
|
-
<xref target="N8"/>
|
757
|
-
<xref target="N9"/>
|
758
|
-
<xref target="N10"/>
|
759
|
-
<eref bibitemid="ISO712"/>
|
760
|
-
</p>
|
761
|
-
</foreword>
|
762
|
-
</preface>
|
763
|
-
<sections>
|
764
|
-
<clause id="scope"><title>Scope</title>
|
765
|
-
<note id="N">
|
766
|
-
<p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
|
767
|
-
</note>
|
768
|
-
<figure id="N1">
|
769
|
-
<name>Split-it-right sample divider</name>
|
770
|
-
</figure>
|
771
|
-
<example id="N2">
|
772
|
-
<p>Hello</p>
|
773
|
-
</example>
|
774
|
-
<formula id="N3">
|
775
|
-
<stem type="AsciiMath">r = 1 %</stem>
|
776
|
-
</formula>
|
777
|
-
<table id="N4">
|
778
|
-
<name>Repeatability and reproducibility of husked rice yield</name>
|
779
|
-
<tbody>
|
780
|
-
<tr>
|
781
|
-
<td align="left">Number of laboratories retained after eliminating outliers</td>
|
782
|
-
<td align="center">13</td>
|
783
|
-
<td align="center">11</td>
|
784
|
-
</tr>
|
785
|
-
</tbody>
|
786
|
-
</table>
|
787
|
-
<ol id="N6">
|
788
|
-
<li id="N7"><p>A</p></li>
|
789
|
-
</ol>
|
790
|
-
<requirement id="N8">
|
791
|
-
<stem type="AsciiMath">r = 1 %</stem>
|
792
|
-
</requirement>
|
793
|
-
<recommendation id="N9">
|
794
|
-
<stem type="AsciiMath">r = 1 %</stem>
|
795
|
-
</requirement>
|
796
|
-
<permission id="N10">
|
797
|
-
<stem type="AsciiMath">r = 1 %</stem>
|
798
|
-
</requirement>
|
799
|
-
</clause>
|
800
|
-
<terms id="terms">
|
801
|
-
<term id="_waxy_rice"><preferred>waxy rice</preferred>
|
802
|
-
<termnote id="N5">
|
803
|
-
<p id="_b0cb3dfd-78fc-47dd-a339-84070d947463">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p>
|
804
|
-
</termnote></term>
|
805
|
-
</terms>
|
806
|
-
</sections>
|
807
|
-
<bibliography><references id="_normative_references" obligation="informative"><title>Normative References</title>
|
808
|
-
<p>The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
|
809
|
-
<bibitem id="ISO712" type="standard">
|
810
|
-
<title format="text/plain">Cereals or cereal products</title>
|
811
|
-
<title type="main" format="text/plain">Cereals and cereal products</title>
|
812
|
-
<docidentifier type="ISO">ISO 712</docidentifier>
|
813
|
-
<contributor>
|
814
|
-
<role type="publisher"/>
|
815
|
-
<organization>
|
816
|
-
<name>International Organization for Standardization</name>
|
817
|
-
</organization>
|
818
|
-
</contributor>
|
819
|
-
</bibitem>
|
820
|
-
</references>
|
821
|
-
</bibliography>
|
822
|
-
</iso-standard>
|
823
|
-
INPUT
|
824
|
-
expect(File.exist?("test.html")).to be true
|
825
|
-
html = File.read("test.html", encoding: "UTF-8").sub(/^.*<main class="main-section">/m, '<main class="main-section">').
|
826
|
-
sub(%r{</main>.*$}m, "</main>").sub(%r{^.*?<div>}m, "<div>").sub(%r{</div>.*$}m, "</div>")
|
827
|
-
expect(xmlpp(html)).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
828
|
-
<div>
|
829
|
-
<h1 class='ForewordTitle'>Foreword</h1>
|
830
|
-
<p>
|
831
|
-
<a href='#scope'>Clause 1</a>
|
832
|
-
<a href='#terms'>Clause 3</a>
|
833
|
-
<a href='#_waxy_rice'>3.1</a>
|
834
|
-
Clause 1, Note Figure 1 Clause 1, Example Clause 1, Formula (1) Table 1
|
835
|
-
3.1, Note 1 Clause 1, List Clause 1 a) Clause 1, Requirement 1 Clause 1,
|
836
|
-
Recommendation 1 Clause 1, Permission 1
|
837
|
-
<a href='#ISO712'>ISO 712</a>
|
838
|
-
</p>
|
839
|
-
</div>
|
840
|
-
OUTPUT
|
841
|
-
end
|
842
743
|
end
|
data/spec/isodoc/ref_spec.rb
CHANGED
@@ -18,7 +18,7 @@ RSpec.describe IsoDoc do
|
|
18
18
|
<eref bibitemid="ref12"/>
|
19
19
|
</p>
|
20
20
|
</foreword></preface>
|
21
|
-
<bibliography><references id="_normative_references" obligation="informative"><title>Normative References</title>
|
21
|
+
<bibliography><references id="_normative_references" obligation="informative" normative="true"><title>Normative References</title>
|
22
22
|
<p>The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
|
23
23
|
<bibitem id="ISO712" type="standard">
|
24
24
|
<title format="text/plain">Cereals or cereal products</title>
|
@@ -42,7 +42,7 @@ RSpec.describe IsoDoc do
|
|
42
42
|
<abbreviation>ISO</abbreviation>
|
43
43
|
</organization>
|
44
44
|
</contributor>
|
45
|
-
<note format="text/plain" reference="1"
|
45
|
+
<note format="text/plain" reference="1" type="ISO DATE">Under preparation. (Stage at the time of publication ISO/DIS 16634)</note>
|
46
46
|
<extent type="part">
|
47
47
|
<referenceFrom>all</referenceFrom>
|
48
48
|
</extent>
|
@@ -65,7 +65,7 @@ RSpec.describe IsoDoc do
|
|
65
65
|
</bibitem>
|
66
66
|
<note><p>This is an annotation of ISO 20483:2013-2014</p></note>
|
67
67
|
|
68
|
-
</references><references id="_bibliography" obligation="informative">
|
68
|
+
</references><references id="_bibliography" obligation="informative" normative="false">
|
69
69
|
<title>Bibliography</title>
|
70
70
|
<bibitem id="ISBN" type="ISBN">
|
71
71
|
<title format="text/plain">Chemicals for analytical laboratory use</title>
|
@@ -131,7 +131,7 @@ RSpec.describe IsoDoc do
|
|
131
131
|
<a href="#ISO16634">ISO 16634:--</a>
|
132
132
|
<a href="#ref1">ICC 167</a>
|
133
133
|
<a href="#ref10">[10]</a>
|
134
|
-
<a href="#ref12">
|
134
|
+
<a href="#ref12">Citn</a>
|
135
135
|
</p>
|
136
136
|
</div>
|
137
137
|
<p class="zzSTDTitle1"/>
|
@@ -139,10 +139,10 @@ RSpec.describe IsoDoc do
|
|
139
139
|
<h1>1  Normative references</h1>
|
140
140
|
<p>The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
|
141
141
|
<p id="ISO712" class="NormRef">ISO 712, <i>Cereals and cereal products</i></p>
|
142
|
-
<p id="ISO16634" class="NormRef">ISO 16634:-- (all parts)<a
|
142
|
+
<p id="ISO16634" class="NormRef">ISO 16634:-- (all parts)<a class="FootnoteRef" href="#fn:1"><sup>1</sup></a>, <i>Cereals, pulses, milled cereal products, oilseeds and animal feeding stuffs</i></p>
|
143
143
|
<p id="ISO20483" class="NormRef">ISO 20483:2013-2014, <i>Cereals and pulses</i></p>
|
144
144
|
<p id="ref1" class="NormRef">ICC 167, <span style="font-variant:small-caps;">Standard No I.C.C 167</span>. <i>Determination of the protein content in cereal and cereal products for food and animal feeding stuffs according to the Dumas combustion method</i> (see <a href="http://www.icc.or.at">http://www.icc.or.at</a>)</p>
|
145
|
-
<div
|
145
|
+
<div class="Note">
|
146
146
|
<p><span class="note_label">NOTE</span>  This is an annotation of ISO 20483:2013-2014</p>
|
147
147
|
</div>
|
148
148
|
</div>
|
@@ -151,16 +151,16 @@ RSpec.describe IsoDoc do
|
|
151
151
|
<h1 class="Section3">Bibliography</h1>
|
152
152
|
<p id="ISBN" class="Biblio">[1]  <i>Chemicals for analytical laboratory use</i></p>
|
153
153
|
<p id="ISSN" class="Biblio">[2]  <i>Instruments for analytical laboratory use</i></p>
|
154
|
-
<div
|
154
|
+
<div class="Note">
|
155
155
|
<p><span class="note_label">NOTE</span>  This is an annotation of document ISSN.</p>
|
156
156
|
</div>
|
157
|
-
<div
|
157
|
+
<div class="Note">
|
158
158
|
<p><span class="note_label">NOTE</span>  This is another annotation of document ISSN.</p>
|
159
159
|
</div>
|
160
160
|
<p id="ISO3696" class="Biblio">[3]  ISO 3696, <i>Water for analytical laboratory use</i></p>
|
161
161
|
<p id="ref10" class="Biblio">[10]  <span style="font-variant:small-caps;">Standard No I.C.C 167</span>. <i>Determination of the protein content in cereal and cereal products for food and animal feeding stuffs according to the Dumas combustion method</i> (see <a href="http://www.icc.or.at">http://www.icc.or.at</a>)</p>
|
162
162
|
<p id="ref11" class="Biblio">[5]  IETF RFC 10, <i>Internet Calendaring and Scheduling Core Object Specification (iCalendar)</i></p>
|
163
|
-
<p id="ref12" class="Biblio">[6]  Citn, CitationWorks. 2019. <i>How to cite a reference</i>.</p>
|
163
|
+
<p id="ref12" class="Biblio">[6]  Citn, IETF RFC 20, CitationWorks. 2019. <i>How to cite a reference</i>.</p>
|
164
164
|
</div>
|
165
165
|
<aside id="fn:1" class="footnote">
|
166
166
|
<p>Under preparation. (Stage at the time of publication ISO/DIS 16634)</p>
|
data/spec/isodoc/section_spec.rb
CHANGED
@@ -12,9 +12,7 @@ RSpec.describe IsoDoc do
|
|
12
12
|
<introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
|
13
13
|
<title>Introduction Subsection</title>
|
14
14
|
</clause>
|
15
|
-
<patent-notice>
|
16
15
|
<p>This is patent boilerplate</p>
|
17
|
-
</patent-notice>
|
18
16
|
</introduction></preface><sections>
|
19
17
|
<clause id="D" obligation="normative">
|
20
18
|
<title>Scope</title>
|
@@ -58,12 +56,12 @@ RSpec.describe IsoDoc do
|
|
58
56
|
<appendix id="Q2" inline-header="false" obligation="normative">
|
59
57
|
<title>An Appendix</title>
|
60
58
|
</appendix>
|
61
|
-
<references id="Q3"><title>Annex Bibliography</title></references>
|
62
|
-
</annex><bibliography><references id="R" obligation="informative">
|
59
|
+
<references id="Q3" normative="false"><title>Annex Bibliography</title></references>
|
60
|
+
</annex><bibliography><references id="R" obligation="informative" normative="true">
|
63
61
|
<title>Normative References</title>
|
64
62
|
</references><clause id="S" obligation="informative">
|
65
63
|
<title>Bibliography</title>
|
66
|
-
<references id="T" obligation="informative">
|
64
|
+
<references id="T" obligation="informative" normative="false">
|
67
65
|
<title>Bibliography Subsection</title>
|
68
66
|
</references>
|
69
67
|
</clause>
|
@@ -92,7 +90,7 @@ RSpec.describe IsoDoc do
|
|
92
90
|
<div>
|
93
91
|
<h1>2  Normative references</h1>
|
94
92
|
</div>
|
95
|
-
<div id="H"><h1>3  Terms,
|
93
|
+
<div id="H"><h1>3  Terms, Definitions, Symbols and Abbreviated Terms</h1>
|
96
94
|
<div id="I">
|
97
95
|
<h2>3.1  Normal Terms</h2>
|
98
96
|
<p class="TermNum" id="J">3.1.1</p>
|
@@ -160,9 +158,7 @@ OUTPUT
|
|
160
158
|
<introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
|
161
159
|
<title>Introduction Subsection</title>
|
162
160
|
</clause>
|
163
|
-
<patent-notice>
|
164
161
|
<p>This is patent boilerplate</p>
|
165
|
-
</patent-notice>
|
166
162
|
</introduction></preface><sections>
|
167
163
|
<clause id="D" obligation="normative">
|
168
164
|
<title>Scope</title>
|
@@ -206,11 +202,11 @@ OUTPUT
|
|
206
202
|
<appendix id="Q2" inline-header="false" obligation="normative">
|
207
203
|
<title>An Appendix</title>
|
208
204
|
</appendix>
|
209
|
-
</annex><bibliography><references id="R" obligation="informative">
|
205
|
+
</annex><bibliography><references id="R" obligation="informative" normative="true">
|
210
206
|
<title>Normative References</title>
|
211
207
|
</references><clause id="S" obligation="informative">
|
212
208
|
<title>Bibliography</title>
|
213
|
-
<references id="T" obligation="informative">
|
209
|
+
<references id="T" obligation="informative" normative="false">
|
214
210
|
<title>Bibliography Subsection</title>
|
215
211
|
</references>
|
216
212
|
</clause>
|
@@ -248,7 +244,7 @@ OUTPUT
|
|
248
244
|
<div>
|
249
245
|
<h1>2<span style="mso-tab-count:1">  </span>Normative references</h1>
|
250
246
|
</div>
|
251
|
-
<div id="H"><h1>3<span style="mso-tab-count:1">  </span>Terms,
|
247
|
+
<div id="H"><h1>3<span style="mso-tab-count:1">  </span>Terms, Definitions, Symbols and Abbreviated Terms</h1>
|
252
248
|
<div id="I">
|
253
249
|
<h2>3.1<span style="mso-tab-count:1">  </span>Normal Terms</h2>
|
254
250
|
<p class="TermNum" id="J">3.1.1</p>
|
@@ -363,7 +359,7 @@ OUTPUT
|
|
363
359
|
INPUT
|
364
360
|
#{HTML_HDR}
|
365
361
|
<p class="zzSTDTitle1"/>
|
366
|
-
<div id="H"><h1>1  Terms and
|
362
|
+
<div id="H"><h1>1  Terms, Definitions, Symbols and Abbreviated Terms</h1>
|
367
363
|
<p class="TermNum" id="J">1.1</p>
|
368
364
|
<p class="Terms" style="text-align:left;">Term2</p>
|
369
365
|
</div>
|
@@ -395,7 +391,7 @@ OUTPUT
|
|
395
391
|
<h2>1.1  Introduction</h2>
|
396
392
|
</div>
|
397
393
|
<div id="O">
|
398
|
-
<span class="zzMoveToFollowing"><b>1.2  Clause 4.2 </b></span>
|
394
|
+
<span class="zzMoveToFollowing"><b>1.2  Clause 4.2  </b></span>
|
399
395
|
</div>
|
400
396
|
</div>
|
401
397
|
</div>
|
@@ -462,5 +458,32 @@ OUTPUT
|
|
462
458
|
OUTPUT
|
463
459
|
end
|
464
460
|
|
461
|
+
it "processes middle title" do
|
462
|
+
expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
463
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
464
|
+
<bibdata>
|
465
|
+
<title language='en' format='text/plain' type='title-intro'>Introduction</title>
|
466
|
+
<title language='en' format='text/plain' type='title-main'>Main Title — Title</title>
|
467
|
+
<title language='en' format='text/plain' type='title-part'>Title Part</title>
|
468
|
+
<ext>
|
469
|
+
<structuredidentifier>
|
470
|
+
<project-number part='1' origyr='2016-05-01'>17301</project-number>
|
471
|
+
</structuredidentifier>
|
472
|
+
</ext>
|
473
|
+
</bibdata>
|
474
|
+
<sections/>
|
475
|
+
</iso-standard>
|
476
|
+
INPUT
|
477
|
+
#{HTML_HDR}
|
478
|
+
<p class='zzSTDTitle1'>Introduction — Main Title — Title — </p>
|
479
|
+
<p class='zzSTDTitle2'>
|
480
|
+
Part 1:
|
481
|
+
<br/><b>Title Part</b>
|
482
|
+
</p>
|
483
|
+
</div>
|
484
|
+
</body>
|
485
|
+
</html>
|
486
|
+
OUTPUT
|
487
|
+
end
|
465
488
|
|
466
489
|
end
|
data/spec/isodoc/table_spec.rb
CHANGED
@@ -68,7 +68,7 @@ RSpec.describe IsoDoc do
|
|
68
68
|
<button onclick='topFunction()' id='myBtn' title='Go to top'>Top</button>
|
69
69
|
<br/>
|
70
70
|
<div>
|
71
|
-
<h1 class='ForewordTitle'>Foreword</h1>
|
71
|
+
<h1 class='ForewordTitle' id="toc0">Foreword</h1>
|
72
72
|
<p class='TableTitle' style='text-align:center;'>
|
73
73
|
Table 1 — Repeatability and reproducibility of
|
74
74
|
<i>husked</i>
|
@@ -80,55 +80,55 @@ RSpec.describe IsoDoc do
|
|
80
80
|
</caption>
|
81
81
|
<thead>
|
82
82
|
<tr>
|
83
|
-
<td rowspan='2' style='text-align:left;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt
|
84
|
-
<td colspan='4' style='text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt
|
83
|
+
<td rowspan='2' style='text-align:left;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;;text-align:center;vertical-align:middle;' scope='col'>Description</td>
|
84
|
+
<td colspan='4' style='text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;;text-align:center;vertical-align:middle;' scope='colgroup'>Rice sample</td>
|
85
85
|
</tr>
|
86
86
|
<tr>
|
87
|
-
<td style='text-align:left;border-top:none;border-bottom:solid windowtext 1.5pt
|
88
|
-
<td style='text-align:center;border-top:none;border-bottom:solid windowtext 1.5pt
|
87
|
+
<td style='text-align:left;border-top:none;border-bottom:solid windowtext 1.5pt;;text-align:center;vertical-align:middle;' scope='col'>Arborio</td>
|
88
|
+
<td style='text-align:center;border-top:none;border-bottom:solid windowtext 1.5pt;;text-align:center;vertical-align:middle;' scope='col'>
|
89
89
|
Drago
|
90
|
-
<a href='#tableD-1a' class='TableFootnoteRef'>a
|
90
|
+
<a href='#tableD-1a' class='TableFootnoteRef'>a</a>
|
91
91
|
</td>
|
92
|
-
<td style='text-align:center;border-top:none;border-bottom:solid windowtext 1.5pt
|
92
|
+
<td style='text-align:center;border-top:none;border-bottom:solid windowtext 1.5pt;;text-align:center;vertical-align:middle;' scope='col'>
|
93
93
|
Balilla
|
94
|
-
<a href='#tableD-1a' class='TableFootnoteRef'>a
|
94
|
+
<a href='#tableD-1a' class='TableFootnoteRef'>a</a>
|
95
95
|
</td>
|
96
|
-
<td style='text-align:center;border-top:none;border-bottom:solid windowtext 1.5pt
|
96
|
+
<td style='text-align:center;border-top:none;border-bottom:solid windowtext 1.5pt;;text-align:center;vertical-align:middle;' scope='col'>Thaibonnet</td>
|
97
97
|
</tr>
|
98
98
|
</thead>
|
99
99
|
<tbody>
|
100
100
|
<tr>
|
101
|
-
<th style='font-weight:bold;text-align:left;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;
|
102
|
-
<td style='text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;
|
103
|
-
<td style='text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;
|
104
|
-
<td style='text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;
|
105
|
-
<td style='text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;
|
101
|
+
<th style='font-weight:bold;text-align:left;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;' scope='row'>Number of laboratories retained after eliminating outliers</th>
|
102
|
+
<td style='text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;'>13</td>
|
103
|
+
<td style='text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;'>11</td>
|
104
|
+
<td style='text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;'>13</td>
|
105
|
+
<td style='text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;'>13</td>
|
106
106
|
</tr>
|
107
107
|
<tr>
|
108
|
-
<td style='text-align:left;border-top:none;border-bottom:solid windowtext 1.5pt;
|
109
|
-
<td style='text-align:center;border-top:none;border-bottom:solid windowtext 1.5pt;
|
110
|
-
<td style='text-align:center;border-top:none;border-bottom:solid windowtext 1.5pt;
|
111
|
-
<td style='text-align:center;border-top:none;border-bottom:solid windowtext 1.5pt;
|
112
|
-
<td style='text-align:center;border-top:none;border-bottom:solid windowtext 1.5pt;
|
108
|
+
<td style='text-align:left;border-top:none;border-bottom:solid windowtext 1.5pt;'>Mean value, g/100 g</td>
|
109
|
+
<td style='text-align:center;border-top:none;border-bottom:solid windowtext 1.5pt;'>81,2</td>
|
110
|
+
<td style='text-align:center;border-top:none;border-bottom:solid windowtext 1.5pt;'>82,0</td>
|
111
|
+
<td style='text-align:center;border-top:none;border-bottom:solid windowtext 1.5pt;'>81,8</td>
|
112
|
+
<td style='text-align:center;border-top:none;border-bottom:solid windowtext 1.5pt;'>77,7</td>
|
113
113
|
</tr>
|
114
114
|
</tbody>
|
115
115
|
<tfoot>
|
116
116
|
<tr>
|
117
|
-
<td style='text-align:left;border-top:solid windowtext 1.5pt;border-bottom:0pt;
|
117
|
+
<td style='text-align:left;border-top:solid windowtext 1.5pt;border-bottom:0pt;'>
|
118
118
|
Reproducibility limit,
|
119
119
|
<span class='stem'>(#(R)#)</span>
|
120
120
|
(= 2,83
|
121
121
|
<span class='stem'>(#(s_R)#)</span>
|
122
122
|
)
|
123
123
|
</td>
|
124
|
-
<td style='text-align:center;border-top:solid windowtext 1.5pt;border-bottom:0pt;
|
125
|
-
<td style='text-align:center;border-top:solid windowtext 1.5pt;border-bottom:0pt;
|
126
|
-
<td style='text-align:center;border-top:solid windowtext 1.5pt;border-bottom:0pt;
|
127
|
-
<td style='text-align:center;border-top:solid windowtext 1.5pt;border-bottom:0pt;
|
124
|
+
<td style='text-align:center;border-top:solid windowtext 1.5pt;border-bottom:0pt;'>2,89</td>
|
125
|
+
<td style='text-align:center;border-top:solid windowtext 1.5pt;border-bottom:0pt;'>0,57</td>
|
126
|
+
<td style='text-align:center;border-top:solid windowtext 1.5pt;border-bottom:0pt;'>2,26</td>
|
127
|
+
<td style='text-align:center;border-top:solid windowtext 1.5pt;border-bottom:0pt;'>6,06</td>
|
128
128
|
</tr>
|
129
129
|
<tr>
|
130
130
|
<td colspan='5' style='border-top:0pt;border-bottom:solid windowtext 1.5pt;'>
|
131
|
-
<div
|
131
|
+
<div class='Note'>
|
132
132
|
<p>
|
133
133
|
<span class='note_label'>NOTE</span>
|
134
134
|
  This is a table about rice
|
@@ -138,7 +138,7 @@ RSpec.describe IsoDoc do
|
|
138
138
|
<div id='fn:tableD-1a'>
|
139
139
|
<p id='_0fe65e9a-5531-408e-8295-eeff35f41a55' class='TableFootnote'>
|
140
140
|
<span>
|
141
|
-
<span id='tableD-1a' class='TableFootnoteRef'>a
|
141
|
+
<span id='tableD-1a' class='TableFootnoteRef'>a</span>
|
142
142
|
 
|
143
143
|
</span>
|
144
144
|
Parboiled rice.
|
@@ -233,8 +233,8 @@ OUTPUT
|
|
233
233
|
</tr>
|
234
234
|
<tr>
|
235
235
|
<td align="center" style="border-top:none;mso-border-top-alt:none;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;" valign="middle">Arborio</td>
|
236
|
-
<td align="center" style="border-top:none;mso-border-top-alt:none;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;" valign="middle">Drago<a href="#tableD-1a" class="TableFootnoteRef">a
|
237
|
-
<td align="center" style="border-top:none;mso-border-top-alt:none;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;" valign="middle">Balilla<a href="#tableD-1a" class="TableFootnoteRef">a
|
236
|
+
<td align="center" style="border-top:none;mso-border-top-alt:none;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;" valign="middle">Drago<a href="#tableD-1a" class="TableFootnoteRef">a</a></td>
|
237
|
+
<td align="center" style="border-top:none;mso-border-top-alt:none;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;" valign="middle">Balilla<a href="#tableD-1a" class="TableFootnoteRef">a</a></td>
|
238
238
|
<td align="center" style="border-top:none;mso-border-top-alt:none;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;" valign="middle">Thaibonnet</td>
|
239
239
|
</tr>
|
240
240
|
</thead>
|
@@ -268,10 +268,10 @@ OUTPUT
|
|
268
268
|
<td align="center" style="border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:0pt;mso-border-bottom-alt:0pt;">2,26</td>
|
269
269
|
<td align="center" style="border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:0pt;mso-border-bottom-alt:0pt;">6,06</td>
|
270
270
|
</tr>
|
271
|
-
<tr><td colspan="5" style="border-top:0pt;mso-border-top-alt:0pt;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;"><div
|
271
|
+
<tr><td colspan="5" style="border-top:0pt;mso-border-top-alt:0pt;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;"><div class="Note">
|
272
272
|
<p class="Note"><span class="note_label">NOTE</span><span style="mso-tab-count:1">  </span>This is a table about rice</p>
|
273
273
|
</div><div class="TableFootnote"><div><a name="ftntableD-1a" id="ftntableD-1a"></a>
|
274
|
-
<p class="TableFootnote"><a name="_0fe65e9a-5531-408e-8295-eeff35f41a55" id="_0fe65e9a-5531-408e-8295-eeff35f41a55"></a><span><span class="TableFootnoteRef"><a name="tableD-1a" id="tableD-1a"></a>a
|
274
|
+
<p class="TableFootnote"><a name="_0fe65e9a-5531-408e-8295-eeff35f41a55" id="_0fe65e9a-5531-408e-8295-eeff35f41a55"></a><span><span class="TableFootnoteRef"><a name="tableD-1a" id="tableD-1a"></a>a</span><span style="mso-tab-count:1">  </span></span>Parboiled rice.</p>
|
275
275
|
</div></div></td></tr></tfoot>
|
276
276
|
|
277
277
|
|