metanorma-iec 1.3.12 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/asciidoctor/iec/basicdoc.rng +21 -4
- data/lib/asciidoctor/iec/front.rb +0 -4
- data/lib/asciidoctor/iec/isodoc.rng +420 -76
- data/lib/asciidoctor/iec/isostandard.rng +6 -22
- data/lib/asciidoctor/iec/reqt.rng +23 -2
- data/lib/isodoc/iec/base_convert.rb +2 -2
- data/lib/isodoc/iec/html/isodoc.css +5 -3
- data/lib/isodoc/iec/html/isodoc.scss +5 -3
- data/lib/isodoc/iec/html/wordstyle.css +24 -0
- data/lib/isodoc/iec/html/wordstyle.scss +24 -0
- data/lib/isodoc/iec/iec.international-standard.xsl +48 -13
- data/lib/isodoc/iec/word_convert.rb +1 -1
- data/lib/metanorma/iec/version.rb +1 -1
- data/metanorma-iec.gemspec +1 -1
- data/spec/asciidoctor/base_spec.rb +0 -2
- data/spec/asciidoctor/blocks_spec.rb +2 -75
- data/spec/asciidoctor/cleanup_spec.rb +2 -122
- data/spec/asciidoctor/iev_spec.rb +4 -4
- data/spec/asciidoctor/inline_spec.rb +0 -45
- data/spec/asciidoctor/section_spec.rb +4 -4
- data/spec/isodoc/iev_spec.rb +3 -3
- data/spec/isodoc/terms_spec.rb +2 -2
- metadata +5 -5
@@ -2223,7 +2223,7 @@
|
|
2223
2223
|
</xsl:variable>
|
2224
2224
|
<fo:block line-height="1.1" space-before="14pt" role="H{$levelTerm}">
|
2225
2225
|
<fo:block font-weight="bold" keep-with-next="always">
|
2226
|
-
<xsl:apply-templates select="ancestor::iec:term/iec:name" mode="presentation"/>
|
2226
|
+
<xsl:apply-templates select="ancestor::iec:term[1]/iec:name" mode="presentation"/>
|
2227
2227
|
</fo:block>
|
2228
2228
|
<fo:block font-weight="bold" keep-with-next="always">
|
2229
2229
|
<xsl:apply-templates/>
|
@@ -2597,6 +2597,8 @@
|
|
2597
2597
|
|
2598
2598
|
<title-list-figures lang="en">List of Figures</title-list-figures>
|
2599
2599
|
|
2600
|
+
<title-table-figures lang="en">Table of Figures</title-table-figures>
|
2601
|
+
|
2600
2602
|
<title-list-recommendations lang="en">List of Recommendations</title-list-recommendations>
|
2601
2603
|
|
2602
2604
|
<title-acknowledgements lang="en">Acknowledgements</title-acknowledgements>
|
@@ -2873,6 +2875,11 @@
|
|
2873
2875
|
|
2874
2876
|
|
2875
2877
|
|
2878
|
+
</xsl:attribute-set><xsl:attribute-set name="table-note-name-style">
|
2879
|
+
|
2880
|
+
|
2881
|
+
|
2882
|
+
|
2876
2883
|
</xsl:attribute-set><xsl:attribute-set name="note-p-style">
|
2877
2884
|
|
2878
2885
|
|
@@ -4023,9 +4030,8 @@
|
|
4023
4030
|
|
4024
4031
|
<!-- Table's note name (NOTE, for example) -->
|
4025
4032
|
|
4026
|
-
<fo:inline padding-right="2mm">
|
4033
|
+
<fo:inline padding-right="2mm" xsl:use-attribute-sets="table-note-name-style">
|
4027
4034
|
|
4028
|
-
|
4029
4035
|
|
4030
4036
|
|
4031
4037
|
|
@@ -4569,6 +4575,7 @@
|
|
4569
4575
|
<fo:table-cell>
|
4570
4576
|
|
4571
4577
|
<fo:block margin-top="6pt">
|
4578
|
+
<xsl:copy-of select="@id"/>
|
4572
4579
|
|
4573
4580
|
|
4574
4581
|
<xsl:attribute name="margin-top">0pt</xsl:attribute>
|
@@ -4676,6 +4683,8 @@
|
|
4676
4683
|
<xsl:if test="$font-size != ''">
|
4677
4684
|
<xsl:attribute name="font-size">
|
4678
4685
|
<xsl:choose>
|
4686
|
+
<xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
|
4687
|
+
<xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
|
4679
4688
|
<xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
|
4680
4689
|
<xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
|
4681
4690
|
</xsl:choose>
|
@@ -5412,14 +5421,18 @@
|
|
5412
5421
|
</xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'p']">
|
5413
5422
|
<fo:inline><xsl:apply-templates/></fo:inline>
|
5414
5423
|
</xsl:template><xsl:template match="*[local-name() = 'terms']">
|
5424
|
+
<!-- <xsl:message>'terms' <xsl:number/> processing...</xsl:message> -->
|
5415
5425
|
<fo:block id="{@id}">
|
5416
5426
|
<xsl:apply-templates/>
|
5417
5427
|
</fo:block>
|
5418
5428
|
</xsl:template><xsl:template match="*[local-name() = 'term']">
|
5429
|
+
<!-- <xsl:message>'term' <xsl:number/> processing, name=<xsl:value-of select="iso:name"/>, preferred=<xsl:value-of select="iso:preferred"/>...</xsl:message> -->
|
5419
5430
|
<fo:block id="{@id}" xsl:use-attribute-sets="term-style">
|
5420
5431
|
|
5421
5432
|
|
5422
|
-
|
5433
|
+
<xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'term'])">
|
5434
|
+
|
5435
|
+
</xsl:if>
|
5423
5436
|
<xsl:apply-templates/>
|
5424
5437
|
</fo:block>
|
5425
5438
|
</xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']" mode="presentation">
|
@@ -5481,6 +5494,7 @@
|
|
5481
5494
|
<xsl:otherwise>
|
5482
5495
|
<fo:block xsl:use-attribute-sets="image-style">
|
5483
5496
|
|
5497
|
+
|
5484
5498
|
<xsl:variable name="src">
|
5485
5499
|
<xsl:call-template name="image_src"/>
|
5486
5500
|
</xsl:variable>
|
@@ -5847,7 +5861,7 @@
|
|
5847
5861
|
<xsl:text> </xsl:text>
|
5848
5862
|
</xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']/text()" mode="contents" priority="2">
|
5849
5863
|
<xsl:value-of select="."/>
|
5850
|
-
</xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']
|
5864
|
+
</xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']//text()" mode="bookmarks" priority="2">
|
5851
5865
|
<xsl:value-of select="."/>
|
5852
5866
|
</xsl:template><xsl:template match="node()" mode="contents">
|
5853
5867
|
<xsl:apply-templates mode="contents"/>
|
@@ -5945,6 +5959,8 @@
|
|
5945
5959
|
|
5946
5960
|
|
5947
5961
|
|
5962
|
+
|
5963
|
+
|
5948
5964
|
</fo:bookmark-tree>
|
5949
5965
|
</xsl:if>
|
5950
5966
|
</xsl:template><xsl:template name="insertFigureBookmarks">
|
@@ -6138,12 +6154,16 @@
|
|
6138
6154
|
<xsl:if test="$font-size != ''">
|
6139
6155
|
<xsl:attribute name="font-size">
|
6140
6156
|
<xsl:choose>
|
6157
|
+
<xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
|
6158
|
+
<xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
|
6141
6159
|
<xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
|
6142
6160
|
<xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
|
6143
6161
|
</xsl:choose>
|
6144
6162
|
</xsl:attribute>
|
6145
6163
|
</xsl:if>
|
6146
6164
|
|
6165
|
+
|
6166
|
+
|
6147
6167
|
<xsl:apply-templates/>
|
6148
6168
|
</fo:block>
|
6149
6169
|
|
@@ -6386,7 +6406,8 @@
|
|
6386
6406
|
</fo:block>
|
6387
6407
|
</fo:table-cell>
|
6388
6408
|
</xsl:template><xsl:template match="*[local-name() = 'p'][@class='RecommendationTitle' or @class = 'RecommendationTestTitle']" priority="2">
|
6389
|
-
<fo:block font-size="11pt"
|
6409
|
+
<fo:block font-size="11pt">
|
6410
|
+
|
6390
6411
|
<xsl:apply-templates/>
|
6391
6412
|
</fo:block>
|
6392
6413
|
</xsl:template><xsl:template match="*[local-name() = 'p2'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]">
|
@@ -6491,6 +6512,7 @@
|
|
6491
6512
|
</xsl:choose>
|
6492
6513
|
</xsl:template><xsl:template match="*[local-name() = 'termsource']" name="termsource">
|
6493
6514
|
<fo:block xsl:use-attribute-sets="termsource-style">
|
6515
|
+
|
6494
6516
|
<!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
|
6495
6517
|
<xsl:variable name="termsource_text">
|
6496
6518
|
<xsl:apply-templates/>
|
@@ -6501,13 +6523,15 @@
|
|
6501
6523
|
<!-- <xsl:apply-templates /> -->
|
6502
6524
|
<xsl:copy-of select="$termsource_text"/>
|
6503
6525
|
</xsl:when>
|
6504
|
-
<xsl:otherwise>
|
6526
|
+
<xsl:otherwise>
|
6527
|
+
|
6505
6528
|
|
6506
6529
|
<xsl:text>[</xsl:text>
|
6507
6530
|
|
6508
6531
|
<!-- <xsl:apply-templates /> -->
|
6509
6532
|
<xsl:copy-of select="$termsource_text"/>
|
6510
6533
|
|
6534
|
+
|
6511
6535
|
<xsl:text>]</xsl:text>
|
6512
6536
|
|
6513
6537
|
</xsl:otherwise>
|
@@ -6591,12 +6615,20 @@
|
|
6591
6615
|
</xsl:template><xsl:template match="*[local-name() = 'author']">
|
6592
6616
|
<xsl:text>— </xsl:text>
|
6593
6617
|
<xsl:apply-templates/>
|
6594
|
-
</xsl:template><xsl:
|
6618
|
+
</xsl:template><xsl:variable name="bibitem_hidden_">
|
6619
|
+
<xsl:for-each select="//*[local-name() = 'bibitem'][@hidden='true']">
|
6620
|
+
<xsl:copy-of select="."/>
|
6621
|
+
</xsl:for-each>
|
6622
|
+
<xsl:for-each select="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem']">
|
6623
|
+
<xsl:copy-of select="."/>
|
6624
|
+
</xsl:for-each>
|
6625
|
+
</xsl:variable><xsl:variable name="bibitem_hidden" select="xalan:nodeset($bibitem_hidden_)"/><xsl:template match="*[local-name() = 'eref']">
|
6595
6626
|
|
6596
6627
|
<xsl:variable name="bibitemid">
|
6597
6628
|
<xsl:choose>
|
6598
|
-
<xsl:when test="//*[local-name() = 'bibitem'][@hidden='true' and @id = current()/@bibitemid]"
|
6599
|
-
<xsl:when test="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"
|
6629
|
+
<!-- <xsl:when test="//*[local-name() = 'bibitem'][@hidden='true' and @id = current()/@bibitemid]"></xsl:when>
|
6630
|
+
<xsl:when test="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"></xsl:when> -->
|
6631
|
+
<xsl:when test="$bibitem_hidden/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"/>
|
6600
6632
|
<xsl:otherwise><xsl:value-of select="@bibitemid"/></xsl:otherwise>
|
6601
6633
|
</xsl:choose>
|
6602
6634
|
</xsl:variable>
|
@@ -6687,10 +6719,10 @@
|
|
6687
6719
|
</xsl:choose>
|
6688
6720
|
</xsl:variable>
|
6689
6721
|
|
6690
|
-
<xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
|
6722
|
+
<!-- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/> -->
|
6691
6723
|
|
6692
6724
|
<xsl:choose>
|
6693
|
-
<xsl:when test="$
|
6725
|
+
<xsl:when test="$lang = 'zh'">
|
6694
6726
|
<fo:inline><xsl:value-of select="$tab_zh"/></fo:inline>
|
6695
6727
|
</xsl:when>
|
6696
6728
|
<xsl:when test="../../@inline-header = 'true'">
|
@@ -7670,12 +7702,15 @@
|
|
7670
7702
|
<xsl:param name="default">left</xsl:param>
|
7671
7703
|
<xsl:attribute name="text-align">
|
7672
7704
|
<xsl:choose>
|
7673
|
-
<xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
|
7705
|
+
<xsl:when test="@align and not(@align = 'indent')"><xsl:value-of select="@align"/></xsl:when>
|
7674
7706
|
<xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
|
7675
7707
|
<xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when>
|
7676
7708
|
<xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
|
7677
7709
|
</xsl:choose>
|
7678
7710
|
</xsl:attribute>
|
7711
|
+
<xsl:if test="@align = 'indent'">
|
7712
|
+
<xsl:attribute name="margin-left">7mm</xsl:attribute>
|
7713
|
+
</xsl:if>
|
7679
7714
|
</xsl:template><xsl:template name="number-to-words">
|
7680
7715
|
<xsl:param name="number"/>
|
7681
7716
|
<xsl:param name="first"/>
|
data/metanorma-iec.gemspec
CHANGED
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.test_files = `git ls-files -- {spec}/*`.split("\n")
|
28
28
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
|
29
29
|
|
30
|
-
spec.add_dependency "metanorma-iso", "~> 1.
|
30
|
+
spec.add_dependency "metanorma-iso", "~> 1.10.0"
|
31
31
|
spec.add_dependency "ruby-jing"
|
32
32
|
|
33
33
|
spec.add_development_dependency "byebug"
|
@@ -133,7 +133,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
133
133
|
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
134
134
|
#{TERMS_BOILERPLATE}
|
135
135
|
<term id="term-term1">
|
136
|
-
<preferred>Term1</preferred>
|
136
|
+
<preferred><expression><name>Term1</name></expression></preferred>
|
137
137
|
<termnote id="_">
|
138
138
|
<p id="_">This is a note</p>
|
139
139
|
</termnote>
|
@@ -255,7 +255,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
255
255
|
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
256
256
|
#{TERMS_BOILERPLATE}
|
257
257
|
<term id="term-term1">
|
258
|
-
<preferred>Term1</preferred>
|
258
|
+
<preferred><expression><name>Term1</name></expression></preferred>
|
259
259
|
<termexample id="_">
|
260
260
|
<p id="_">This is an example</p>
|
261
261
|
</termexample>
|
@@ -467,77 +467,4 @@ RSpec.describe Asciidoctor::Iec do
|
|
467
467
|
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
468
468
|
.to be_equivalent_to xmlpp(output)
|
469
469
|
end
|
470
|
-
|
471
|
-
it "processes unmodified term sources" do
|
472
|
-
input = <<~INPUT
|
473
|
-
#{ASCIIDOC_BLANK_HDR}
|
474
|
-
== Terms and Definitions
|
475
|
-
|
476
|
-
=== Term1
|
477
|
-
|
478
|
-
[.source]
|
479
|
-
<<ISO2191,section=1>>
|
480
|
-
INPUT
|
481
|
-
output = <<~OUTPUT
|
482
|
-
#{@blank_hdr}
|
483
|
-
<sections>
|
484
|
-
<terms id="_" obligation="normative">
|
485
|
-
<title>Terms and definitions</title>
|
486
|
-
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
487
|
-
#{TERMS_BOILERPLATE}
|
488
|
-
<term id="term-term1">
|
489
|
-
<preferred>Term1</preferred>
|
490
|
-
<termsource status="identical">
|
491
|
-
<origin bibitemid="ISO2191" type="inline" citeas="">
|
492
|
-
<localityStack>
|
493
|
-
<locality type="section"><referenceFrom>1</referenceFrom></locality>
|
494
|
-
</localityStack>
|
495
|
-
</origin>
|
496
|
-
</termsource>
|
497
|
-
</term>
|
498
|
-
</terms>
|
499
|
-
</sections>
|
500
|
-
</iec-standard>
|
501
|
-
OUTPUT
|
502
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
503
|
-
.to be_equivalent_to xmlpp(output)
|
504
|
-
end
|
505
|
-
|
506
|
-
it "processes modified term sources" do
|
507
|
-
input = <<~INPUT
|
508
|
-
#{ASCIIDOC_BLANK_HDR}
|
509
|
-
== Terms and Definitions
|
510
|
-
|
511
|
-
=== Term1
|
512
|
-
|
513
|
-
[.source]
|
514
|
-
<<ISO2191,section=1>>, with adjustments
|
515
|
-
INPUT
|
516
|
-
output = <<~OUTPUT
|
517
|
-
#{@blank_hdr}
|
518
|
-
<sections>
|
519
|
-
<terms id="_" obligation="normative">
|
520
|
-
<title>Terms and definitions</title>
|
521
|
-
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
522
|
-
#{TERMS_BOILERPLATE}
|
523
|
-
<term id="term-term1">
|
524
|
-
<preferred>Term1</preferred>
|
525
|
-
<termsource status="modified">
|
526
|
-
<origin bibitemid="ISO2191" type="inline" citeas="">
|
527
|
-
<localityStack>
|
528
|
-
<locality type="section"><referenceFrom>1</referenceFrom></locality>
|
529
|
-
</localityStack>
|
530
|
-
</origin>
|
531
|
-
<modification>
|
532
|
-
<p id="_">with adjustments</p>
|
533
|
-
</modification>
|
534
|
-
</termsource>
|
535
|
-
</term>
|
536
|
-
</terms>
|
537
|
-
</sections>
|
538
|
-
</iec-standard>
|
539
|
-
OUTPUT
|
540
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
541
|
-
.to be_equivalent_to xmlpp(output)
|
542
|
-
end
|
543
470
|
end
|
@@ -96,94 +96,6 @@ end
|
|
96
96
|
OUTPUT
|
97
97
|
end
|
98
98
|
|
99
|
-
it "processes stem-only terms as admitted" do
|
100
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
101
|
-
#{ASCIIDOC_BLANK_HDR}
|
102
|
-
== Terms and Definitions
|
103
|
-
|
104
|
-
=== stem:[t_90]
|
105
|
-
|
106
|
-
stem:[t_91]
|
107
|
-
|
108
|
-
Time
|
109
|
-
INPUT
|
110
|
-
#{@blank_hdr}
|
111
|
-
<sections>
|
112
|
-
<terms id="_" obligation="normative">
|
113
|
-
<title>Terms and definitions</title>
|
114
|
-
<p id="_">For the purposes of this document,
|
115
|
-
the following terms and definitions apply.</p>
|
116
|
-
#{TERMS_BOILERPLATE}
|
117
|
-
<term id="term-t90"><preferred><stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mrow>
|
118
|
-
<mi>t</mi>
|
119
|
-
</mrow>
|
120
|
-
<mrow>
|
121
|
-
<mn>90</mn>
|
122
|
-
</mrow>
|
123
|
-
</msub></math></stem></preferred><admitted><stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mrow>
|
124
|
-
<mi>t</mi>
|
125
|
-
</mrow>
|
126
|
-
<mrow>
|
127
|
-
<mn>91</mn>
|
128
|
-
</mrow>
|
129
|
-
</msub></math></stem></admitted>
|
130
|
-
<definition><p id="_">Time</p></definition></term>
|
131
|
-
</terms>
|
132
|
-
</sections>
|
133
|
-
</iec-standard>
|
134
|
-
OUTPUT
|
135
|
-
end
|
136
|
-
|
137
|
-
it "permits multiple blocks in term definition paragraph" do
|
138
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
139
|
-
= Document title
|
140
|
-
Author
|
141
|
-
:docfile: test.adoc
|
142
|
-
:nodoc:
|
143
|
-
:novalid:
|
144
|
-
:stem:
|
145
|
-
:no-isobib:
|
146
|
-
|
147
|
-
== Terms and Definitions
|
148
|
-
|
149
|
-
=== stem:[t_90]
|
150
|
-
|
151
|
-
[stem]
|
152
|
-
++++
|
153
|
-
t_A
|
154
|
-
++++
|
155
|
-
|
156
|
-
This paragraph is extraneous
|
157
|
-
INPUT
|
158
|
-
#{@blank_hdr}
|
159
|
-
<sections>
|
160
|
-
<terms id="_" obligation="normative">
|
161
|
-
<title>Terms and definitions</title>
|
162
|
-
<p id="_">For the purposes of this document,
|
163
|
-
the following terms and definitions apply.</p>
|
164
|
-
#{TERMS_BOILERPLATE}
|
165
|
-
<term id="term-t90"><preferred><stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mrow>
|
166
|
-
<mi>t</mi>
|
167
|
-
</mrow>
|
168
|
-
<mrow>
|
169
|
-
<mn>90</mn>
|
170
|
-
</mrow>
|
171
|
-
</msub></math></stem></preferred><definition><formula id="_">
|
172
|
-
<stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mrow>
|
173
|
-
<mi>t</mi>
|
174
|
-
</mrow>
|
175
|
-
<mrow>
|
176
|
-
<mi>A</mi>
|
177
|
-
</mrow>
|
178
|
-
</msub></math></stem>
|
179
|
-
</formula><p id="_">This paragraph is extraneous</p></definition>
|
180
|
-
</term>
|
181
|
-
</terms>
|
182
|
-
</sections>
|
183
|
-
</iec-standard>
|
184
|
-
OUTPUT
|
185
|
-
end
|
186
|
-
|
187
99
|
it "keeps any initial boilerplate from terms and definitions" do
|
188
100
|
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
189
101
|
#{ASCIIDOC_BLANK_HDR}
|
@@ -210,8 +122,8 @@ end
|
|
210
122
|
</li>
|
211
123
|
</ul>
|
212
124
|
<term id="term-time">
|
213
|
-
<preferred>Time</preferred>
|
214
|
-
<definition><p id="_">This paragraph is extraneous</p></definition>
|
125
|
+
<preferred><expression><name>Time</name></expression></preferred>
|
126
|
+
<definition><verbaldefinition><p id="_">This paragraph is extraneous</p></verbaldefinition></definition>
|
215
127
|
</term></terms>
|
216
128
|
</sections>
|
217
129
|
</iec-standard>
|
@@ -254,38 +166,6 @@ end
|
|
254
166
|
OUTPUT
|
255
167
|
end
|
256
168
|
|
257
|
-
it "processes localities in term sources" do
|
258
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
259
|
-
#{ASCIIDOC_BLANK_HDR}
|
260
|
-
== Terms and Definitions
|
261
|
-
|
262
|
-
=== Term1
|
263
|
-
|
264
|
-
[.source]
|
265
|
-
<<ISO2191,section=1>>
|
266
|
-
INPUT
|
267
|
-
#{@blank_hdr}
|
268
|
-
<sections>
|
269
|
-
<terms id="_" obligation="normative">
|
270
|
-
<title>Terms and definitions</title>
|
271
|
-
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
272
|
-
#{TERMS_BOILERPLATE}
|
273
|
-
<term id="term-term1">
|
274
|
-
<preferred>Term1</preferred>
|
275
|
-
<termsource status="identical">
|
276
|
-
<origin bibitemid="ISO2191" type="inline" citeas="">
|
277
|
-
<localityStack>
|
278
|
-
<locality type="section"><referenceFrom>1</referenceFrom></locality>
|
279
|
-
</localityStack>
|
280
|
-
</origin>
|
281
|
-
</termsource>
|
282
|
-
</term>
|
283
|
-
</terms>
|
284
|
-
</sections>
|
285
|
-
</iec-standard>
|
286
|
-
OUTPUT
|
287
|
-
end
|
288
|
-
|
289
169
|
it "removes extraneous material from Normative References" do
|
290
170
|
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
291
171
|
#{ASCIIDOC_BLANK_HDR}
|
@@ -9,7 +9,7 @@ end
|
|
9
9
|
|
10
10
|
|
11
11
|
it "generates reference boilerplate for IEV" do
|
12
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
12
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
13
13
|
= Document title
|
14
14
|
Author
|
15
15
|
:docfile: test.adoc
|
@@ -90,7 +90,7 @@ end
|
|
90
90
|
end
|
91
91
|
|
92
92
|
it "generates terms boilerplate for IEV" do
|
93
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
93
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
94
94
|
= Document title
|
95
95
|
Author
|
96
96
|
:docfile: test.adoc
|
@@ -157,7 +157,7 @@ INPUT
|
|
157
157
|
<terms id='_' obligation='normative'>
|
158
158
|
<title>General</title>
|
159
159
|
<term id='term-term-1'>
|
160
|
-
<preferred>Term 1</preferred>
|
160
|
+
<preferred><expression><name>Term 1</name></expression></preferred>
|
161
161
|
</term>
|
162
162
|
</terms>
|
163
163
|
</clause>
|
@@ -168,7 +168,7 @@ OUTPUT
|
|
168
168
|
end
|
169
169
|
|
170
170
|
it "uses IEV introduction title" do
|
171
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT",
|
171
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
172
172
|
= Document title
|
173
173
|
Author
|
174
174
|
:docfile: test.adoc
|
@@ -5,51 +5,6 @@ RSpec.describe Asciidoctor::Iec do
|
|
5
5
|
@blank_hdr = blank_hdr_gen
|
6
6
|
end
|
7
7
|
|
8
|
-
it "processes inline_quoted formatting" do
|
9
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
10
|
-
#{ASCIIDOC_BLANK_HDR}
|
11
|
-
_emphasis_
|
12
|
-
*strong*
|
13
|
-
`monospace`
|
14
|
-
"double quote"
|
15
|
-
'single quote'
|
16
|
-
super^script^
|
17
|
-
sub~script~
|
18
|
-
stem:[a_90]
|
19
|
-
stem:[<mml:math><mml:msub xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"> <mml:mrow> <mml:mrow> <mml:mi mathvariant="bold-italic">F</mml:mi> </mml:mrow> </mml:mrow> <mml:mrow> <mml:mrow> <mml:mi mathvariant="bold-italic">Α</mml:mi> </mml:mrow> </mml:mrow> </mml:msub> </mml:math>]
|
20
|
-
[alt]#alt#
|
21
|
-
[deprecated]#deprecated#
|
22
|
-
[domain]#domain#
|
23
|
-
[strike]#strike#
|
24
|
-
[smallcap]#smallcap#
|
25
|
-
INPUT
|
26
|
-
#{@blank_hdr}
|
27
|
-
<sections>
|
28
|
-
<em>emphasis</em>
|
29
|
-
<strong>strong</strong>
|
30
|
-
<tt>monospace</tt>
|
31
|
-
“double quote”
|
32
|
-
‘single quote’
|
33
|
-
super<sup>script</sup>
|
34
|
-
sub<sub>script</sub>
|
35
|
-
<stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mrow>
|
36
|
-
<mi>a</mi>
|
37
|
-
</mrow>
|
38
|
-
<mrow>
|
39
|
-
<mn>90</mn>
|
40
|
-
</mrow>
|
41
|
-
</msub></math></stem>
|
42
|
-
<stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub> <mrow> <mrow> <mi mathvariant="bold-italic">F</mi> </mrow> </mrow> <mrow> <mrow> <mi mathvariant="bold-italic">Α</mi> </mrow> </mrow> </msub> </math></stem>
|
43
|
-
<admitted>alt</admitted>
|
44
|
-
<deprecates>deprecated</deprecates>
|
45
|
-
<domain>domain</domain>
|
46
|
-
<strike>strike</strike>
|
47
|
-
<smallcap>smallcap</smallcap>
|
48
|
-
</sections>
|
49
|
-
</iec-standard>
|
50
|
-
OUTPUT
|
51
|
-
end
|
52
|
-
|
53
8
|
it "processes breaks" do
|
54
9
|
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
55
10
|
#{ASCIIDOC_BLANK_HDR}
|
@@ -75,13 +75,13 @@ end
|
|
75
75
|
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
76
76
|
#{TERMS_BOILERPLATE}
|
77
77
|
<term id="term-term1">
|
78
|
-
<preferred>Term1</preferred>
|
78
|
+
<preferred><expression><name>Term1</name></expression></preferred>
|
79
79
|
</term>
|
80
80
|
</terms>
|
81
81
|
<clause id="_" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="_" obligation="normative">
|
82
82
|
<title>Normal Terms</title>
|
83
83
|
<term id="term-term2">
|
84
|
-
<preferred>Term2</preferred>
|
84
|
+
<preferred><expression><name>Term2</name></expression></preferred>
|
85
85
|
</term>
|
86
86
|
</terms>
|
87
87
|
<definitions id="_" obligation="normative"><title>Symbols and abbreviated terms</title></definitions></clause>
|
@@ -197,7 +197,7 @@ end
|
|
197
197
|
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
198
198
|
#{TERMS_BOILERPLATE}
|
199
199
|
<term id="term-term1">
|
200
|
-
<preferred>Term1</preferred>
|
200
|
+
<preferred><expression><name>Term1</name></expression></preferred>
|
201
201
|
</term>
|
202
202
|
</terms>
|
203
203
|
<clause id='_' obligation='normative'>
|
@@ -205,7 +205,7 @@ end
|
|
205
205
|
<terms id='_' obligation='normative'>
|
206
206
|
<title>Normal Terms</title>
|
207
207
|
<term id='term-term2'>
|
208
|
-
<preferred>Term2</preferred>
|
208
|
+
<preferred><expression><name>Term2</name></expression></preferred>
|
209
209
|
</term>
|
210
210
|
</terms>
|
211
211
|
<definitions id='_' obligation="normative">
|
data/spec/isodoc/iev_spec.rb
CHANGED
@@ -242,7 +242,7 @@ RSpec.describe IsoDoc do
|
|
242
242
|
<clause id="_terms_and_definitions" obligation="normative"><title>Terms and definitions</title>
|
243
243
|
<terms id="_general" obligation="normative"><title>General</title>
|
244
244
|
<term id="paddy1"><preferred>paddy</preferred>
|
245
|
-
<definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
|
245
|
+
<definition><verbaldefinition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></verbaldefinition></definition>
|
246
246
|
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f892">
|
247
247
|
<p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
|
248
248
|
<ul>
|
@@ -264,7 +264,7 @@ RSpec.describe IsoDoc do
|
|
264
264
|
<admitted>rough rice</admitted>
|
265
265
|
<deprecates>cargo rice</deprecates>
|
266
266
|
<domain>rice</domain>
|
267
|
-
<definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
|
267
|
+
<definition><verbaldefinition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></verbaldefinition></definition>
|
268
268
|
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f893">
|
269
269
|
<ul>
|
270
270
|
<li>A</li>
|
@@ -452,7 +452,7 @@ RSpec.describe IsoDoc do
|
|
452
452
|
<clause id="_terms_and_definitions" obligation="normative" displayorder="1"><title>Terms and definitions</title>
|
453
453
|
<terms id="_general" obligation="normative"><title>General</title>
|
454
454
|
<term id="paddy1"><preferred>paddy</preferred>
|
455
|
-
<definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
|
455
|
+
<definition><verbaldefinition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></verbaldefinition></definition>
|
456
456
|
<termsource status="modified">
|
457
457
|
<origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality>ISO 7301:2011, 3.1</origin>
|
458
458
|
<modification>
|
data/spec/isodoc/terms_spec.rb
CHANGED
@@ -9,7 +9,7 @@ RSpec.describe IsoDoc do
|
|
9
9
|
|
10
10
|
<term id="paddy1"><preferred>paddy</preferred>
|
11
11
|
<domain>rice</domain>
|
12
|
-
<definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
|
12
|
+
<definition><verbaldefinition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></verbaldefinition></definition>
|
13
13
|
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f892">
|
14
14
|
<p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
|
15
15
|
<ul>
|
@@ -33,7 +33,7 @@ RSpec.describe IsoDoc do
|
|
33
33
|
<preferred>paddy</preferred><admitted>paddy rice</admitted>
|
34
34
|
<admitted>rough rice</admitted>
|
35
35
|
<deprecates>cargo rice</deprecates>
|
36
|
-
<definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
|
36
|
+
<definition><verbaldefinition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></verbaldefinition></definition>
|
37
37
|
<termnote id="_671a1994-4783-40d0-bc81-987d06ffb74e">
|
38
38
|
<p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p>
|
39
39
|
</termnote>
|