metanorma-iec 1.4.2 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +4 -32
  3. data/.gitignore +14 -0
  4. data/Gemfile +6 -0
  5. data/Rakefile +1 -1
  6. data/lib/isodoc/iec/base_convert.rb +25 -59
  7. data/lib/isodoc/iec/html/htmlstyle.css +38 -6
  8. data/lib/isodoc/iec/html/htmlstyle.scss +35 -6
  9. data/lib/isodoc/iec/html/isodoc.css +1 -2
  10. data/lib/isodoc/iec/html/isodoc.scss +1 -2
  11. data/lib/isodoc/iec/html/scripts.html +0 -1
  12. data/lib/isodoc/iec/html/wordstyle.css +13 -11
  13. data/lib/isodoc/iec/html/wordstyle.scss +13 -11
  14. data/lib/isodoc/iec/html_convert.rb +2 -1
  15. data/lib/isodoc/iec/iec.international-standard.xsl +724 -330
  16. data/lib/isodoc/iec/presentation_xml_convert.rb +193 -5
  17. data/lib/isodoc/iec/xref.rb +9 -8
  18. data/lib/{asciidoctor → metanorma}/iec/basicdoc.rng +0 -0
  19. data/lib/{asciidoctor → metanorma}/iec/biblio.rng +0 -0
  20. data/lib/metanorma/iec/converter.rb +143 -0
  21. data/lib/{asciidoctor → metanorma}/iec/front.rb +3 -4
  22. data/lib/{asciidoctor → metanorma}/iec/iec.rng +48 -0
  23. data/lib/{asciidoctor → metanorma}/iec/iec_intro_en.xml +0 -0
  24. data/lib/{asciidoctor → metanorma}/iec/iec_intro_fr.xml +0 -0
  25. data/lib/{asciidoctor → metanorma}/iec/isodoc.rng +90 -18
  26. data/lib/{asciidoctor → metanorma}/iec/isostandard.rng +14 -0
  27. data/lib/metanorma/iec/processor.rb +15 -8
  28. data/lib/{asciidoctor → metanorma}/iec/reqt.rng +0 -0
  29. data/lib/metanorma/iec/version.rb +1 -1
  30. data/lib/metanorma-iec.rb +1 -1
  31. data/metanorma-iec.gemspec +3 -3
  32. data/spec/isodoc/iev_spec.rb +462 -120
  33. data/spec/isodoc/postproc_spec.rb +2 -5
  34. data/spec/isodoc/ref_spec.rb +359 -353
  35. data/spec/isodoc/terms_spec.rb +183 -181
  36. data/spec/{asciidoctor → metanorma}/base_spec.rb +1 -5
  37. data/spec/{asciidoctor → metanorma}/blocks_spec.rb +1 -1
  38. data/spec/metanorma/cleanup_spec.rb +374 -0
  39. data/spec/metanorma/iev_spec.rb +248 -0
  40. data/spec/{asciidoctor → metanorma}/inline_spec.rb +1 -1
  41. data/spec/{asciidoctor → metanorma}/lists_spec.rb +1 -1
  42. data/spec/metanorma/processor_spec.rb +139 -44
  43. data/spec/{asciidoctor → metanorma}/section_spec.rb +1 -1
  44. data/spec/{asciidoctor → metanorma}/validate_spec.rb +1 -1
  45. data/spec/spec_helper.rb +12 -14
  46. metadata +26 -26
  47. data/lib/asciidoctor/iec/converter.rb +0 -105
  48. data/spec/asciidoctor/cleanup_spec.rb +0 -345
  49. data/spec/asciidoctor/iev_spec.rb +0 -243
@@ -32,6 +32,19 @@
32
32
  <ref name="DocumentType"/>
33
33
  </element>
34
34
  </define>
35
+ <define name="bibitem">
36
+ <element name="bibitem">
37
+ <attribute name="id">
38
+ <data type="ID"/>
39
+ </attribute>
40
+ <optional>
41
+ <attribute name="hidden">
42
+ <data type="boolean"/>
43
+ </attribute>
44
+ </optional>
45
+ <ref name="BibliographicItem"/>
46
+ </element>
47
+ </define>
35
48
  <define name="section-title">
36
49
  <element name="title">
37
50
  <zeroOrMore>
