metanorma-iec 1.3.13 → 1.4.0
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/isodoc.rng +218 -27
- data/lib/isodoc/iec/base_convert.rb +2 -2
- data/lib/isodoc/iec/iec.international-standard.xsl +7 -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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d63b1b7e31287d36e98cca120f39a2c42d3a035f1d25c4005f5201dc61cf6d7c
|
4
|
+
data.tar.gz: be21b434afd61f1b7e3f203e3971927f84cf1cf86aed5a61bceb47deffba5182
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67174492842cb02df5b2c32b4298f031e47eb838fad2899acdb2ef9cc5ca4cb14734fdccd9b0ab51b34805ae0b299b41ce119c605175b5e3da6d2c1dd4db951f
|
7
|
+
data.tar.gz: 6c64500d6a2b77c1324d22b04a0e3fee36e4c5f5b4c12aa604fde222691bbbc01ee2455bddc86471fcd16b82b287e15fccb83608ddee93b0c3d568626ca3cdff
|
@@ -17,7 +17,7 @@
|
|
17
17
|
these elements; we just want one namespace for any child grammars
|
18
18
|
of this.
|
19
19
|
-->
|
20
|
-
<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
20
|
+
<grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
21
21
|
<include href="reqt.rng"/>
|
22
22
|
<!-- include "biblio.rnc" { } -->
|
23
23
|
<include href="basicdoc.rng">
|
@@ -1803,17 +1803,20 @@
|
|
1803
1803
|
<ref name="admitted"/>
|
1804
1804
|
</zeroOrMore>
|
1805
1805
|
<zeroOrMore>
|
1806
|
-
<ref name="
|
1806
|
+
<ref name="deprecates"/>
|
1807
1807
|
</zeroOrMore>
|
1808
1808
|
<zeroOrMore>
|
1809
|
-
<ref name="
|
1809
|
+
<ref name="related"/>
|
1810
1810
|
</zeroOrMore>
|
1811
1811
|
<optional>
|
1812
1812
|
<ref name="termdomain"/>
|
1813
1813
|
</optional>
|
1814
|
-
<
|
1815
|
-
<ref name="
|
1816
|
-
</
|
1814
|
+
<optional>
|
1815
|
+
<ref name="termsubject"/>
|
1816
|
+
</optional>
|
1817
|
+
<optional>
|
1818
|
+
<ref name="termusage"/>
|
1819
|
+
</optional>
|
1817
1820
|
<oneOrMore>
|
1818
1821
|
<ref name="termdefinition"/>
|
1819
1822
|
</oneOrMore>
|
@@ -1830,41 +1833,200 @@
|
|
1830
1833
|
</define>
|
1831
1834
|
<define name="preferred">
|
1832
1835
|
<element name="preferred">
|
1833
|
-
<
|
1834
|
-
<ref name="TextElement"/>
|
1835
|
-
</oneOrMore>
|
1836
|
+
<ref name="Designation"/>
|
1836
1837
|
</element>
|
1837
1838
|
</define>
|
1838
1839
|
<define name="admitted">
|
1839
1840
|
<element name="admitted">
|
1840
|
-
<
|
1841
|
-
<ref name="TextElement"/>
|
1842
|
-
</oneOrMore>
|
1841
|
+
<ref name="Designation"/>
|
1843
1842
|
</element>
|
1844
1843
|
</define>
|
1845
1844
|
<define name="related">
|
1846
1845
|
<element name="related">
|
1846
|
+
<attribute name="type">
|
1847
|
+
<ref name="RelatedTermType"/>
|
1848
|
+
</attribute>
|
1849
|
+
<element name="preferred">
|
1850
|
+
<ref name="Designation"/>
|
1851
|
+
</element>
|
1852
|
+
<choice>
|
1853
|
+
<ref name="eref"/>
|
1854
|
+
<ref name="xref"/>
|
1855
|
+
<ref name="termref"/>
|
1856
|
+
</choice>
|
1857
|
+
</element>
|
1858
|
+
</define>
|
1859
|
+
<define name="RelatedTermType">
|
1860
|
+
<choice>
|
1861
|
+
<value>deprecates</value>
|
1862
|
+
<value>supersedes</value>
|
1863
|
+
<value>narrower</value>
|
1864
|
+
<value>broader</value>
|
1865
|
+
<value>equivalent</value>
|
1866
|
+
<value>compare</value>
|
1867
|
+
<value>contrast</value>
|
1868
|
+
<value>see</value>
|
1869
|
+
</choice>
|
1870
|
+
</define>
|
1871
|
+
<define name="deprecates">
|
1872
|
+
<element name="deprecates">
|
1873
|
+
<ref name="Designation"/>
|
1874
|
+
</element>
|
1875
|
+
</define>
|
1876
|
+
<define name="Designation">
|
1877
|
+
<optional>
|
1878
|
+
<attribute name="absent">
|
1879
|
+
<data type="boolean"/>
|
1880
|
+
</attribute>
|
1881
|
+
</optional>
|
1882
|
+
<optional>
|
1883
|
+
<attribute name="geographicArea"/>
|
1884
|
+
</optional>
|
1885
|
+
<choice>
|
1886
|
+
<ref name="expression_designation"/>
|
1887
|
+
<ref name="letter_symbol_designation"/>
|
1888
|
+
<ref name="graphical_symbol_designation"/>
|
1889
|
+
</choice>
|
1890
|
+
<zeroOrMore>
|
1891
|
+
<ref name="termsource"/>
|
1892
|
+
</zeroOrMore>
|
1893
|
+
</define>
|
1894
|
+
<define name="letter_symbol_designation">
|
1895
|
+
<element name="letter-symbol">
|
1847
1896
|
<optional>
|
1848
|
-
<attribute name="
|
1897
|
+
<attribute name="isInternational">
|
1898
|
+
<data type="boolean"/>
|
1899
|
+
</attribute>
|
1900
|
+
</optional>
|
1901
|
+
<element name="name">
|
1902
|
+
<oneOrMore>
|
1849
1903
|
<choice>
|
1850
|
-
<
|
1851
|
-
<
|
1852
|
-
<value>see</value>
|
1904
|
+
<ref name="PureTextElement"/>
|
1905
|
+
<ref name="stem"/>
|
1853
1906
|
</choice>
|
1907
|
+
</oneOrMore>
|
1908
|
+
</element>
|
1909
|
+
</element>
|
1910
|
+
</define>
|
1911
|
+
<define name="graphical_symbol_designation">
|
1912
|
+
<element name="graphical-symbol">
|
1913
|
+
<optional>
|
1914
|
+
<attribute name="isInternational">
|
1915
|
+
<data type="boolean"/>
|
1854
1916
|
</attribute>
|
1855
1917
|
</optional>
|
1856
|
-
<
|
1857
|
-
<ref name="TextElement"/>
|
1858
|
-
</oneOrMore>
|
1918
|
+
<ref name="figure"/>
|
1859
1919
|
</element>
|
1860
1920
|
</define>
|
1861
|
-
<define name="
|
1862
|
-
<element name="
|
1863
|
-
<
|
1864
|
-
<
|
1865
|
-
|
1921
|
+
<define name="expression_designation">
|
1922
|
+
<element name="expression">
|
1923
|
+
<optional>
|
1924
|
+
<attribute name="language">
|
1925
|
+
<a:documentation>ISO-639</a:documentation>
|
1926
|
+
</attribute>
|
1927
|
+
</optional>
|
1928
|
+
<optional>
|
1929
|
+
<attribute name="script">
|
1930
|
+
<a:documentation>ISO-15924</a:documentation>
|
1931
|
+
</attribute>
|
1932
|
+
</optional>
|
1933
|
+
<optional>
|
1934
|
+
<attribute name="type">
|
1935
|
+
<ref name="ExpressionDesignationType"/>
|
1936
|
+
</attribute>
|
1937
|
+
</optional>
|
1938
|
+
<optional>
|
1939
|
+
<attribute name="isInternational">
|
1940
|
+
<data type="boolean"/>
|
1941
|
+
</attribute>
|
1942
|
+
</optional>
|
1943
|
+
<element name="name">
|
1944
|
+
<zeroOrMore>
|
1945
|
+
<ref name="PureTextElement"/>
|
1946
|
+
</zeroOrMore>
|
1947
|
+
</element>
|
1948
|
+
<optional>
|
1949
|
+
<element name="abbreviationType">
|
1950
|
+
<ref name="AbbreviationType"/>
|
1951
|
+
</element>
|
1952
|
+
</optional>
|
1953
|
+
<optional>
|
1954
|
+
<element name="pronunciation">
|
1955
|
+
<ref name="LocalizedString"/>
|
1956
|
+
</element>
|
1957
|
+
</optional>
|
1958
|
+
<optional>
|
1959
|
+
<element name="grammarInfo">
|
1960
|
+
<ref name="Grammar"/>
|
1961
|
+
</element>
|
1962
|
+
</optional>
|
1866
1963
|
</element>
|
1867
1964
|
</define>
|
1965
|
+
<define name="ExpressionDesignationType">
|
1966
|
+
<choice>
|
1967
|
+
<value>prefix</value>
|
1968
|
+
<value>suffix</value>
|
1969
|
+
<value>abbreviation</value>
|
1970
|
+
<value>full</value>
|
1971
|
+
</choice>
|
1972
|
+
</define>
|
1973
|
+
<define name="AbbreviationType">
|
1974
|
+
<choice>
|
1975
|
+
<value>truncation</value>
|
1976
|
+
<value>acronym</value>
|
1977
|
+
<value>initialism</value>
|
1978
|
+
</choice>
|
1979
|
+
</define>
|
1980
|
+
<define name="Grammar">
|
1981
|
+
<zeroOrMore>
|
1982
|
+
<element name="gender">
|
1983
|
+
<ref name="GrammarGender"/>
|
1984
|
+
</element>
|
1985
|
+
</zeroOrMore>
|
1986
|
+
<optional>
|
1987
|
+
<element name="isPreposition">
|
1988
|
+
<data type="boolean"/>
|
1989
|
+
</element>
|
1990
|
+
</optional>
|
1991
|
+
<optional>
|
1992
|
+
<element name="isParticiple">
|
1993
|
+
<data type="boolean"/>
|
1994
|
+
</element>
|
1995
|
+
</optional>
|
1996
|
+
<optional>
|
1997
|
+
<element name="isAdjective">
|
1998
|
+
<data type="boolean"/>
|
1999
|
+
</element>
|
2000
|
+
</optional>
|
2001
|
+
<optional>
|
2002
|
+
<element name="isVerb">
|
2003
|
+
<data type="boolean"/>
|
2004
|
+
</element>
|
2005
|
+
</optional>
|
2006
|
+
<optional>
|
2007
|
+
<element name="isAdverb">
|
2008
|
+
<data type="boolean"/>
|
2009
|
+
</element>
|
2010
|
+
</optional>
|
2011
|
+
<optional>
|
2012
|
+
<element name="isNoun">
|
2013
|
+
<data type="boolean"/>
|
2014
|
+
</element>
|
2015
|
+
</optional>
|
2016
|
+
<zeroOrMore>
|
2017
|
+
<element name="grammarvalue">
|
2018
|
+
<text/>
|
2019
|
+
</element>
|
2020
|
+
</zeroOrMore>
|
2021
|
+
</define>
|
2022
|
+
<define name="GrammarGender">
|
2023
|
+
<choice>
|
2024
|
+
<value>masculine</value>
|
2025
|
+
<value>feminine</value>
|
2026
|
+
<value>neuter</value>
|
2027
|
+
<value>common</value>
|
2028
|
+
</choice>
|
2029
|
+
</define>
|
1868
2030
|
<define name="termdomain">
|
1869
2031
|
<element name="domain">
|
1870
2032
|
<oneOrMore>
|
@@ -1872,18 +2034,47 @@
|
|
1872
2034
|
</oneOrMore>
|
1873
2035
|
</element>
|
1874
2036
|
</define>
|
1875
|
-
<define name="
|
1876
|
-
<element name="
|
2037
|
+
<define name="termsubject">
|
2038
|
+
<element name="subject">
|
1877
2039
|
<oneOrMore>
|
1878
2040
|
<ref name="TextElement"/>
|
1879
2041
|
</oneOrMore>
|
1880
2042
|
</element>
|
1881
2043
|
</define>
|
2044
|
+
<define name="termusage">
|
2045
|
+
<element name="usageinfo">
|
2046
|
+
<oneOrMore>
|
2047
|
+
<ref name="BasicBlock"/>
|
2048
|
+
</oneOrMore>
|
2049
|
+
</element>
|
2050
|
+
</define>
|
1882
2051
|
<define name="termdefinition">
|
1883
2052
|
<element name="definition">
|
2053
|
+
<choice>
|
2054
|
+
<ref name="verbaldefinition"/>
|
2055
|
+
<ref name="nonverbalrep"/>
|
2056
|
+
<group>
|
2057
|
+
<ref name="verbaldefinition"/>
|
2058
|
+
<ref name="nonverbalrep"/>
|
2059
|
+
</group>
|
2060
|
+
</choice>
|
2061
|
+
</element>
|
2062
|
+
</define>
|
2063
|
+
<define name="verbaldefinition">
|
2064
|
+
<element name="verbaldefinition">
|
2065
|
+
<oneOrMore>
|
2066
|
+
<ref name="paragraph"/>
|
2067
|
+
</oneOrMore>
|
2068
|
+
<zeroOrMore>
|
2069
|
+
<ref name="termsource"/>
|
2070
|
+
</zeroOrMore>
|
2071
|
+
</element>
|
2072
|
+
</define>
|
2073
|
+
<define name="nonverbalrep">
|
2074
|
+
<element name="nonverbalrepresentation">
|
1884
2075
|
<oneOrMore>
|
1885
2076
|
<choice>
|
1886
|
-
<ref name="
|
2077
|
+
<ref name="table"/>
|
1887
2078
|
<ref name="figure"/>
|
1888
2079
|
<ref name="formula"/>
|
1889
2080
|
</choice>
|
@@ -56,10 +56,10 @@ module IsoDoc
|
|
56
56
|
return super unless @is_iev
|
57
57
|
end
|
58
58
|
|
59
|
-
def biblio_list(
|
59
|
+
def biblio_list(elem, div, biblio)
|
60
60
|
return super unless @is_iev
|
61
61
|
|
62
|
-
|
62
|
+
elem.children.each do |b|
|
63
63
|
parse(b, div) unless %w(title bibitem).include? b.name
|
64
64
|
end
|
65
65
|
end
|
@@ -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>
|
@@ -5487,6 +5489,7 @@
|
|
5487
5489
|
<xsl:otherwise>
|
5488
5490
|
<fo:block xsl:use-attribute-sets="image-style">
|
5489
5491
|
|
5492
|
+
|
5490
5493
|
<xsl:variable name="src">
|
5491
5494
|
<xsl:call-template name="image_src"/>
|
5492
5495
|
</xsl:variable>
|
@@ -5853,7 +5856,7 @@
|
|
5853
5856
|
<xsl:text> </xsl:text>
|
5854
5857
|
</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">
|
5855
5858
|
<xsl:value-of select="."/>
|
5856
|
-
</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']
|
5859
|
+
</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">
|
5857
5860
|
<xsl:value-of select="."/>
|
5858
5861
|
</xsl:template><xsl:template match="node()" mode="contents">
|
5859
5862
|
<xsl:apply-templates mode="contents"/>
|
@@ -5951,6 +5954,8 @@
|
|
5951
5954
|
|
5952
5955
|
|
5953
5956
|
|
5957
|
+
|
5958
|
+
|
5954
5959
|
</fo:bookmark-tree>
|
5955
5960
|
</xsl:if>
|
5956
5961
|
</xsl:template><xsl:template name="insertFigureBookmarks">
|
@@ -6501,6 +6506,7 @@
|
|
6501
6506
|
</xsl:choose>
|
6502
6507
|
</xsl:template><xsl:template match="*[local-name() = 'termsource']" name="termsource">
|
6503
6508
|
<fo:block xsl:use-attribute-sets="termsource-style">
|
6509
|
+
|
6504
6510
|
<!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
|
6505
6511
|
<xsl:variable name="termsource_text">
|
6506
6512
|
<xsl:apply-templates/>
|
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>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-iec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-iso
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: 1.10.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.
|
26
|
+
version: 1.10.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: ruby-jing
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -298,7 +298,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
298
298
|
- !ruby/object:Gem::Version
|
299
299
|
version: '0'
|
300
300
|
requirements: []
|
301
|
-
rubygems_version: 3.
|
301
|
+
rubygems_version: 3.2.22
|
302
302
|
signing_key:
|
303
303
|
specification_version: 4
|
304
304
|
summary: metanorma-iec lets you write IEC standards in AsciiDoc.
|