metanorma-standoc 1.4.4 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/lib/asciidoctor/standoc/base.rb +4 -3
- data/lib/asciidoctor/standoc/cleanup_boilerplate.rb +11 -24
- data/lib/asciidoctor/standoc/cleanup_section.rb +72 -5
- data/lib/asciidoctor/standoc/cleanup_terms.rb +10 -0
- data/lib/asciidoctor/standoc/converter.rb +0 -2
- data/lib/asciidoctor/standoc/isodoc.rng +12 -6
- data/lib/asciidoctor/standoc/ref.rb +24 -25
- data/lib/asciidoctor/standoc/section.rb +27 -25
- data/lib/asciidoctor/standoc/utils.rb +16 -0
- data/lib/metanorma/standoc/version.rb +1 -1
- data/metanorma-standoc.gemspec +1 -1
- data/spec/asciidoctor-standoc/base_spec.rb +1 -0
- data/spec/asciidoctor-standoc/blocks_spec.rb +12 -5
- data/spec/asciidoctor-standoc/cleanup_spec.rb +1216 -12
- data/spec/asciidoctor-standoc/inline_spec.rb +1 -1
- data/spec/asciidoctor-standoc/refs_dl_spec.rb +4 -4
- data/spec/asciidoctor-standoc/refs_spec.rb +16 -16
- data/spec/asciidoctor-standoc/section_spec.rb +42 -38
- data/spec/assets/i18n.yaml +17 -2
- data/spec/metanorma/processor_spec.rb +1 -2
- metadata +4 -8
- data/lib/asciidoctor-yaml/i18n-en.yaml +0 -20
- data/lib/asciidoctor-yaml/i18n-fr.yaml +0 -13
- data/lib/asciidoctor-yaml/i18n-zh-Hans.yaml +0 -15
- data/lib/asciidoctor/standoc/i18n.rb +0 -39
@@ -173,6 +173,22 @@ module Asciidoctor
|
|
173
173
|
|
174
174
|
SUBCLAUSE_XPATH = "//clause[not(parent::sections)]"\
|
175
175
|
"[not(ancestor::boilerplate)]".freeze
|
176
|
+
|
177
|
+
def isodoc(lang, script, i18nyaml = nil)
|
178
|
+
conv = html_converter(EmptyAttr.new)
|
179
|
+
i18n = conv.i18n_init(lang, script, i18nyaml)
|
180
|
+
conv.metadata_init(lang, script, i18n)
|
181
|
+
conv
|
182
|
+
end
|
183
|
+
|
184
|
+
class EmptyAttr
|
185
|
+
def attr(_x)
|
186
|
+
nil
|
187
|
+
end
|
188
|
+
def attributes
|
189
|
+
{}
|
190
|
+
end
|
191
|
+
end
|
176
192
|
end
|
177
193
|
end
|
178
194
|
end
|
data/metanorma-standoc.gemspec
CHANGED
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
|
|
28
28
|
|
29
29
|
spec.add_dependency "asciidoctor", "~> 2.0.0"
|
30
30
|
spec.add_dependency "ruby-jing"
|
31
|
-
spec.add_dependency "isodoc", "~> 1.
|
31
|
+
spec.add_dependency "isodoc", "~> 1.2.0"
|
32
32
|
spec.add_dependency "iev", "~> 0.2.1"
|
33
33
|
spec.add_dependency "relaton", "~> 1.2.0"
|
34
34
|
spec.add_dependency "relaton-iev", "~> 1.0.0"
|
@@ -414,6 +414,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
414
414
|
</bibdata>
|
415
415
|
<preface>
|
416
416
|
<abstract id='_'>
|
417
|
+
<title>Abstract</title>
|
417
418
|
<p id='_'>This is the abstract of the document</p>
|
418
419
|
<p id='_'>This is the second paragraph of the abstract of the document.</p>
|
419
420
|
</abstract>
|
@@ -361,6 +361,10 @@ RSpec.describe Asciidoctor::Standoc do
|
|
361
361
|
#{ASCIIDOC_BLANK_HDR}
|
362
362
|
== Terms and Definitions
|
363
363
|
|
364
|
+
NOTE: This is not a termnote
|
365
|
+
|
366
|
+
EXAMPLE: This is not a termexample
|
367
|
+
|
364
368
|
[.nonterm]
|
365
369
|
=== Term1
|
366
370
|
|
@@ -371,6 +375,9 @@ RSpec.describe Asciidoctor::Standoc do
|
|
371
375
|
<terms id="_" obligation="normative">
|
372
376
|
<title>Terms and definitions</title>
|
373
377
|
<p id="_">No terms and definitions are listed in this document.</p>
|
378
|
+
<note id='_'>
|
379
|
+
<p id='_'>This is not a termnote</p>
|
380
|
+
</note>
|
374
381
|
<clause id="_" inline-header="false" obligation="normative">
|
375
382
|
<title>Term1</title>
|
376
383
|
<note id="_">
|
@@ -397,12 +404,12 @@ RSpec.describe Asciidoctor::Standoc do
|
|
397
404
|
INPUT
|
398
405
|
#{BLANK_HDR}
|
399
406
|
<sections>
|
400
|
-
<terms id="_" obligation="normative"><title>Terms, definitions
|
407
|
+
<terms id="_" obligation="normative"><title>Terms, definitions and symbols</title>
|
401
408
|
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
402
409
|
<term id="_">
|
403
410
|
<preferred>Term1</preferred>
|
404
411
|
</term>
|
405
|
-
<definitions id="_">
|
412
|
+
<definitions id="_" obligation="normative" type="symbols">
|
406
413
|
<title>Symbols</title>
|
407
414
|
<note id="_">
|
408
415
|
<p id="_">This is a note</p>
|
@@ -598,11 +605,11 @@ RSpec.describe Asciidoctor::Standoc do
|
|
598
605
|
INPUT
|
599
606
|
#{BLANK_HDR}
|
600
607
|
<sections>
|
601
|
-
<terms id="_" obligation="normative"><title>Terms, definitions
|
608
|
+
<terms id="_" obligation="normative"><title>Terms, definitions and symbols</title>
|
602
609
|
<p id="_">For the purposes of this document, the following terms and definitions apply.</p><term id="_">
|
603
610
|
<preferred>Term1</preferred>
|
604
611
|
</term>
|
605
|
-
<definitions id="_">
|
612
|
+
<definitions id="_" obligation="normative" type="symbols">
|
606
613
|
<title>Symbols</title>
|
607
614
|
<example id="_">
|
608
615
|
<p id="_">This is an example</p>
|
@@ -679,7 +686,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
679
686
|
INPUT
|
680
687
|
#{BLANK_HDR}
|
681
688
|
<preface><foreword id="_" obligation="informative">
|
682
|
-
<title>
|
689
|
+
<title>Foreword</title>
|
683
690
|
<p id="_">This is a preamble</p>
|
684
691
|
</foreword></preface><sections>
|
685
692
|
<clause id="_" inline-header="false" obligation="normative">
|
@@ -360,7 +360,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
360
360
|
</p>
|
361
361
|
</foreword></preface><sections>
|
362
362
|
</sections><bibliography><references id="_" obligation="informative" normative="true">
|
363
|
-
<title>Normative
|
363
|
+
<title>Normative references</title>
|
364
364
|
#{NORM_REF_BOILERPLATE}
|
365
365
|
<bibitem id="iso216" type="standard">
|
366
366
|
<title format="text/plain">Reference</title>
|
@@ -438,7 +438,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
438
438
|
</p>
|
439
439
|
</foreword></preface><sections>
|
440
440
|
</sections><bibliography><references id="_" obligation="informative" normative="true">
|
441
|
-
<title>Normative
|
441
|
+
<title>Normative references</title>
|
442
442
|
#{NORM_REF_BOILERPLATE}
|
443
443
|
<bibitem id="iso216" type="standard">
|
444
444
|
<title format="text/plain">Reference</title>
|
@@ -538,7 +538,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
538
538
|
INPUT
|
539
539
|
#{BLANK_HDR}
|
540
540
|
<sections></sections>
|
541
|
-
<bibliography><references id="_" obligation="informative" normative="true"><title>Normative
|
541
|
+
<bibliography><references id="_" obligation="informative" normative="true"><title>Normative references</title>
|
542
542
|
#{NORM_REF_BOILERPLATE}
|
543
543
|
<bibitem id="iso216" type="standard">
|
544
544
|
<title format="text/plain">Reference</title>
|
@@ -967,7 +967,7 @@ end
|
|
967
967
|
</fn>
|
968
968
|
</p>
|
969
969
|
</clause></sections><bibliography><references id="_" obligation="informative" normative="true">
|
970
|
-
<title>Normative
|
970
|
+
<title>Normative references</title>
|
971
971
|
#{NORM_REF_BOILERPLATE}
|
972
972
|
<bibitem id="iso123" type="standard">
|
973
973
|
<title format="text/plain">Standard</title>
|
@@ -1198,7 +1198,7 @@ end
|
|
1198
1198
|
</origin>
|
1199
1199
|
</termsource>
|
1200
1200
|
</term></terms></sections><bibliography><references id="_" obligation="informative" normative="true">
|
1201
|
-
<title>Normative
|
1201
|
+
<title>Normative references</title>
|
1202
1202
|
#{NORM_REF_BOILERPLATE}
|
1203
1203
|
<bibitem type="standard" id="IEC60050-102">
|
1204
1204
|
<fetched>#{Date.today}</fetched>
|
@@ -1515,7 +1515,7 @@ OUTPUT
|
|
1515
1515
|
<sections>
|
1516
1516
|
|
1517
1517
|
</sections><bibliography><references id="_" obligation="informative" normative="true">
|
1518
|
-
<title>Normative
|
1518
|
+
<title>Normative references</title><p id="_">There are no normative references in this document.</p>
|
1519
1519
|
</references></bibliography>
|
1520
1520
|
</standard-document>
|
1521
1521
|
OUTPUT
|
@@ -1534,7 +1534,7 @@ OUTPUT
|
|
1534
1534
|
<sections>
|
1535
1535
|
|
1536
1536
|
</sections><bibliography><references id="_" obligation="informative" normative="true">
|
1537
|
-
<title>Normative
|
1537
|
+
<title>Normative references</title><p id="_">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>
|
1538
1538
|
<bibitem id="a">
|
1539
1539
|
<formattedref format="application/x-isodoc+xml">A</formattedref>
|
1540
1540
|
<docidentifier>b</docidentifier>
|
@@ -1563,7 +1563,7 @@ it "inserts boilerplate before empty Normative References in French" do
|
|
1563
1563
|
<sections>
|
1564
1564
|
|
1565
1565
|
</sections><bibliography><references id="_" obligation="informative" normative="true">
|
1566
|
-
<title>
|
1566
|
+
<title>Références normatives</title><p id="_">Le présent document ne contient aucune référence normative.</p>
|
1567
1567
|
</references></bibliography>
|
1568
1568
|
</standard-document>
|
1569
1569
|
OUTPUT
|
@@ -1608,7 +1608,7 @@ it "removes bibdata bibitem IDs" do
|
|
1608
1608
|
<sections> </sections>
|
1609
1609
|
<bibliography>
|
1610
1610
|
<references id='_' obligation='informative' normative="true">
|
1611
|
-
<title>Normative
|
1611
|
+
<title>Normative references</title>
|
1612
1612
|
<p id="_">There are no normative references in this document.</p>
|
1613
1613
|
</references>
|
1614
1614
|
</bibliography>
|
@@ -1672,7 +1672,7 @@ it "sorts symbols lists" do
|
|
1672
1672
|
INPUT
|
1673
1673
|
#{BLANK_HDR}
|
1674
1674
|
<sections>
|
1675
|
-
<definitions id='L'>
|
1675
|
+
<definitions id='L' obligation="normative">
|
1676
1676
|
<title>Symbols and abbreviated terms</title>
|
1677
1677
|
<dl id='_'>
|
1678
1678
|
<dt>x</dt>
|
@@ -1717,7 +1717,7 @@ it "sorts symbols lists" do
|
|
1717
1717
|
INPUT
|
1718
1718
|
#{BLANK_HDR}
|
1719
1719
|
<sections>
|
1720
|
-
<definitions id='L'>
|
1720
|
+
<definitions id='L' obligation="normative">
|
1721
1721
|
<title>Symbols and abbreviated terms</title>
|
1722
1722
|
<dl id='_'>
|
1723
1723
|
<dt>x</dt>
|
@@ -1888,7 +1888,7 @@ INPUT
|
|
1888
1888
|
<admonition id='_' type='important'>
|
1889
1889
|
<p id='_'>Notice which is very important</p>
|
1890
1890
|
</admonition>
|
1891
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1891
|
+
<clause id='_' inline-header='false' obligation='normative' type="scope">
|
1892
1892
|
<title>Scope</title>
|
1893
1893
|
<p id='_'>Scope statement</p>
|
1894
1894
|
</clause>
|
@@ -1899,6 +1899,1210 @@ OUTPUT
|
|
1899
1899
|
end
|
1900
1900
|
|
1901
1901
|
|
1902
|
+
it "processes section names, with footnotes" do
|
1903
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1904
|
+
#{ASCIIDOC_BLANK_HDR}
|
1905
|
+
.Foreword.footnote:[A]
|
1906
|
+
|
1907
|
+
Text
|
1908
|
+
|
1909
|
+
[abstract]
|
1910
|
+
== Abstract.footnote:[A]
|
1911
|
+
|
1912
|
+
Text
|
1913
|
+
|
1914
|
+
[heading=introduction]
|
1915
|
+
== Introduction.footnote:[A]
|
1916
|
+
|
1917
|
+
=== Introduction Subsection
|
1918
|
+
|
1919
|
+
[heading=acknowledgements]
|
1920
|
+
== Acknowledgements.footnote:[A]
|
1921
|
+
|
1922
|
+
[.preface]
|
1923
|
+
== Dedication
|
1924
|
+
|
1925
|
+
[heading=scope]
|
1926
|
+
== Scope.footnote:[A]
|
1927
|
+
|
1928
|
+
Text
|
1929
|
+
|
1930
|
+
[bibliography,heading=normative references]
|
1931
|
+
== Normative References.footnote:[A]
|
1932
|
+
|
1933
|
+
[bibliography,normative=true]
|
1934
|
+
== Normative References 2.footnote:[A]
|
1935
|
+
|
1936
|
+
[heading=terms and definitions]
|
1937
|
+
== Terms and Definitions.footnote:[A]
|
1938
|
+
|
1939
|
+
=== Term1
|
1940
|
+
|
1941
|
+
[heading="terms and definitions"]
|
1942
|
+
== Terms, Definitions, Symbols and Abbreviated Terms.footnote:[A]
|
1943
|
+
|
1944
|
+
[.nonterm]
|
1945
|
+
=== Introduction
|
1946
|
+
|
1947
|
+
==== Intro 1
|
1948
|
+
|
1949
|
+
=== Intro 2
|
1950
|
+
|
1951
|
+
[.nonterm]
|
1952
|
+
==== Intro 3
|
1953
|
+
|
1954
|
+
=== Intro 4
|
1955
|
+
|
1956
|
+
==== Intro 5
|
1957
|
+
|
1958
|
+
===== Term1
|
1959
|
+
|
1960
|
+
=== Normal Terms
|
1961
|
+
|
1962
|
+
==== Term2
|
1963
|
+
|
1964
|
+
[heading=symbols and abbreviated terms]
|
1965
|
+
=== Symbols and Abbreviated Terms.footnote:[A]
|
1966
|
+
|
1967
|
+
[.nonterm]
|
1968
|
+
==== General
|
1969
|
+
|
1970
|
+
[heading=symbols]
|
1971
|
+
==== Symbols 1.footnote:[A]
|
1972
|
+
|
1973
|
+
[heading=abbreviated terms]
|
1974
|
+
== Abbreviated Terms.footnote:[A]
|
1975
|
+
|
1976
|
+
== Clause 4
|
1977
|
+
|
1978
|
+
=== Introduction
|
1979
|
+
|
1980
|
+
=== Clause 4.2
|
1981
|
+
|
1982
|
+
== Terms and Definitions
|
1983
|
+
|
1984
|
+
[appendix]
|
1985
|
+
== Annex.footnote:[A]
|
1986
|
+
|
1987
|
+
=== Annex A.1
|
1988
|
+
|
1989
|
+
[bibliography,heading=bibliography]
|
1990
|
+
== Bibliography.footnote:[A]
|
1991
|
+
|
1992
|
+
[bibliography,normative=false]
|
1993
|
+
== Bibliography 2.footnote:[A]
|
1994
|
+
|
1995
|
+
=== Bibliography Subsection
|
1996
|
+
|
1997
|
+
INPUT
|
1998
|
+
<standard-document xmlns='https://www.metanorma.org/ns/standoc'>
|
1999
|
+
<bibdata type='standard'>
|
2000
|
+
<title language='en' format='text/plain'>Document title</title>
|
2001
|
+
<language>en</language>
|
2002
|
+
<script>Latn</script>
|
2003
|
+
<abstract>
|
2004
|
+
<p>Text</p>
|
2005
|
+
</abstract>
|
2006
|
+
<status>
|
2007
|
+
<stage>published</stage>
|
2008
|
+
</status>
|
2009
|
+
<copyright>
|
2010
|
+
<from>2020</from>
|
2011
|
+
</copyright>
|
2012
|
+
<ext>
|
2013
|
+
<doctype>article</doctype>
|
2014
|
+
</ext>
|
2015
|
+
</bibdata>
|
2016
|
+
<preface>
|
2017
|
+
<abstract id='_'>
|
2018
|
+
<title>Abstract</title>
|
2019
|
+
<p id='_'>Text</p>
|
2020
|
+
</abstract>
|
2021
|
+
<foreword id='_' obligation='informative'>
|
2022
|
+
<title>
|
2023
|
+
Foreword
|
2024
|
+
<fn reference='1'>
|
2025
|
+
<p id='_'>A</p>
|
2026
|
+
</fn>
|
2027
|
+
</title>
|
2028
|
+
<p id='_'>Text</p>
|
2029
|
+
</foreword>
|
2030
|
+
<introduction id='_' obligation='informative'>
|
2031
|
+
<title>Introduction</title>
|
2032
|
+
<clause id='_' inline-header='false' obligation='informative'>
|
2033
|
+
<title>Introduction Subsection</title>
|
2034
|
+
</clause>
|
2035
|
+
</introduction>
|
2036
|
+
<clause id='_' inline-header='false' obligation='informative'>
|
2037
|
+
<title>Dedication</title>
|
2038
|
+
</clause>
|
2039
|
+
<acknowledgements id='_' obligation='informative'>
|
2040
|
+
<title>
|
2041
|
+
Acknowledgements
|
2042
|
+
<fn reference='1'>
|
2043
|
+
<p id='_'>A</p>
|
2044
|
+
</fn>
|
2045
|
+
</title>
|
2046
|
+
</acknowledgements>
|
2047
|
+
</preface>
|
2048
|
+
<sections>
|
2049
|
+
<clause id='_' type='scope' inline-header='false' obligation='normative'>
|
2050
|
+
<title>
|
2051
|
+
Scope
|
2052
|
+
<fn reference='1'>
|
2053
|
+
<p id='_'>A</p>
|
2054
|
+
</fn>
|
2055
|
+
</title>
|
2056
|
+
<p id='_'>Text</p>
|
2057
|
+
</clause>
|
2058
|
+
<terms id='_' obligation='normative'>
|
2059
|
+
<title>
|
2060
|
+
Terms and definitions
|
2061
|
+
<fn reference='1'>
|
2062
|
+
<p id='_'>A</p>
|
2063
|
+
</fn>
|
2064
|
+
</title>
|
2065
|
+
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
2066
|
+
<term id='_'>
|
2067
|
+
<preferred>Term1</preferred>
|
2068
|
+
</term>
|
2069
|
+
</terms>
|
2070
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2071
|
+
<title>
|
2072
|
+
Terms, Definitions, Symbols and Abbreviated Terms.
|
2073
|
+
<fn reference='1'>
|
2074
|
+
<p id='_'>A</p>
|
2075
|
+
</fn>
|
2076
|
+
</title>
|
2077
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2078
|
+
<title>Introduction</title>
|
2079
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2080
|
+
<title>Intro 1</title>
|
2081
|
+
</clause>
|
2082
|
+
</clause>
|
2083
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2084
|
+
<title>Intro 2</title>
|
2085
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2086
|
+
<title>Intro 3</title>
|
2087
|
+
</clause>
|
2088
|
+
</clause>
|
2089
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2090
|
+
<title>Intro 4</title>
|
2091
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2092
|
+
<title>Intro 5</title>
|
2093
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2094
|
+
<title>Term1</title>
|
2095
|
+
</clause>
|
2096
|
+
</clause>
|
2097
|
+
</clause>
|
2098
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2099
|
+
<title>Normal Terms</title>
|
2100
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2101
|
+
<title>Term2</title>
|
2102
|
+
</clause>
|
2103
|
+
</clause>
|
2104
|
+
<definitions id='_' obligation='normative'>
|
2105
|
+
<title>
|
2106
|
+
Symbols and abbreviated terms
|
2107
|
+
<fn reference='1'>
|
2108
|
+
<p id='_'>A</p>
|
2109
|
+
</fn>
|
2110
|
+
</title>
|
2111
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2112
|
+
<title>General</title>
|
2113
|
+
</clause>
|
2114
|
+
<definitions id='_' type='symbols' obligation='normative'>
|
2115
|
+
<title>
|
2116
|
+
Symbols
|
2117
|
+
<fn reference='1'>
|
2118
|
+
<p id='_'>A</p>
|
2119
|
+
</fn>
|
2120
|
+
</title>
|
2121
|
+
</definitions>
|
2122
|
+
</definitions>
|
2123
|
+
</clause>
|
2124
|
+
<definitions id='_' type='abbreviated_terms' obligation='normative'>
|
2125
|
+
<title>
|
2126
|
+
Abbreviated terms
|
2127
|
+
<fn reference='1'>
|
2128
|
+
<p id='_'>A</p>
|
2129
|
+
</fn>
|
2130
|
+
</title>
|
2131
|
+
</definitions>
|
2132
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2133
|
+
<title>Clause 4</title>
|
2134
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2135
|
+
<title>Introduction</title>
|
2136
|
+
</clause>
|
2137
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2138
|
+
<title>Clause 4.2</title>
|
2139
|
+
</clause>
|
2140
|
+
</clause>
|
2141
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2142
|
+
<title>Terms and Definitions</title>
|
2143
|
+
</clause>
|
2144
|
+
</sections>
|
2145
|
+
<annex id='_' inline-header='false' obligation='normative'>
|
2146
|
+
<title>
|
2147
|
+
Annex.
|
2148
|
+
<fn reference='1'>
|
2149
|
+
<p id='_'>A</p>
|
2150
|
+
</fn>
|
2151
|
+
</title>
|
2152
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2153
|
+
<title>Annex A.1</title>
|
2154
|
+
</clause>
|
2155
|
+
</annex>
|
2156
|
+
<bibliography>
|
2157
|
+
<references id='_' normative='true' obligation='informative'>
|
2158
|
+
<title>Normative references</title>
|
2159
|
+
<p id='_'>There are no normative references in this document.</p>
|
2160
|
+
</references>
|
2161
|
+
<references id='_' normative='false' obligation='informative'>
|
2162
|
+
<title>Bibliography</title>
|
2163
|
+
</references>
|
2164
|
+
<references id='_' normative='false' obligation='informative'>
|
2165
|
+
<title>Bibliography</title>
|
2166
|
+
</references>
|
2167
|
+
<clause id='_' obligation='informative'>
|
2168
|
+
<title>Bibliography</title>
|
2169
|
+
<references id='_' normative='false' obligation='informative'>
|
2170
|
+
<title>Bibliography Subsection</title>
|
2171
|
+
</references>
|
2172
|
+
</clause>
|
2173
|
+
</bibliography>
|
2174
|
+
</standard-document>
|
2175
|
+
OUTPUT
|
2176
|
+
end
|
2177
|
+
|
2178
|
+
it "processes section names, default to English" do
|
2179
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
2180
|
+
#{ASCIIDOC_BLANK_HDR.sub(/:nodoc:/, ":language: tlh\n:script: Latn\n:nodoc:")}
|
2181
|
+
.Foreword
|
2182
|
+
|
2183
|
+
Text
|
2184
|
+
|
2185
|
+
[abstract]
|
2186
|
+
== Abstract
|
2187
|
+
|
2188
|
+
Text
|
2189
|
+
|
2190
|
+
[heading=introduction]
|
2191
|
+
== Introduction
|
2192
|
+
|
2193
|
+
=== Introduction Subsection
|
2194
|
+
|
2195
|
+
[heading=acknowledgements]
|
2196
|
+
== Acknowledgements
|
2197
|
+
|
2198
|
+
[.preface]
|
2199
|
+
== Dedication
|
2200
|
+
|
2201
|
+
[heading=scope]
|
2202
|
+
== Scope
|
2203
|
+
|
2204
|
+
Text
|
2205
|
+
|
2206
|
+
[bibliography,heading=normative references]
|
2207
|
+
== Normative References
|
2208
|
+
|
2209
|
+
[bibliography,normative=true]
|
2210
|
+
== Normative References 2
|
2211
|
+
|
2212
|
+
[heading=terms and definitions]
|
2213
|
+
== Terms and Definitions
|
2214
|
+
|
2215
|
+
=== Term1
|
2216
|
+
|
2217
|
+
[heading="terms and definitions"]
|
2218
|
+
== Terms, Definitions, Symbols and Abbreviated Terms
|
2219
|
+
|
2220
|
+
[.nonterm]
|
2221
|
+
=== Introduction
|
2222
|
+
|
2223
|
+
==== Intro 1
|
2224
|
+
|
2225
|
+
=== Intro 2
|
2226
|
+
|
2227
|
+
[.nonterm]
|
2228
|
+
==== Intro 3
|
2229
|
+
|
2230
|
+
=== Intro 4
|
2231
|
+
|
2232
|
+
==== Intro 5
|
2233
|
+
|
2234
|
+
===== Term1
|
2235
|
+
|
2236
|
+
=== Normal Terms
|
2237
|
+
|
2238
|
+
==== Term2
|
2239
|
+
|
2240
|
+
[heading=symbols and abbreviated terms]
|
2241
|
+
=== Symbols and Abbreviated Terms
|
2242
|
+
|
2243
|
+
[.nonterm]
|
2244
|
+
==== General
|
2245
|
+
|
2246
|
+
[heading=symbols]
|
2247
|
+
==== Symbols 1
|
2248
|
+
|
2249
|
+
[heading=abbreviated terms]
|
2250
|
+
== Abbreviated Terms
|
2251
|
+
|
2252
|
+
== Clause 4
|
2253
|
+
|
2254
|
+
=== Introduction
|
2255
|
+
|
2256
|
+
=== Clause 4.2
|
2257
|
+
|
2258
|
+
== Terms and Definitions
|
2259
|
+
|
2260
|
+
[appendix]
|
2261
|
+
== Annex
|
2262
|
+
|
2263
|
+
=== Annex A.1
|
2264
|
+
|
2265
|
+
[bibliography,heading=bibliography]
|
2266
|
+
== Bibliography
|
2267
|
+
|
2268
|
+
[bibliography,normative=false]
|
2269
|
+
== Bibliography 2
|
2270
|
+
|
2271
|
+
=== Bibliography Subsection
|
2272
|
+
|
2273
|
+
INPUT
|
2274
|
+
<standard-document xmlns='https://www.metanorma.org/ns/standoc'>
|
2275
|
+
<bibdata type='standard'>
|
2276
|
+
<title language='en' format='text/plain'>Document title</title>
|
2277
|
+
<language>tlh</language>
|
2278
|
+
<script>Latn</script>
|
2279
|
+
<abstract>
|
2280
|
+
<p>Text</p>
|
2281
|
+
</abstract>
|
2282
|
+
<status>
|
2283
|
+
<stage>published</stage>
|
2284
|
+
</status>
|
2285
|
+
<copyright>
|
2286
|
+
<from>2020</from>
|
2287
|
+
</copyright>
|
2288
|
+
<ext>
|
2289
|
+
<doctype>article</doctype>
|
2290
|
+
</ext>
|
2291
|
+
</bibdata>
|
2292
|
+
<preface>
|
2293
|
+
<abstract id='_'>
|
2294
|
+
<title>Abstract</title>
|
2295
|
+
<p id='_'>Text</p>
|
2296
|
+
</abstract>
|
2297
|
+
<foreword id='_' obligation='informative'>
|
2298
|
+
<title>Foreword</title>
|
2299
|
+
<p id='_'>Text</p>
|
2300
|
+
</foreword>
|
2301
|
+
<introduction id='_' obligation='informative'>
|
2302
|
+
<title>Introduction</title>
|
2303
|
+
<clause id='_' inline-header='false' obligation='informative'>
|
2304
|
+
<title>Introduction Subsection</title>
|
2305
|
+
</clause>
|
2306
|
+
</introduction>
|
2307
|
+
<clause id='_' inline-header='false' obligation='informative'>
|
2308
|
+
<title>Dedication</title>
|
2309
|
+
</clause>
|
2310
|
+
<acknowledgements id='_' obligation='informative'>
|
2311
|
+
<title>Acknowledgements</title>
|
2312
|
+
</acknowledgements>
|
2313
|
+
</preface>
|
2314
|
+
<sections>
|
2315
|
+
<clause id='_' type='scope' inline-header='false' obligation='normative'>
|
2316
|
+
<title>Scope</title>
|
2317
|
+
<p id='_'>Text</p>
|
2318
|
+
</clause>
|
2319
|
+
<terms id='_' obligation='normative'>
|
2320
|
+
<title>Terms and definitions</title>
|
2321
|
+
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
2322
|
+
<term id='_'>
|
2323
|
+
<preferred>Term1</preferred>
|
2324
|
+
</term>
|
2325
|
+
</terms>
|
2326
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2327
|
+
<title>Terms, Definitions, Symbols and Abbreviated Terms</title>
|
2328
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2329
|
+
<title>Introduction</title>
|
2330
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2331
|
+
<title>Intro 1</title>
|
2332
|
+
</clause>
|
2333
|
+
</clause>
|
2334
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2335
|
+
<title>Intro 2</title>
|
2336
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2337
|
+
<title>Intro 3</title>
|
2338
|
+
</clause>
|
2339
|
+
</clause>
|
2340
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2341
|
+
<title>Intro 4</title>
|
2342
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2343
|
+
<title>Intro 5</title>
|
2344
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2345
|
+
<title>Term1</title>
|
2346
|
+
</clause>
|
2347
|
+
</clause>
|
2348
|
+
</clause>
|
2349
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2350
|
+
<title>Normal Terms</title>
|
2351
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2352
|
+
<title>Term2</title>
|
2353
|
+
</clause>
|
2354
|
+
</clause>
|
2355
|
+
<definitions id='_' obligation='normative'>
|
2356
|
+
<title>Symbols and abbreviated terms</title>
|
2357
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2358
|
+
<title>General</title>
|
2359
|
+
</clause>
|
2360
|
+
<definitions id='_' type='symbols' obligation='normative'>
|
2361
|
+
<title>Symbols</title>
|
2362
|
+
</definitions>
|
2363
|
+
</definitions>
|
2364
|
+
</clause>
|
2365
|
+
<definitions id='_' type='abbreviated_terms' obligation='normative'>
|
2366
|
+
<title>Abbreviated terms</title>
|
2367
|
+
</definitions>
|
2368
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2369
|
+
<title>Clause 4</title>
|
2370
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2371
|
+
<title>Introduction</title>
|
2372
|
+
</clause>
|
2373
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2374
|
+
<title>Clause 4.2</title>
|
2375
|
+
</clause>
|
2376
|
+
</clause>
|
2377
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2378
|
+
<title>Terms and Definitions</title>
|
2379
|
+
</clause>
|
2380
|
+
</sections>
|
2381
|
+
<annex id='_' inline-header='false' obligation='normative'>
|
2382
|
+
<title>Annex</title>
|
2383
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2384
|
+
<title>Annex A.1</title>
|
2385
|
+
</clause>
|
2386
|
+
</annex>
|
2387
|
+
<bibliography>
|
2388
|
+
<references id='_' normative='true' obligation='informative'>
|
2389
|
+
<title>Normative references</title>
|
2390
|
+
<p id='_'>There are no normative references in this document.</p>
|
2391
|
+
</references>
|
2392
|
+
<references id='_' normative='false' obligation='informative'>
|
2393
|
+
<title>Bibliography</title>
|
2394
|
+
</references>
|
2395
|
+
<references id='_' normative='false' obligation='informative'>
|
2396
|
+
<title>Bibliography</title>
|
2397
|
+
</references>
|
2398
|
+
<clause id='_' obligation='informative'>
|
2399
|
+
<title>Bibliography</title>
|
2400
|
+
<references id='_' normative='false' obligation='informative'>
|
2401
|
+
<title>Bibliography Subsection</title>
|
2402
|
+
</references>
|
2403
|
+
</clause>
|
2404
|
+
</bibliography>
|
2405
|
+
</standard-document>
|
2406
|
+
OUTPUT
|
2407
|
+
end
|
2408
|
+
|
2409
|
+
it "processes section names, French" do
|
2410
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
2411
|
+
#{ASCIIDOC_BLANK_HDR.sub(/:nodoc:/, ":language: fr\n:script: Latn\n:nodoc:")}
|
2412
|
+
.Foreword
|
2413
|
+
|
2414
|
+
Text
|
2415
|
+
|
2416
|
+
[abstract]
|
2417
|
+
== Abstract
|
2418
|
+
|
2419
|
+
Text
|
2420
|
+
|
2421
|
+
[heading=introduction]
|
2422
|
+
== Introduction
|
2423
|
+
|
2424
|
+
=== Introduction Subsection
|
2425
|
+
|
2426
|
+
[heading=acknowledgements]
|
2427
|
+
== Acknowledgements
|
2428
|
+
|
2429
|
+
[.preface]
|
2430
|
+
== Dedication
|
2431
|
+
|
2432
|
+
[heading=scope]
|
2433
|
+
== Scope
|
2434
|
+
|
2435
|
+
Text
|
2436
|
+
|
2437
|
+
[bibliography,heading=normative references]
|
2438
|
+
== Normative References
|
2439
|
+
|
2440
|
+
[bibliography,normative=true]
|
2441
|
+
== Normative References 2
|
2442
|
+
|
2443
|
+
[heading=terms and definitions]
|
2444
|
+
== Terms and Definitions
|
2445
|
+
|
2446
|
+
=== Term1
|
2447
|
+
|
2448
|
+
[heading="terms and definitions"]
|
2449
|
+
== Terms, Definitions, Symbols and Abbreviated Terms
|
2450
|
+
|
2451
|
+
[.nonterm]
|
2452
|
+
=== Introduction
|
2453
|
+
|
2454
|
+
==== Intro 1
|
2455
|
+
|
2456
|
+
=== Intro 2
|
2457
|
+
|
2458
|
+
[.nonterm]
|
2459
|
+
==== Intro 3
|
2460
|
+
|
2461
|
+
=== Intro 4
|
2462
|
+
|
2463
|
+
==== Intro 5
|
2464
|
+
|
2465
|
+
===== Term1
|
2466
|
+
|
2467
|
+
=== Normal Terms
|
2468
|
+
|
2469
|
+
==== Term2
|
2470
|
+
|
2471
|
+
[heading=symbols and abbreviated terms]
|
2472
|
+
=== Symbols and Abbreviated Terms
|
2473
|
+
|
2474
|
+
[.nonterm]
|
2475
|
+
==== General
|
2476
|
+
|
2477
|
+
[heading=symbols]
|
2478
|
+
==== Symbols 1
|
2479
|
+
|
2480
|
+
[heading=abbreviated terms]
|
2481
|
+
== Abbreviated Terms
|
2482
|
+
|
2483
|
+
== Clause 4
|
2484
|
+
|
2485
|
+
=== Introduction
|
2486
|
+
|
2487
|
+
=== Clause 4.2
|
2488
|
+
|
2489
|
+
== Terms and Definitions
|
2490
|
+
|
2491
|
+
[appendix]
|
2492
|
+
== Annex
|
2493
|
+
|
2494
|
+
=== Annex A.1
|
2495
|
+
|
2496
|
+
[bibliography,heading=bibliography]
|
2497
|
+
== Bibliography
|
2498
|
+
|
2499
|
+
[bibliography,normative=false]
|
2500
|
+
== Bibliography 2
|
2501
|
+
|
2502
|
+
=== Bibliography Subsection
|
2503
|
+
|
2504
|
+
INPUT
|
2505
|
+
<standard-document xmlns='https://www.metanorma.org/ns/standoc'>
|
2506
|
+
<bibdata type='standard'>
|
2507
|
+
<title language='en' format='text/plain'>Document title</title>
|
2508
|
+
<language>fr</language>
|
2509
|
+
<script>Latn</script>
|
2510
|
+
<abstract>
|
2511
|
+
<p>Text</p>
|
2512
|
+
</abstract>
|
2513
|
+
<status>
|
2514
|
+
<stage>published</stage>
|
2515
|
+
</status>
|
2516
|
+
<copyright>
|
2517
|
+
<from>2020</from>
|
2518
|
+
</copyright>
|
2519
|
+
<ext>
|
2520
|
+
<doctype>article</doctype>
|
2521
|
+
</ext>
|
2522
|
+
</bibdata>
|
2523
|
+
<preface>
|
2524
|
+
<abstract id='_'>
|
2525
|
+
<title>Résumé</title>
|
2526
|
+
<p id='_'>Text</p>
|
2527
|
+
</abstract>
|
2528
|
+
<foreword id='_' obligation='informative'>
|
2529
|
+
<title>Avant-propos</title>
|
2530
|
+
<p id='_'>Text</p>
|
2531
|
+
</foreword>
|
2532
|
+
<introduction id='_' obligation='informative'>
|
2533
|
+
<title>Introduction</title>
|
2534
|
+
<clause id='_' inline-header='false' obligation='informative'>
|
2535
|
+
<title>Introduction Subsection</title>
|
2536
|
+
</clause>
|
2537
|
+
</introduction>
|
2538
|
+
<clause id='_' inline-header='false' obligation='informative'>
|
2539
|
+
<title>Dedication</title>
|
2540
|
+
</clause>
|
2541
|
+
<acknowledgements id='_' obligation='informative'>
|
2542
|
+
<title>Remerciements</title>
|
2543
|
+
</acknowledgements>
|
2544
|
+
</preface>
|
2545
|
+
<sections>
|
2546
|
+
<clause id='_' type='scope' inline-header='false' obligation='normative'>
|
2547
|
+
<title>Domaine d’application</title>
|
2548
|
+
<p id='_'>Text</p>
|
2549
|
+
</clause>
|
2550
|
+
<terms id='_' obligation='normative'>
|
2551
|
+
<title>Terms et définitions</title>
|
2552
|
+
<p id='_'>
|
2553
|
+
Pour les besoins du présent document, les termes et définitions suivants
|
2554
|
+
s’appliquent.
|
2555
|
+
</p>
|
2556
|
+
<term id='_'>
|
2557
|
+
<preferred>Term1</preferred>
|
2558
|
+
</term>
|
2559
|
+
</terms>
|
2560
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2561
|
+
<title>Terms, Definitions, Symbols and Abbreviated Terms</title>
|
2562
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2563
|
+
<title>Introduction</title>
|
2564
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2565
|
+
<title>Intro 1</title>
|
2566
|
+
</clause>
|
2567
|
+
</clause>
|
2568
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2569
|
+
<title>Intro 2</title>
|
2570
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2571
|
+
<title>Intro 3</title>
|
2572
|
+
</clause>
|
2573
|
+
</clause>
|
2574
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2575
|
+
<title>Intro 4</title>
|
2576
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2577
|
+
<title>Intro 5</title>
|
2578
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2579
|
+
<title>Term1</title>
|
2580
|
+
</clause>
|
2581
|
+
</clause>
|
2582
|
+
</clause>
|
2583
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2584
|
+
<title>Normal Terms</title>
|
2585
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2586
|
+
<title>Term2</title>
|
2587
|
+
</clause>
|
2588
|
+
</clause>
|
2589
|
+
<definitions id='_' obligation='normative'>
|
2590
|
+
<title>Symbols and abbreviated terms</title>
|
2591
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2592
|
+
<title>General</title>
|
2593
|
+
</clause>
|
2594
|
+
<definitions id='_' type='symbols' obligation='normative'>
|
2595
|
+
<title>Symboles</title>
|
2596
|
+
</definitions>
|
2597
|
+
</definitions>
|
2598
|
+
</clause>
|
2599
|
+
<definitions id='_' type='abbreviated_terms' obligation='normative'>
|
2600
|
+
<title>Termes abrégés</title>
|
2601
|
+
</definitions>
|
2602
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2603
|
+
<title>Clause 4</title>
|
2604
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2605
|
+
<title>Introduction</title>
|
2606
|
+
</clause>
|
2607
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2608
|
+
<title>Clause 4.2</title>
|
2609
|
+
</clause>
|
2610
|
+
</clause>
|
2611
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2612
|
+
<title>Terms and Definitions</title>
|
2613
|
+
</clause>
|
2614
|
+
</sections>
|
2615
|
+
<annex id='_' inline-header='false' obligation='normative'>
|
2616
|
+
<title>Annex</title>
|
2617
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2618
|
+
<title>Annex A.1</title>
|
2619
|
+
</clause>
|
2620
|
+
</annex>
|
2621
|
+
<bibliography>
|
2622
|
+
<references id='_' normative='true' obligation='informative'>
|
2623
|
+
<title>Références normatives</title>
|
2624
|
+
<p id='_'>Le présent document ne contient aucune référence normative.</p>
|
2625
|
+
</references>
|
2626
|
+
<references id='_' normative='false' obligation='informative'>
|
2627
|
+
<title>Bibliographie</title>
|
2628
|
+
</references>
|
2629
|
+
<references id='_' normative='false' obligation='informative'>
|
2630
|
+
<title>Bibliography</title>
|
2631
|
+
</references>
|
2632
|
+
<clause id='_' obligation='informative'>
|
2633
|
+
<title>Bibliography</title>
|
2634
|
+
<references id='_' normative='false' obligation='informative'>
|
2635
|
+
<title>Bibliography Subsection</title>
|
2636
|
+
</references>
|
2637
|
+
</clause>
|
2638
|
+
</bibliography>
|
2639
|
+
</standard-document>
|
2640
|
+
OUTPUT
|
2641
|
+
end
|
2642
|
+
|
2643
|
+
it "processes section names, Simplified Chinese" do
|
2644
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
2645
|
+
#{ASCIIDOC_BLANK_HDR.sub(/:nodoc:/, ":language: zh\n:script: Hans\n:nodoc:")}
|
2646
|
+
.Foreword
|
2647
|
+
|
2648
|
+
Text
|
2649
|
+
|
2650
|
+
[abstract]
|
2651
|
+
== Abstract
|
2652
|
+
|
2653
|
+
Text
|
2654
|
+
|
2655
|
+
[heading=introduction]
|
2656
|
+
== Introduction
|
2657
|
+
|
2658
|
+
=== Introduction Subsection
|
2659
|
+
|
2660
|
+
[heading=acknowledgements]
|
2661
|
+
== Acknowledgements
|
2662
|
+
|
2663
|
+
[.preface]
|
2664
|
+
== Dedication
|
2665
|
+
|
2666
|
+
[heading=scope]
|
2667
|
+
== Scope
|
2668
|
+
|
2669
|
+
Text
|
2670
|
+
|
2671
|
+
[bibliography,heading=normative references]
|
2672
|
+
== Normative References
|
2673
|
+
|
2674
|
+
[bibliography,normative=true]
|
2675
|
+
== Normative References 2
|
2676
|
+
|
2677
|
+
[heading=terms and definitions]
|
2678
|
+
== Terms and Definitions
|
2679
|
+
|
2680
|
+
=== Term1
|
2681
|
+
|
2682
|
+
[heading="terms and definitions"]
|
2683
|
+
== Terms, Definitions, Symbols and Abbreviated Terms
|
2684
|
+
|
2685
|
+
[.nonterm]
|
2686
|
+
=== Introduction
|
2687
|
+
|
2688
|
+
==== Intro 1
|
2689
|
+
|
2690
|
+
=== Intro 2
|
2691
|
+
|
2692
|
+
[.nonterm]
|
2693
|
+
==== Intro 3
|
2694
|
+
|
2695
|
+
=== Intro 4
|
2696
|
+
|
2697
|
+
==== Intro 5
|
2698
|
+
|
2699
|
+
===== Term1
|
2700
|
+
|
2701
|
+
=== Normal Terms
|
2702
|
+
|
2703
|
+
==== Term2
|
2704
|
+
|
2705
|
+
[heading=symbols and abbreviated terms]
|
2706
|
+
=== Symbols and Abbreviated Terms
|
2707
|
+
|
2708
|
+
[.nonterm]
|
2709
|
+
==== General
|
2710
|
+
|
2711
|
+
[heading=symbols]
|
2712
|
+
==== Symbols 1
|
2713
|
+
|
2714
|
+
[heading=abbreviated terms]
|
2715
|
+
== Abbreviated Terms
|
2716
|
+
|
2717
|
+
== Clause 4
|
2718
|
+
|
2719
|
+
=== Introduction
|
2720
|
+
|
2721
|
+
=== Clause 4.2
|
2722
|
+
|
2723
|
+
== Terms and Definitions
|
2724
|
+
|
2725
|
+
[appendix]
|
2726
|
+
== Annex
|
2727
|
+
|
2728
|
+
=== Annex A.1
|
2729
|
+
|
2730
|
+
[bibliography,heading=bibliography]
|
2731
|
+
== Bibliography
|
2732
|
+
|
2733
|
+
[bibliography,normative=false]
|
2734
|
+
== Bibliography 2
|
2735
|
+
|
2736
|
+
=== Bibliography Subsection
|
2737
|
+
|
2738
|
+
INPUT
|
2739
|
+
<standard-document xmlns='https://www.metanorma.org/ns/standoc'>
|
2740
|
+
<bibdata type='standard'>
|
2741
|
+
<title language='en' format='text/plain'>Document title</title>
|
2742
|
+
<language>zh</language>
|
2743
|
+
<script>Hans</script>
|
2744
|
+
<abstract>
|
2745
|
+
<p>Text</p>
|
2746
|
+
</abstract>
|
2747
|
+
<status>
|
2748
|
+
<stage>published</stage>
|
2749
|
+
</status>
|
2750
|
+
<copyright>
|
2751
|
+
<from>2020</from>
|
2752
|
+
</copyright>
|
2753
|
+
<ext>
|
2754
|
+
<doctype>article</doctype>
|
2755
|
+
</ext>
|
2756
|
+
</bibdata>
|
2757
|
+
<preface>
|
2758
|
+
<abstract id='_'>
|
2759
|
+
<title>摘要</title>
|
2760
|
+
<p id='_'>Text</p>
|
2761
|
+
</abstract>
|
2762
|
+
<foreword id='_' obligation='informative'>
|
2763
|
+
<title>前言</title>
|
2764
|
+
<p id='_'>Text</p>
|
2765
|
+
</foreword>
|
2766
|
+
<introduction id='_' obligation='informative'>
|
2767
|
+
<title>引言</title>
|
2768
|
+
<clause id='_' inline-header='false' obligation='informative'>
|
2769
|
+
<title>Introduction Subsection</title>
|
2770
|
+
</clause>
|
2771
|
+
</introduction>
|
2772
|
+
<clause id='_' inline-header='false' obligation='informative'>
|
2773
|
+
<title>Dedication</title>
|
2774
|
+
</clause>
|
2775
|
+
<acknowledgements id='_' obligation='informative'>
|
2776
|
+
<title>致謝</title>
|
2777
|
+
</acknowledgements>
|
2778
|
+
</preface>
|
2779
|
+
<sections>
|
2780
|
+
<clause id='_' type='scope' inline-header='false' obligation='normative'>
|
2781
|
+
<title>范围</title>
|
2782
|
+
<p id='_'>Text</p>
|
2783
|
+
</clause>
|
2784
|
+
<terms id='_' obligation='normative'>
|
2785
|
+
<title>术语和定义</title>
|
2786
|
+
<p id='_'>下列术语和定义适用于本文件。</p>
|
2787
|
+
<term id='_'>
|
2788
|
+
<preferred>Term1</preferred>
|
2789
|
+
</term>
|
2790
|
+
</terms>
|
2791
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2792
|
+
<title>Terms, Definitions, Symbols and Abbreviated Terms</title>
|
2793
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2794
|
+
<title>Introduction</title>
|
2795
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2796
|
+
<title>Intro 1</title>
|
2797
|
+
</clause>
|
2798
|
+
</clause>
|
2799
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2800
|
+
<title>Intro 2</title>
|
2801
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2802
|
+
<title>Intro 3</title>
|
2803
|
+
</clause>
|
2804
|
+
</clause>
|
2805
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2806
|
+
<title>Intro 4</title>
|
2807
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2808
|
+
<title>Intro 5</title>
|
2809
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2810
|
+
<title>Term1</title>
|
2811
|
+
</clause>
|
2812
|
+
</clause>
|
2813
|
+
</clause>
|
2814
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2815
|
+
<title>Normal Terms</title>
|
2816
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2817
|
+
<title>Term2</title>
|
2818
|
+
</clause>
|
2819
|
+
</clause>
|
2820
|
+
<definitions id='_' obligation='normative'>
|
2821
|
+
<title>符号、代号和缩略语</title>
|
2822
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2823
|
+
<title>General</title>
|
2824
|
+
</clause>
|
2825
|
+
<definitions id='_' type='symbols' obligation='normative'>
|
2826
|
+
<title>符号</title>
|
2827
|
+
</definitions>
|
2828
|
+
</definitions>
|
2829
|
+
</clause>
|
2830
|
+
<definitions id='_' type='abbreviated_terms' obligation='normative'>
|
2831
|
+
<title>代号和缩略语</title>
|
2832
|
+
</definitions>
|
2833
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2834
|
+
<title>Clause 4</title>
|
2835
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2836
|
+
<title>Introduction</title>
|
2837
|
+
</clause>
|
2838
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2839
|
+
<title>Clause 4.2</title>
|
2840
|
+
</clause>
|
2841
|
+
</clause>
|
2842
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2843
|
+
<title>Terms and Definitions</title>
|
2844
|
+
</clause>
|
2845
|
+
</sections>
|
2846
|
+
<annex id='_' inline-header='false' obligation='normative'>
|
2847
|
+
<title>Annex</title>
|
2848
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2849
|
+
<title>Annex A.1</title>
|
2850
|
+
</clause>
|
2851
|
+
</annex>
|
2852
|
+
<bibliography>
|
2853
|
+
<references id='_' normative='true' obligation='informative'>
|
2854
|
+
<title>规范性引用文件</title>
|
2855
|
+
<p id='_'>本文件并没有规范性引用文件。</p>
|
2856
|
+
</references>
|
2857
|
+
<references id='_' normative='false' obligation='informative'>
|
2858
|
+
<title>参考文献</title>
|
2859
|
+
</references>
|
2860
|
+
<references id='_' normative='false' obligation='informative'>
|
2861
|
+
<title>Bibliography</title>
|
2862
|
+
</references>
|
2863
|
+
<clause id='_' obligation='informative'>
|
2864
|
+
<title>Bibliography</title>
|
2865
|
+
<references id='_' normative='false' obligation='informative'>
|
2866
|
+
<title>Bibliography Subsection</title>
|
2867
|
+
</references>
|
2868
|
+
</clause>
|
2869
|
+
</bibliography>
|
2870
|
+
</standard-document>
|
2871
|
+
OUTPUT
|
2872
|
+
end
|
2873
|
+
|
2874
|
+
it "processes section names, internationalisation file" do
|
2875
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
2876
|
+
#{ASCIIDOC_BLANK_HDR.sub(/:nodoc:/, ":i18nyaml: spec/assets/i18n.yaml")}
|
2877
|
+
.Foreword
|
2878
|
+
|
2879
|
+
Text
|
2880
|
+
|
2881
|
+
[abstract]
|
2882
|
+
== Abstract
|
2883
|
+
|
2884
|
+
Text
|
2885
|
+
|
2886
|
+
[heading=introduction]
|
2887
|
+
== Introduction
|
2888
|
+
|
2889
|
+
=== Introduction Subsection
|
2890
|
+
|
2891
|
+
[heading=acknowledgements]
|
2892
|
+
== Acknowledgements
|
2893
|
+
|
2894
|
+
[.preface]
|
2895
|
+
== Dedication
|
2896
|
+
|
2897
|
+
[heading=scope]
|
2898
|
+
== Scope
|
2899
|
+
|
2900
|
+
Text
|
2901
|
+
|
2902
|
+
[bibliography,heading=normative references]
|
2903
|
+
== Normative References
|
2904
|
+
|
2905
|
+
[bibliography,normative=true]
|
2906
|
+
== Normative References 2
|
2907
|
+
|
2908
|
+
[heading=terms and definitions]
|
2909
|
+
== Terms and Definitions
|
2910
|
+
|
2911
|
+
=== Term1
|
2912
|
+
|
2913
|
+
[heading="terms and definitions"]
|
2914
|
+
== Terms, Definitions, Symbols and Abbreviated Terms
|
2915
|
+
|
2916
|
+
[.nonterm]
|
2917
|
+
=== Introduction
|
2918
|
+
|
2919
|
+
==== Intro 1
|
2920
|
+
|
2921
|
+
=== Intro 2
|
2922
|
+
|
2923
|
+
[.nonterm]
|
2924
|
+
==== Intro 3
|
2925
|
+
|
2926
|
+
=== Intro 4
|
2927
|
+
|
2928
|
+
==== Intro 5
|
2929
|
+
|
2930
|
+
===== Term1
|
2931
|
+
|
2932
|
+
=== Normal Terms
|
2933
|
+
|
2934
|
+
==== Term2
|
2935
|
+
|
2936
|
+
[heading=symbols and abbreviated terms]
|
2937
|
+
=== Symbols and Abbreviated Terms
|
2938
|
+
|
2939
|
+
[.nonterm]
|
2940
|
+
==== General
|
2941
|
+
|
2942
|
+
[heading=symbols]
|
2943
|
+
==== Symbols 1
|
2944
|
+
|
2945
|
+
[heading=abbreviated terms]
|
2946
|
+
== Abbreviated Terms
|
2947
|
+
|
2948
|
+
== Clause 4
|
2949
|
+
|
2950
|
+
=== Introduction
|
2951
|
+
|
2952
|
+
=== Clause 4.2
|
2953
|
+
|
2954
|
+
== Terms and Definitions
|
2955
|
+
|
2956
|
+
[appendix]
|
2957
|
+
== Annex
|
2958
|
+
|
2959
|
+
=== Annex A.1
|
2960
|
+
|
2961
|
+
[bibliography,heading=bibliography]
|
2962
|
+
== Bibliography
|
2963
|
+
|
2964
|
+
[bibliography,normative=false]
|
2965
|
+
== Bibliography 2
|
2966
|
+
|
2967
|
+
=== Bibliography Subsection
|
2968
|
+
|
2969
|
+
INPUT
|
2970
|
+
<standard-document xmlns='https://www.metanorma.org/ns/standoc'>
|
2971
|
+
<bibdata type='standard'>
|
2972
|
+
<title language='en' format='text/plain'>Document title</title>
|
2973
|
+
<language>en</language>
|
2974
|
+
<script>Latn</script>
|
2975
|
+
<abstract>
|
2976
|
+
<p>Text</p>
|
2977
|
+
</abstract>
|
2978
|
+
<status>
|
2979
|
+
<stage>published</stage>
|
2980
|
+
</status>
|
2981
|
+
<copyright>
|
2982
|
+
<from>2020</from>
|
2983
|
+
</copyright>
|
2984
|
+
<ext>
|
2985
|
+
<doctype>article</doctype>
|
2986
|
+
</ext>
|
2987
|
+
</bibdata>
|
2988
|
+
<preface>
|
2989
|
+
<abstract id='_'>
|
2990
|
+
<title>Abstract</title>
|
2991
|
+
<p id='_'>Text</p>
|
2992
|
+
</abstract>
|
2993
|
+
<foreword id='_' obligation='informative'>
|
2994
|
+
<title>Antaŭparolo</title>
|
2995
|
+
<p id='_'>Text</p>
|
2996
|
+
</foreword>
|
2997
|
+
<introduction id='_' obligation='informative'>
|
2998
|
+
<title>Enkonduko</title>
|
2999
|
+
<clause id='_' inline-header='false' obligation='informative'>
|
3000
|
+
<title>Introduction Subsection</title>
|
3001
|
+
</clause>
|
3002
|
+
</introduction>
|
3003
|
+
<clause id='_' inline-header='false' obligation='informative'>
|
3004
|
+
<title>Dedication</title>
|
3005
|
+
</clause>
|
3006
|
+
<acknowledgements id='_' obligation='informative'>
|
3007
|
+
<title>Acknowledgements</title>
|
3008
|
+
</acknowledgements>
|
3009
|
+
</preface>
|
3010
|
+
<sections>
|
3011
|
+
<clause id='_' type='scope' inline-header='false' obligation='normative'>
|
3012
|
+
<title>Amplekso</title>
|
3013
|
+
<p id='_'>Text</p>
|
3014
|
+
</clause>
|
3015
|
+
<terms id='_' obligation='normative'>
|
3016
|
+
<title>Terms and definitions</title>
|
3017
|
+
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
3018
|
+
<term id='_'>
|
3019
|
+
<preferred>Term1</preferred>
|
3020
|
+
</term>
|
3021
|
+
</terms>
|
3022
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
3023
|
+
<title>Terms, Definitions, Symbols and Abbreviated Terms</title>
|
3024
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
3025
|
+
<title>Introduction</title>
|
3026
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
3027
|
+
<title>Intro 1</title>
|
3028
|
+
</clause>
|
3029
|
+
</clause>
|
3030
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
3031
|
+
<title>Intro 2</title>
|
3032
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
3033
|
+
<title>Intro 3</title>
|
3034
|
+
</clause>
|
3035
|
+
</clause>
|
3036
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
3037
|
+
<title>Intro 4</title>
|
3038
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
3039
|
+
<title>Intro 5</title>
|
3040
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
3041
|
+
<title>Term1</title>
|
3042
|
+
</clause>
|
3043
|
+
</clause>
|
3044
|
+
</clause>
|
3045
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
3046
|
+
<title>Normal Terms</title>
|
3047
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
3048
|
+
<title>Term2</title>
|
3049
|
+
</clause>
|
3050
|
+
</clause>
|
3051
|
+
<definitions id='_' obligation='normative'>
|
3052
|
+
<title>Symbols and abbreviated terms</title>
|
3053
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
3054
|
+
<title>General</title>
|
3055
|
+
</clause>
|
3056
|
+
<definitions id='_' type='symbols' obligation='normative'>
|
3057
|
+
<title>Simboloj kai mallongigitaj terminoj</title>
|
3058
|
+
</definitions>
|
3059
|
+
</definitions>
|
3060
|
+
</clause>
|
3061
|
+
<definitions id='_' type='abbreviated_terms' obligation='normative'>
|
3062
|
+
<title>Abbreviated terms</title>
|
3063
|
+
</definitions>
|
3064
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
3065
|
+
<title>Clause 4</title>
|
3066
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
3067
|
+
<title>Introduction</title>
|
3068
|
+
</clause>
|
3069
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
3070
|
+
<title>Clause 4.2</title>
|
3071
|
+
</clause>
|
3072
|
+
</clause>
|
3073
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
3074
|
+
<title>Terms and Definitions</title>
|
3075
|
+
</clause>
|
3076
|
+
</sections>
|
3077
|
+
<annex id='_' inline-header='false' obligation='normative'>
|
3078
|
+
<title>Annex</title>
|
3079
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
3080
|
+
<title>Annex A.1</title>
|
3081
|
+
</clause>
|
3082
|
+
</annex>
|
3083
|
+
<bibliography>
|
3084
|
+
<references id='_' normative='true' obligation='informative'>
|
3085
|
+
<title>Normaj citaĵoj</title>
|
3086
|
+
<p id='_'>There are no normative references in this document.</p>
|
3087
|
+
</references>
|
3088
|
+
<references id='_' normative='false' obligation='informative'>
|
3089
|
+
<title>Bibliografio</title>
|
3090
|
+
</references>
|
3091
|
+
<references id='_' normative='false' obligation='informative'>
|
3092
|
+
<title>Bibliography</title>
|
3093
|
+
</references>
|
3094
|
+
<clause id='_' obligation='informative'>
|
3095
|
+
<title>Bibliography</title>
|
3096
|
+
<references id='_' normative='false' obligation='informative'>
|
3097
|
+
<title>Bibliography Subsection</title>
|
3098
|
+
</references>
|
3099
|
+
</clause>
|
3100
|
+
</bibliography>
|
3101
|
+
</standard-document>
|
3102
|
+
OUTPUT
|
3103
|
+
end
|
3104
|
+
|
3105
|
+
|
1902
3106
|
private
|
1903
3107
|
|
1904
3108
|
def mock_iecbib_get_iec60050_103_01
|