@@ -58,7 +71,7 @@
58
71
  <attribute name="alt"/>
59
72
  </optional>
60
73
  <optional>
61
- <attribute name="updatetype">
74
+ <attribute name="update-type">
62
75
  <data type="boolean"/>
63
76
  </attribute>
64
77
  </optional>
@@ -690,6 +703,7 @@
690
703
  <ref name="terms"/>
691
704
  <ref name="term-clause"/>
692
705
  <ref name="definitions"/>
706
+ <ref name="floating-title"/>
693
707
  </choice>
694
708
  </oneOrMore>
695
709
  </element>
@@ -1680,6 +1694,7 @@
1680
1694
  <ref name="clause-subsection"/>
1681
1695
  <ref name="terms"/>
1682
1696
  <ref name="definitions"/>
1697
+ <ref name="floating-title"/>
1683
1698
  </choice>
1684
1699
  </oneOrMore>
1685
1700
  </choice>
@@ -1722,6 +1737,7 @@
1722
1737
  <ref name="terms"/>
1723
1738
  <ref name="definitions"/>
1724
1739
  <ref name="references"/>
1740
+ <ref name="floating-title"/>
1725
1741
  </choice>
1726
1742
  </zeroOrMore>
1727
1743
  </group>
@@ -1796,6 +1812,20 @@
1796
1812
  <data type="ID"/>
1797
1813
  </attribute>
1798
1814
  </optional>
1815
+ <optional>
1816
+ <attribute name="language"/>
1817
+ </optional>
1818
+ <optional>
1819
+ <attribute name="script"/>
1820
+ </optional>
1821
+ <optional>
1822
+ <attribute name="tag"/>
1823
+ </optional>
1824
+ <optional>
1825
+ <attribute name="multilingual-rendering">
1826
+ <ref name="MultilingualRenderingType"/>
1827
+ </attribute>
1828
+ </optional>
1799
1829
  <oneOrMore>
1800
1830
  <ref name="preferred"/>
1801
1831
  </oneOrMore>
@@ -1814,9 +1844,6 @@
1814
1844
  <optional>
1815
1845
  <ref name="termsubject"/>
1816
1846
  </optional>
1817
- <optional>
1818
- <ref name="termusage"/>
1819
- </optional>
1820
1847
  <oneOrMore>
1821
1848
  <ref name="termdefinition"/>
1822
1849
  </oneOrMore>
@@ -1880,17 +1907,37 @@
1880
1907
  </attribute>
1881
1908
  </optional>
1882
1909
  <optional>
1883
- <attribute name="geographicArea"/>
1910
+ <attribute name="geographic-area"/>
1884
1911
  </optional>
1885
1912
  <choice>
1886
1913
  <ref name="expression_designation"/>
1887
1914
  <ref name="letter_symbol_designation"/>
1888
1915
  <ref name="graphical_symbol_designation"/>
1889
1916
  </choice>
1917
+ <optional>
1918
+ <ref name="fieldofapplication"/>
1919
+ </optional>
1920
+ <optional>
1921
+ <ref name="usageinfo"/>
1922
+ </optional>
1890
1923
  <zeroOrMore>
1891
1924
  <ref name="termsource"/>
1892
1925
  </zeroOrMore>
1893
1926
  </define>
1927
+ <define name="fieldofapplication">
1928
+ <element name="field-of-application">
1929
+ <oneOrMore>
1930
+ <ref name="PureTextElement"/>
1931
+ </oneOrMore>
1932
+ </element>
1933
+ </define>
1934
+ <define name="usageinfo">
1935
+ <element name="usage-info">
1936
+ <oneOrMore>
1937
+ <ref name="PureTextElement"/>
1938
+ </oneOrMore>
1939
+ </element>
1940
+ </define>
1894
1941
  <define name="letter_symbol_designation">
1895
1942
  <element name="letter-symbol">
1896
1943
  <optional>
@@ -1942,11 +1989,15 @@
1942
1989
  </optional>
1943
1990
  <element name="name">
1944
1991
  <zeroOrMore>
1945
- <ref name="PureTextElement"/>
1992
+ <choice>
1993
+ <ref name="PureTextElement"/>
1994
+ <ref name="stem"/>
1995
+ <ref name="index"/>
1996
+ </choice>
1946
1997
  </zeroOrMore>
1947
1998
  </element>
1948
1999
  <optional>
1949
- <element name="abbreviationType">
2000
+ <element name="abbreviation-type">
1950
2001
  <ref name="AbbreviationType"/>
1951
2002
  </element>
1952
2003
  </optional>
@@ -1956,7 +2007,7 @@
1956
2007
  </element>
1957
2008
  </optional>
1958
2009
  <optional>
1959
- <element name="grammarInfo">
2010
+ <element name="grammar">
1960
2011
  <ref name="Grammar"/>
1961
2012
  </element>
1962
2013
  </optional>
@@ -1983,6 +2034,11 @@
1983
2034
  <ref name="GrammarGender"/>
1984
2035
  </element>
1985
2036
  </zeroOrMore>
2037
+ <zeroOrMore>
2038
+ <element name="number">
2039
+ <ref name="GrammarNumber"/>
2040
+ </element>
2041
+ </zeroOrMore>
1986
2042
  <optional>
1987
2043
  <element name="isPreposition">
1988
2044
  <data type="boolean"/>
@@ -2014,7 +2070,7 @@
2014
2070
  </element>
2015
2071
  </optional>
2016
2072
  <zeroOrMore>
2017
- <element name="grammarvalue">
2073
+ <element name="grammar-value">
2018
2074
  <text/>
2019
2075
  </element>
2020
2076
  </zeroOrMore>
@@ -2027,6 +2083,13 @@
2027
2083
  <value>common</value>
2028
2084
  </choice>
2029
2085
  </define>
2086
+ <define name="GrammarNumber">
2087
+ <choice>
2088
+ <value>singular</value>
2089
+ <value>dual</value>
2090
+ <value>plural</value>
2091
+ </choice>
2092
+ </define>
2030
2093
  <define name="termdomain">
2031
2094
  <element name="domain">
2032
2095
  <oneOrMore>
@@ -2041,13 +2104,6 @@
2041
2104
  </oneOrMore>
2042
2105
  </element>
2043
2106
  </define>
2044
- <define name="termusage">
2045
- <element name="usageinfo">
2046
- <oneOrMore>
2047
- <ref name="BasicBlock"/>
2048
- </oneOrMore>
2049
- </element>
2050
- </define>
2051
2107
  <define name="termdefinition">
2052
2108
  <element name="definition">
2053
2109
  <choice>
@@ -2061,13 +2117,16 @@
2061
2117
  </element>
2062
2118
  </define>
2063
2119
  <define name="verbaldefinition">
2064
- <element name="verbaldefinition">
2120
+ <element name="verbal-definition">
2065
2121
  <oneOrMore>
2066
2122
  <choice>
2067
2123
  <ref name="paragraph"/>
2068
2124
  <ref name="dl"/>
2069
2125
  <ref name="ol"/>
2070
2126
  <ref name="ul"/>
2127
+ <ref name="table"/>
2128
+ <ref name="figure"/>
2129
+ <ref name="formula"/>
2071
2130
  </choice>
2072
2131
  </oneOrMore>
2073
2132
  <zeroOrMore>
@@ -2076,7 +2135,7 @@
2076
2135
  </element>
2077
2136
  </define>
2078
2137
  <define name="nonverbalrep">
2079
- <element name="nonverbalrepresentation">
2138
+ <element name="non-verbal-representation">
2080
2139
  <oneOrMore>
2081
2140
  <choice>
2082
2141
  <ref name="table"/>
@@ -2491,4 +2550,17 @@
2491
2550
  </oneOrMore>
2492
2551
  </element>
2493
2552
  </define>
2553
+ <define name="floating-title">
2554
+ <element name="floating-title">
2555
+ <attribute name="id">
2556
+ <data type="ID"/>
2557
+ </attribute>
2558
+ <attribute name="depth">
2559
+ <data type="int"/>
2560
+ </attribute>
2561
+ <zeroOrMore>
2562
+ <ref name="TextElement"/>
2563
+ </zeroOrMore>
2564
+ </element>
2565
+ </define>
2494
2566
  </grammar>
@@ -159,6 +159,20 @@
159
159
  <data type="ID"/>
160
160
  </attribute>
161
161
  </optional>
162
+ <optional>
163
+ <attribute name="language"/>
164
+ </optional>
165
+ <optional>
166
+ <attribute name="script"/>
167
+ </optional>
168
+ <optional>
169
+ <attribute name="tag"/>
170
+ </optional>
171
+ <optional>
172
+ <attribute name="multilingual-rendering">
173
+ <ref name="MultilingualRenderingType"/>
174
+ </attribute>
175
+ </optional>
162
176
  <ref name="preferred"/>
163
177
  <zeroOrMore>
164
178
  <ref name="admitted"/>
@@ -3,8 +3,7 @@ require "metanorma/processor"
3
3
  module Metanorma
4
4
  module Iec
5
5
  class Processor < Metanorma::Processor
6
-
7
- def initialize
6
+ def initialize # rubocop:disable Lint/MissingSuper
8
7
  @short = :iec
9
8
  @input_format = :asciidoc
10
9
  @asciidoctor_backend = :iec
@@ -14,7 +13,8 @@ module Metanorma
14
13
  super.merge(
15
14
  html: "html",
16
15
  doc: "doc",
17
- pdf: "pdf"
16
+ pdf: "pdf",
17
+ sts: "sts.xml",
18
18
  )
19
19
  end
20
20
 
@@ -33,16 +33,23 @@ module Metanorma
33
33
  "Metanorma::Iec #{Metanorma::Iec::VERSION}"
34
34
  end
35
35
 
36
- def output(isodoc_node, inname, outname, format, options={})
36
+ def output(isodoc_node, inname, outname, format, options = {})
37
37
  case format
38
38
  when :html
39
- IsoDoc::Iec::HtmlConvert.new(options).convert(inname, isodoc_node, nil, outname)
39
+ IsoDoc::Iec::HtmlConvert.new(options).convert(inname, isodoc_node,
40
+ nil, outname)
40
41
  when :doc
41
- IsoDoc::Iec::WordConvert.new(options).convert(inname, isodoc_node, nil, outname)
42
+ IsoDoc::Iec::WordConvert.new(options).convert(inname, isodoc_node,
43
+ nil, outname)
42
44
  when :pdf
43
- IsoDoc::Iec::PdfConvert.new(options).convert(inname, isodoc_node, nil, outname)
45
+ IsoDoc::Iec::PdfConvert.new(options).convert(inname, isodoc_node,
46
+ nil, outname)
47
+ when :sts
48
+ IsoDoc::Iso::StsConvert.new(options).convert(inname, isodoc_node,
49
+ nil, outname)
44
50
  when :presentation
45
- IsoDoc::Iec::PresentationXMLConvert.new(options).convert(inname, isodoc_node, nil, outname)
51
+ IsoDoc::Iec::PresentationXMLConvert.new(options)
52
+ .convert(inname, isodoc_node, nil, outname)
46
53
  else
47
54
  super
48
55
  end
File without changes
@@ -1,6 +1,6 @@
1
1
  module Metanorma
2
2
  module Iec
3
- VERSION = "1.4.2".freeze
3
+ VERSION = "2.0.0".freeze
4
4
  end
5
5
  end
6
6
 
data/lib/metanorma-iec.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  require "asciidoctor" unless defined? Asciidoctor::Converter
2
- require_relative "asciidoctor/iec/converter"
2
+ require_relative "metanorma/iec/converter"
3
3
  require_relative "metanorma/iec/version"
4
4
  require "isodoc/iec/html_convert"
5
5
  require "isodoc/iec/word_convert"
@@ -27,14 +27,14 @@ 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.10.0"
30
+ spec.add_dependency "metanorma-iso", "~> 2.0.0"
31
31
  spec.add_dependency "ruby-jing"
32
32
 
33
- spec.add_development_dependency "byebug"
33
+ spec.add_development_dependency "debug"
34
34
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
35
35
  spec.add_development_dependency "guard", "~> 2.14"
36
36
  spec.add_development_dependency "guard-rspec", "~> 4.7"
37
- spec.add_development_dependency "iev", "~> 0.2.0"
37
+ spec.add_development_dependency "iev", "~> 0.3.0"
38
38
  spec.add_development_dependency "rake", "~> 13.0"
39
39
  spec.add_development_dependency "rspec", "~> 3.6"
40
40
  spec.add_development_dependency "rubocop", "~> 1.5.2"