metanorma-iso 1.7.3 → 1.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/.rubocop.yml +9 -1
- data/lib/asciidoctor/iso/biblio.rng +4 -6
- data/lib/asciidoctor/iso/front.rb +1 -1
- data/lib/asciidoctor/iso/front_id.rb +30 -25
- data/lib/asciidoctor/iso/validate_title.rb +21 -13
- data/lib/isodoc/iso/index.rb +2 -1
- data/lib/isodoc/iso/iso.amendment.xsl +20 -5
- data/lib/isodoc/iso/iso.international-standard.xsl +20 -5
- data/lib/metanorma/iso/version.rb +1 -1
- data/metanorma-iso.gemspec +1 -1
- data/spec/asciidoctor/amd_spec.rb +5 -5
- data/spec/asciidoctor/base_spec.rb +7 -7
- data/spec/asciidoctor/validate_spec.rb +18 -1
- data/spec/spec_helper.rb +2 -0
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e78f6a52feda554f9e3578e30ffd3af32afe6c771d16414f584ceadd38589b13
|
4
|
+
data.tar.gz: 2da68557d15c9436c6dc310203895e5611c64331b0f038e66590ad4611bdb5db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1d80f1af14c5abfd4cc74a0e91dbcc0e4414fd46105ebbd80507871bba8ea788c1e8b09525b8672d85bd4f453d07b5a2b2621a96ebc63270999a2b9989ecbaa
|
7
|
+
data.tar.gz: '09b997180fa6f3c0a1ac2298efda92fc634f5ea1404115c1d65104da739ca278f6a134ee9114ba2b1d53fc4c9415ba6655a7612982479964b5b1bb2c5790a85a'
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
@@ -1,6 +1,14 @@
|
|
1
1
|
# This project follows the Ribose OSS style guide.
|
2
2
|
# https://github.com/riboseinc/oss-guides
|
3
3
|
# All project-specific additions and overrides should be specified in this file.
|
4
|
-
|
5
4
|
inherit_from:
|
6
5
|
- https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
|
6
|
+
|
7
|
+
# local repo-specific modifications
|
8
|
+
|
9
|
+
AllCops:
|
10
|
+
DisplayCopNames: false
|
11
|
+
StyleGuideCopsOnly: false
|
12
|
+
TargetRubyVersion: 2.4
|
13
|
+
Rails:
|
14
|
+
Enabled: true
|
@@ -124,7 +124,7 @@
|
|
124
124
|
<value>application/tei+xml</value>
|
125
125
|
<value>text/x-asciidoc</value>
|
126
126
|
<value>text/markdown</value>
|
127
|
-
<value>application/x-
|
127
|
+
<value>application/x-metanorma+xml</value>
|
128
128
|
<text/>
|
129
129
|
</choice>
|
130
130
|
</attribute>
|
@@ -452,6 +452,7 @@
|
|
452
452
|
<attribute name="type">
|
453
453
|
<choice>
|
454
454
|
<value>isni</value>
|
455
|
+
<value>orcid</value>
|
455
456
|
<value>uri</value>
|
456
457
|
</choice>
|
457
458
|
</attribute>
|
@@ -461,10 +462,7 @@
|
|
461
462
|
<define name="org-identifier">
|
462
463
|
<element name="identifier">
|
463
464
|
<attribute name="type">
|
464
|
-
<
|
465
|
-
<value>orcid</value>
|
466
|
-
<value>uri</value>
|
467
|
-
</choice>
|
465
|
+
<data type="string" datatypeLibrary=""/>
|
468
466
|
</attribute>
|
469
467
|
<text/>
|
470
468
|
</element>
|
@@ -1106,7 +1104,7 @@
|
|
1106
1104
|
<value>complementOf</value>
|
1107
1105
|
<value>obsoletes</value>
|
1108
1106
|
<value>obsoletedBy</value>
|
1109
|
-
<value>
|
1107
|
+
<value>cites</value>
|
1110
1108
|
<value>isCitedIn</value>
|
1111
1109
|
</choice>
|
1112
1110
|
</define>
|
@@ -67,7 +67,7 @@ module Asciidoctor
|
|
67
67
|
stage = get_stage(node)
|
68
68
|
substage = get_substage(node)
|
69
69
|
xml.status do |s|
|
70
|
-
s.stage stage, **attr_code(abbreviation:
|
70
|
+
s.stage stage, **attr_code(abbreviation: cover_stage_abbr(node))
|
71
71
|
s.substage substage
|
72
72
|
node.attr("iteration") && (s.iteration node.attr("iteration"))
|
73
73
|
end
|
@@ -11,7 +11,7 @@ module Asciidoctor
|
|
11
11
|
class Converter < Standoc::Converter
|
12
12
|
STAGE_ABBRS = {
|
13
13
|
"00": "PWI",
|
14
|
-
"10": "
|
14
|
+
"10": "NP",
|
15
15
|
"20": "WD",
|
16
16
|
"30": "CD",
|
17
17
|
"40": "DIS",
|
@@ -37,15 +37,11 @@ module Asciidoctor
|
|
37
37
|
return nil if stage.to_i > 60
|
38
38
|
ret = STAGE_ABBRS[stage.to_sym]
|
39
39
|
ret = "PRF" if stage == "60" && substage == "00"
|
40
|
+
ret = "AWI" if stage == "10" && substage == "99"
|
40
41
|
if %w(amendment technical-corrigendum technical-report
|
41
42
|
technical-specification).include?(doctype)
|
42
|
-
ret = "
|
43
|
-
ret = "
|
44
|
-
ret = "D" if stage == "40" and doctype == "amendment"
|
45
|
-
ret = "FD" if stage == "50" and
|
46
|
-
%w(amendment technical-corrigendum).include?(doctype)
|
47
|
-
ret = "D" if stage == "50" and
|
48
|
-
%w(technical-report technical-specification).include?(doctype)
|
43
|
+
ret = "D" if stage == "40" && doctype == "amendment"
|
44
|
+
ret = "FD" if stage == "50" && %w(amendment technical-corrigendum).include?(doctype)
|
49
45
|
end
|
50
46
|
ret
|
51
47
|
end
|
@@ -54,8 +50,7 @@ module Asciidoctor
|
|
54
50
|
return "Proof" if stage == "60" && substage == "00"
|
55
51
|
ret = STAGE_NAMES[stage.to_sym]
|
56
52
|
if iteration && %w(20 30).include?(stage)
|
57
|
-
prefix
|
58
|
-
to_rbnf_s("SpelloutRules", "spellout-ordinal")
|
53
|
+
prefix = iteration.to_i.localize(@lang.to_sym).to_rbnf_s("SpelloutRules", "spellout-ordinal")
|
59
54
|
ret = "#{prefix.capitalize} #{ret.downcase}"
|
60
55
|
end
|
61
56
|
ret
|
@@ -70,16 +65,13 @@ module Asciidoctor
|
|
70
65
|
end
|
71
66
|
|
72
67
|
def iso_id(node, xml)
|
73
|
-
return unless !@amd && node.attr("docnumber") ||
|
74
|
-
@amd && node.attr("updates")
|
68
|
+
return unless !@amd && node.attr("docnumber") || @amd && node.attr("updates")
|
75
69
|
dn = iso_id1(node)
|
76
70
|
dn1 = id_stage_prefix(dn, node, false)
|
77
71
|
dn2 = id_stage_prefix(dn, node, true)
|
78
72
|
xml.docidentifier dn1, **attr_code(type: "ISO")
|
79
|
-
xml.docidentifier id_langsuffix(dn1, node),
|
80
|
-
|
81
|
-
xml.docidentifier id_langsuffix(dn2, node),
|
82
|
-
**attr_code(type: "iso-reference")
|
73
|
+
xml.docidentifier id_langsuffix(dn1, node), **attr_code(type: "iso-with-lang")
|
74
|
+
xml.docidentifier id_langsuffix(dn2, node), **attr_code(type: "iso-reference")
|
83
75
|
end
|
84
76
|
|
85
77
|
def iso_id1(node)
|
@@ -132,18 +124,29 @@ module Asciidoctor
|
|
132
124
|
dn
|
133
125
|
end
|
134
126
|
|
135
|
-
def id_stage_abbr(stage, substage, node)
|
136
|
-
ret =
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
127
|
+
def id_stage_abbr(stage, substage, node, bare = false)
|
128
|
+
ret = bare ?
|
129
|
+
IsoDoc::Iso::Metadata.new("en", "Latn", @i18n)
|
130
|
+
.status_abbrev(stage_abbr(stage, substage, doctype(node)),
|
131
|
+
substage, nil, nil, doctype(node)) :
|
132
|
+
IsoDoc::Iso::Metadata.new("en", "Latn", @i18n)
|
133
|
+
.status_abbrev(stage_abbr(stage, substage, doctype(node)),
|
134
|
+
substage, node.attr("iteration"),
|
135
|
+
node.attr("draft"), doctype(node))
|
136
|
+
if %w(amendment technical-corrigendum technical-report technical-specification).include?(doctype(node))
|
137
|
+
ret = ret + " " unless %w(D FD).include?(ret)
|
143
138
|
end
|
144
139
|
ret
|
145
140
|
end
|
146
141
|
|
142
|
+
def cover_stage_abbr(node)
|
143
|
+
stage = get_stage(node)
|
144
|
+
abbr = id_stage_abbr(get_stage(node), get_substage(node), node, true)
|
145
|
+
typeabbr = get_typeabbr(node, true)
|
146
|
+
typeabbr = "" if stage.to_i > 50 || stage.to_i == 60 && get_substage(node).to_i < 60
|
147
|
+
"#{abbr}#{typeabbr}".strip
|
148
|
+
end
|
149
|
+
|
147
150
|
def id_stage_prefix(dn, node, force_year)
|
148
151
|
stage = get_stage(node)
|
149
152
|
typeabbr = get_typeabbr(node)
|
@@ -183,10 +186,12 @@ module Asciidoctor
|
|
183
186
|
node.attr("docsubstage") || ( stage == "60" ? "60" : "00" )
|
184
187
|
end
|
185
188
|
|
186
|
-
def get_typeabbr(node)
|
189
|
+
def get_typeabbr(node, amd = false)
|
187
190
|
case doctype(node)
|
188
191
|
when "technical-report" then "TR "
|
189
192
|
when "technical-specification" then "TS "
|
193
|
+
when "amendment" then (amd ? "Amd " : "")
|
194
|
+
when "technical-corrigendum" then (amd ? "Cor " : "")
|
190
195
|
else
|
191
196
|
nil
|
192
197
|
end
|
@@ -3,9 +3,13 @@ require "metanorma-standoc"
|
|
3
3
|
module Asciidoctor
|
4
4
|
module ISO
|
5
5
|
class Converter < Standoc::Converter
|
6
|
+
def title_lang_part(doc, part, lang)
|
7
|
+
doc.at("//bibdata/title[@type='title-#{part}' and @language='#{lang}']")
|
8
|
+
end
|
9
|
+
|
6
10
|
def title_intro_validate(root)
|
7
|
-
title_intro_en = root
|
8
|
-
title_intro_fr = root
|
11
|
+
title_intro_en = title_lang_part(root, "intro", "en")
|
12
|
+
title_intro_fr = title_lang_part(root, "intro", "fr")
|
9
13
|
if title_intro_en.nil? && !title_intro_fr.nil?
|
10
14
|
@log.add("Style", title_intro_fr, "No English Title Intro!")
|
11
15
|
end
|
@@ -15,8 +19,8 @@ module Asciidoctor
|
|
15
19
|
end
|
16
20
|
|
17
21
|
def title_main_validate(root)
|
18
|
-
title_main_en = root
|
19
|
-
title_main_fr = root
|
22
|
+
title_main_en = title_lang_part(root, "main", "en")
|
23
|
+
title_main_fr = title_lang_part(root, "main", "fr")
|
20
24
|
if title_main_en.nil? && !title_main_fr.nil?
|
21
25
|
@log.add("Style", title_main_fr, "No English Title!")
|
22
26
|
end
|
@@ -26,8 +30,8 @@ module Asciidoctor
|
|
26
30
|
end
|
27
31
|
|
28
32
|
def title_part_validate(root)
|
29
|
-
title_part_en = root
|
30
|
-
title_part_fr = root
|
33
|
+
title_part_en = title_lang_part(root, "part", "en")
|
34
|
+
title_part_fr = title_lang_part(root, "part", "fr")
|
31
35
|
(title_part_en.nil? && !title_part_fr.nil?) &&
|
32
36
|
@log.add("Style", title_part_fr, "No English Title Part!")
|
33
37
|
(!title_part_en.nil? && title_part_fr.nil?) &&
|
@@ -41,20 +45,22 @@ module Asciidoctor
|
|
41
45
|
iec = root.at("//bibdata/contributor[role/@type = 'publisher']/"\
|
42
46
|
"organization[abbreviation = 'IEC' or "\
|
43
47
|
"name = 'International Electrotechnical Commission']")
|
44
|
-
|
48
|
+
subpart && !iec and
|
49
|
+
@log.add("Style", docid, "Subpart defined on non-IEC document!")
|
45
50
|
end
|
46
51
|
|
47
52
|
# ISO/IEC DIR 2, 11.5.2
|
48
53
|
def title_names_type_validate(root)
|
49
54
|
doctypes = /International\sStandard | Technical\sSpecification |
|
50
55
|
Publicly\sAvailable\sSpecification | Technical\sReport | Guide /xi
|
51
|
-
title_main_en = root
|
56
|
+
title_main_en = title_lang_part(root, "main", "en")
|
52
57
|
if !title_main_en.nil? && doctypes.match(title_main_en.text)
|
53
58
|
@log.add("Style", title_main_en, "Main Title may name document type")
|
54
59
|
end
|
55
|
-
title_intro_en = root
|
60
|
+
title_intro_en = title_lang_part(root, "intro", "en")
|
56
61
|
if !title_intro_en.nil? && doctypes.match(title_intro_en.text)
|
57
|
-
@log.add("Style", title_intro_en,
|
62
|
+
@log.add("Style", title_intro_en,
|
63
|
+
"Title Intro may name document type")
|
58
64
|
end
|
59
65
|
end
|
60
66
|
|
@@ -64,8 +70,9 @@ module Asciidoctor
|
|
64
70
|
title = s&.at("./title")&.text || s.name
|
65
71
|
s.xpath("./clause | ./terms | ./references").each do |ss|
|
66
72
|
subtitle = ss.at("./title")
|
67
|
-
!subtitle.nil? && !subtitle&.text&.empty?
|
68
|
-
@log.add("Style", ss,
|
73
|
+
!subtitle.nil? && !subtitle&.text&.empty? or
|
74
|
+
@log.add("Style", ss,
|
75
|
+
"#{title}: each first-level subclause must have a title")
|
69
76
|
end
|
70
77
|
end
|
71
78
|
end
|
@@ -82,7 +89,8 @@ module Asciidoctor
|
|
82
89
|
withtitle = withtitle || (subtitle && !subtitle.text.empty?)
|
83
90
|
end
|
84
91
|
notitle && withtitle &&
|
85
|
-
@log.add("Style", nil,
|
92
|
+
@log.add("Style", nil,
|
93
|
+
"#{label}: all subclauses must have a title, or none")
|
86
94
|
end
|
87
95
|
|
88
96
|
def title_validate(root)
|
data/lib/isodoc/iso/index.rb
CHANGED
@@ -27,7 +27,8 @@ module IsoDoc
|
|
27
27
|
c.add_child index_entries(words, index[k], w)
|
28
28
|
end
|
29
29
|
end
|
30
|
-
|
30
|
+
docxml.xpath(ns("//indexsect//xref")).each { |x| x.children.remove }
|
31
|
+
@xrefs.bookmark_anchor_names(docxml)
|
31
32
|
end
|
32
33
|
|
33
34
|
def sortable(s)
|
@@ -5,6 +5,7 @@
|
|
5
5
|
<xsl:param name="svg_images"/>
|
6
6
|
<xsl:param name="external_index"/><!-- path to index xml, generated on 1st pass, based on FOP Intermediate Format -->
|
7
7
|
<xsl:variable name="images" select="document($svg_images)"/>
|
8
|
+
<xsl:param name="basepath"/>
|
8
9
|
|
9
10
|
|
10
11
|
|
@@ -343,8 +344,8 @@
|
|
343
344
|
<fo:declarations>
|
344
345
|
<xsl:call-template name="addPDFUAmeta"/>
|
345
346
|
<xsl:for-each select="//*[local-name() = 'eref'][generate-id(.)=generate-id(key('attachments',@bibitemid)[1])]">
|
346
|
-
<xsl:variable name="url" select="concat('url(',
|
347
|
-
<pdf:embedded-file src="{$url}"/>
|
347
|
+
<xsl:variable name="url" select="concat('url(file:',$basepath, @bibitemid, ')')"/>
|
348
|
+
<pdf:embedded-file src="{$url}" filename="{@bibitemid}"/>
|
348
349
|
</xsl:for-each>
|
349
350
|
</fo:declarations>
|
350
351
|
|
@@ -1650,6 +1651,12 @@
|
|
1650
1651
|
<xsl:if test="@id">
|
1651
1652
|
<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
|
1652
1653
|
</xsl:if>
|
1654
|
+
<!-- bookmarks only in paragraph -->
|
1655
|
+
<xsl:if test="count(iso:bookmark) != 0 and count(*) = count(iso:bookmark) and normalize-space() = ''">
|
1656
|
+
<xsl:attribute name="font-size">0</xsl:attribute>
|
1657
|
+
<xsl:attribute name="margin-bottom">0pt</xsl:attribute>
|
1658
|
+
<xsl:attribute name="line-height">0</xsl:attribute>
|
1659
|
+
</xsl:if>
|
1653
1660
|
<xsl:apply-templates/>
|
1654
1661
|
</xsl:element>
|
1655
1662
|
<xsl:if test="$element-name = 'fo:inline' and not($inline = 'true') and not(local-name(..) = 'admonition')">
|
@@ -1956,6 +1963,7 @@
|
|
1956
1963
|
<!-- =================== -->
|
1957
1964
|
<!-- SVG images processing -->
|
1958
1965
|
<!-- =================== -->
|
1966
|
+
<xsl:template match="*[local-name() = 'figure'][not(*[local-name() = 'image']) and *[local-name() = 'svg']]/*[local-name() = 'name']/*[local-name() = 'bookmark']" priority="2"/>
|
1959
1967
|
<xsl:template match="*[local-name() = 'figure'][not(*[local-name() = 'image'])]/*[local-name() = 'svg']" priority="2">
|
1960
1968
|
|
1961
1969
|
<xsl:choose>
|
@@ -2005,6 +2013,13 @@
|
|
2005
2013
|
<fo:table-cell column-number="2">
|
2006
2014
|
<fo:block>
|
2007
2015
|
<fo:block-container width="{$width_scale}px" height="{$height_scale}px">
|
2016
|
+
<xsl:if test="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
|
2017
|
+
<fo:block line-height="0" font-size="0">
|
2018
|
+
<xsl:for-each select="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
|
2019
|
+
<xsl:call-template name="bookmark"/>
|
2020
|
+
</xsl:for-each>
|
2021
|
+
</fo:block>
|
2022
|
+
</xsl:if>
|
2008
2023
|
<fo:block text-depth="0" line-height="0" font-size="0">
|
2009
2024
|
<fo:instream-foreign-object fox:alt-text="{../*[local-name() = 'name']}">
|
2010
2025
|
<xsl:attribute name="width">100%</xsl:attribute>
|
@@ -2158,7 +2173,7 @@
|
|
2158
2173
|
<!-- =================== -->
|
2159
2174
|
|
2160
2175
|
<!-- For express listings PDF attachments -->
|
2161
|
-
<xsl:template match="*[local-name() = 'eref'][contains(
|
2176
|
+
<xsl:template match="*[local-name() = 'eref'][contains(@bibitemid, '.exp')]" priority="2">
|
2162
2177
|
<fo:inline xsl:use-attribute-sets="eref-style">
|
2163
2178
|
<xsl:variable name="url" select="concat('url(embedded-file:', @bibitemid, ')')"/>
|
2164
2179
|
<fo:basic-link external-destination="{$url}" fox:alt-text="{@citeas}">
|
@@ -6111,8 +6126,8 @@
|
|
6111
6126
|
<fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
|
6112
6127
|
<xsl:apply-templates/>
|
6113
6128
|
</fo:block>
|
6114
|
-
</xsl:template><xsl:template match="*[local-name() = 'bookmark']">
|
6115
|
-
<fo:inline id="{@id}"/>
|
6129
|
+
</xsl:template><xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
|
6130
|
+
<fo:inline id="{@id}" font-size="1pt"/>
|
6116
6131
|
</xsl:template><xsl:template match="*[local-name() = 'errata']">
|
6117
6132
|
<!-- <row>
|
6118
6133
|
<date>05-07-2013</date>
|
@@ -5,6 +5,7 @@
|
|
5
5
|
<xsl:param name="svg_images"/>
|
6
6
|
<xsl:param name="external_index"/><!-- path to index xml, generated on 1st pass, based on FOP Intermediate Format -->
|
7
7
|
<xsl:variable name="images" select="document($svg_images)"/>
|
8
|
+
<xsl:param name="basepath"/>
|
8
9
|
|
9
10
|
|
10
11
|
|
@@ -343,8 +344,8 @@
|
|
343
344
|
<fo:declarations>
|
344
345
|
<xsl:call-template name="addPDFUAmeta"/>
|
345
346
|
<xsl:for-each select="//*[local-name() = 'eref'][generate-id(.)=generate-id(key('attachments',@bibitemid)[1])]">
|
346
|
-
<xsl:variable name="url" select="concat('url(',
|
347
|
-
<pdf:embedded-file src="{$url}"/>
|
347
|
+
<xsl:variable name="url" select="concat('url(file:',$basepath, @bibitemid, ')')"/>
|
348
|
+
<pdf:embedded-file src="{$url}" filename="{@bibitemid}"/>
|
348
349
|
</xsl:for-each>
|
349
350
|
</fo:declarations>
|
350
351
|
|
@@ -1650,6 +1651,12 @@
|
|
1650
1651
|
<xsl:if test="@id">
|
1651
1652
|
<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
|
1652
1653
|
</xsl:if>
|
1654
|
+
<!-- bookmarks only in paragraph -->
|
1655
|
+
<xsl:if test="count(iso:bookmark) != 0 and count(*) = count(iso:bookmark) and normalize-space() = ''">
|
1656
|
+
<xsl:attribute name="font-size">0</xsl:attribute>
|
1657
|
+
<xsl:attribute name="margin-bottom">0pt</xsl:attribute>
|
1658
|
+
<xsl:attribute name="line-height">0</xsl:attribute>
|
1659
|
+
</xsl:if>
|
1653
1660
|
<xsl:apply-templates/>
|
1654
1661
|
</xsl:element>
|
1655
1662
|
<xsl:if test="$element-name = 'fo:inline' and not($inline = 'true') and not(local-name(..) = 'admonition')">
|
@@ -1956,6 +1963,7 @@
|
|
1956
1963
|
<!-- =================== -->
|
1957
1964
|
<!-- SVG images processing -->
|
1958
1965
|
<!-- =================== -->
|
1966
|
+
<xsl:template match="*[local-name() = 'figure'][not(*[local-name() = 'image']) and *[local-name() = 'svg']]/*[local-name() = 'name']/*[local-name() = 'bookmark']" priority="2"/>
|
1959
1967
|
<xsl:template match="*[local-name() = 'figure'][not(*[local-name() = 'image'])]/*[local-name() = 'svg']" priority="2">
|
1960
1968
|
|
1961
1969
|
<xsl:choose>
|
@@ -2005,6 +2013,13 @@
|
|
2005
2013
|
<fo:table-cell column-number="2">
|
2006
2014
|
<fo:block>
|
2007
2015
|
<fo:block-container width="{$width_scale}px" height="{$height_scale}px">
|
2016
|
+
<xsl:if test="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
|
2017
|
+
<fo:block line-height="0" font-size="0">
|
2018
|
+
<xsl:for-each select="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
|
2019
|
+
<xsl:call-template name="bookmark"/>
|
2020
|
+
</xsl:for-each>
|
2021
|
+
</fo:block>
|
2022
|
+
</xsl:if>
|
2008
2023
|
<fo:block text-depth="0" line-height="0" font-size="0">
|
2009
2024
|
<fo:instream-foreign-object fox:alt-text="{../*[local-name() = 'name']}">
|
2010
2025
|
<xsl:attribute name="width">100%</xsl:attribute>
|
@@ -2158,7 +2173,7 @@
|
|
2158
2173
|
<!-- =================== -->
|
2159
2174
|
|
2160
2175
|
<!-- For express listings PDF attachments -->
|
2161
|
-
<xsl:template match="*[local-name() = 'eref'][contains(
|
2176
|
+
<xsl:template match="*[local-name() = 'eref'][contains(@bibitemid, '.exp')]" priority="2">
|
2162
2177
|
<fo:inline xsl:use-attribute-sets="eref-style">
|
2163
2178
|
<xsl:variable name="url" select="concat('url(embedded-file:', @bibitemid, ')')"/>
|
2164
2179
|
<fo:basic-link external-destination="{$url}" fox:alt-text="{@citeas}">
|
@@ -6111,8 +6126,8 @@
|
|
6111
6126
|
<fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
|
6112
6127
|
<xsl:apply-templates/>
|
6113
6128
|
</fo:block>
|
6114
|
-
</xsl:template><xsl:template match="*[local-name() = 'bookmark']">
|
6115
|
-
<fo:inline id="{@id}"/>
|
6129
|
+
</xsl:template><xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
|
6130
|
+
<fo:inline id="{@id}" font-size="1pt"/>
|
6116
6131
|
</xsl:template><xsl:template match="*[local-name() = 'errata']">
|
6117
6132
|
<!-- <row>
|
6118
6133
|
<date>05-07-2013</date>
|
data/metanorma-iso.gemspec
CHANGED
@@ -43,7 +43,7 @@ Gem::Specification.new do |spec|
|
|
43
43
|
spec.add_development_dependency "guard-rspec", "~> 4.7"
|
44
44
|
spec.add_development_dependency "rake" , "~> 13.0"
|
45
45
|
spec.add_development_dependency "rspec", "~> 3.6"
|
46
|
-
spec.add_development_dependency "rubocop", "
|
46
|
+
spec.add_development_dependency "rubocop", "~> 1.5.2"
|
47
47
|
spec.add_development_dependency "simplecov", "~> 0.15"
|
48
48
|
spec.add_development_dependency "timecop", "~> 0.9"
|
49
49
|
spec.add_development_dependency "iev", "~> 0.2.0"
|
@@ -235,7 +235,7 @@ RSpec.describe Asciidoctor::ISO do
|
|
235
235
|
<language>en</language>
|
236
236
|
<script>Latn</script>
|
237
237
|
<status>
|
238
|
-
<stage abbreviation="NP">10</stage>
|
238
|
+
<stage abbreviation="NP Amd">10</stage>
|
239
239
|
<substage>20</substage>
|
240
240
|
<iteration>3</iteration>
|
241
241
|
</status>
|
@@ -320,7 +320,7 @@ RSpec.describe Asciidoctor::ISO do
|
|
320
320
|
<language>en</language>
|
321
321
|
<script>Latn</script>
|
322
322
|
<status>
|
323
|
-
<stage abbreviation="CD">30</stage>
|
323
|
+
<stage abbreviation="CD Amd">30</stage>
|
324
324
|
<substage>00</substage>
|
325
325
|
</status>
|
326
326
|
<copyright>
|
@@ -389,7 +389,7 @@ RSpec.describe Asciidoctor::ISO do
|
|
389
389
|
<language>en</language>
|
390
390
|
<script>Latn</script>
|
391
391
|
<status>
|
392
|
-
<stage abbreviation="
|
392
|
+
<stage abbreviation="DAmd">40</stage>
|
393
393
|
<substage>00</substage>
|
394
394
|
</status>
|
395
395
|
<copyright>
|
@@ -527,7 +527,7 @@ RSpec.describe Asciidoctor::ISO do
|
|
527
527
|
<language>en</language>
|
528
528
|
<script>Latn</script>
|
529
529
|
<status>
|
530
|
-
<stage abbreviation="CD">30</stage>
|
530
|
+
<stage abbreviation="CD Cor">30</stage>
|
531
531
|
<substage>00</substage>
|
532
532
|
</status>
|
533
533
|
<copyright>
|
@@ -596,7 +596,7 @@ RSpec.describe Asciidoctor::ISO do
|
|
596
596
|
<language>en</language>
|
597
597
|
<script>Latn</script>
|
598
598
|
<status>
|
599
|
-
<stage abbreviation='
|
599
|
+
<stage abbreviation='FDCor'>50</stage>
|
600
600
|
<substage>00</substage>
|
601
601
|
</status>
|
602
602
|
<copyright>
|
@@ -406,7 +406,7 @@ RSpec.describe Asciidoctor::ISO do
|
|
406
406
|
OUTPUT
|
407
407
|
end
|
408
408
|
|
409
|
-
it "defaults substage, defines iteration on stage 50
|
409
|
+
it "defaults substage, defines iteration on stage 50" do
|
410
410
|
output = Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
411
411
|
= Document title
|
412
412
|
Author
|
@@ -417,15 +417,15 @@ RSpec.describe Asciidoctor::ISO do
|
|
417
417
|
:docnumber: 1000
|
418
418
|
:docstage: 50
|
419
419
|
:language: fr
|
420
|
-
:doctype:
|
420
|
+
:doctype: international-standard
|
421
421
|
:iteration: 2
|
422
422
|
INPUT
|
423
423
|
expect(xmlpp(output.sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
424
424
|
<iso-standard type="semantic" version="#{Metanorma::ISO::VERSION}" xmlns="https://www.metanorma.org/ns/iso">
|
425
425
|
<bibdata type="standard">
|
426
|
-
|
427
|
-
|
428
|
-
|
426
|
+
<docidentifier type='ISO'>ISO/FDIS 1000.2</docidentifier>
|
427
|
+
<docidentifier type='iso-with-lang'>ISO/FDIS 1000.2(F)</docidentifier>
|
428
|
+
<docidentifier type='iso-reference'>ISO/FDIS 1000.2(F)</docidentifier>
|
429
429
|
<docnumber>1000</docnumber>
|
430
430
|
<contributor>
|
431
431
|
<role type="author"/>
|
@@ -444,7 +444,7 @@ RSpec.describe Asciidoctor::ISO do
|
|
444
444
|
<language>fr</language>
|
445
445
|
<script>Latn</script>
|
446
446
|
<status>
|
447
|
-
<stage abbreviation="
|
447
|
+
<stage abbreviation="FDIS">50</stage>
|
448
448
|
<substage>00</substage>
|
449
449
|
<iteration>2</iteration>
|
450
450
|
</status>
|
@@ -458,7 +458,7 @@ RSpec.describe Asciidoctor::ISO do
|
|
458
458
|
</owner>
|
459
459
|
</copyright>
|
460
460
|
<ext>
|
461
|
-
<doctype>
|
461
|
+
<doctype>international-standard</doctype>
|
462
462
|
<editorialgroup>
|
463
463
|
<technical-committee/>
|
464
464
|
<subcommittee/>
|
@@ -4,6 +4,7 @@ require "fileutils"
|
|
4
4
|
RSpec.describe Asciidoctor::ISO do
|
5
5
|
context "when xref_error.adoc compilation" do
|
6
6
|
it "generates error file" do
|
7
|
+
FileUtils.rm_f "xref_error.err"
|
7
8
|
File.write("xref_error.adoc", <<~"CONTENT")
|
8
9
|
= X
|
9
10
|
A
|
@@ -1226,7 +1227,7 @@ RSpec.describe Asciidoctor::ISO do
|
|
1226
1227
|
expect(File.read("test.err")).to include "No English Title Intro"
|
1227
1228
|
end
|
1228
1229
|
|
1229
|
-
it "Warning if English title and no French
|
1230
|
+
it "Warning if English title and no French title" do
|
1230
1231
|
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1231
1232
|
= Document title
|
1232
1233
|
Author
|
@@ -1237,6 +1238,7 @@ RSpec.describe Asciidoctor::ISO do
|
|
1237
1238
|
|
1238
1239
|
INPUT
|
1239
1240
|
expect(File.read("test.err")).to include "No French Title"
|
1241
|
+
expect(File.read("test.err")).not_to include "No French Intro"
|
1240
1242
|
end
|
1241
1243
|
|
1242
1244
|
it "Warning if French title and no English title" do
|
@@ -1278,6 +1280,21 @@ RSpec.describe Asciidoctor::ISO do
|
|
1278
1280
|
expect(File.read("test.err")).to include "No English Title Part"
|
1279
1281
|
end
|
1280
1282
|
|
1283
|
+
it "No warning if French main title and English main title" do
|
1284
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1285
|
+
= Document title
|
1286
|
+
Author
|
1287
|
+
:docfile: test.adoc
|
1288
|
+
:nodoc:
|
1289
|
+
:title-part-fr: Title
|
1290
|
+
:title-part-en: Title
|
1291
|
+
:no-isobib:
|
1292
|
+
|
1293
|
+
INPUT
|
1294
|
+
expect(File.read("test.err")).not_to include "No French Title Intro"
|
1295
|
+
expect(File.read("test.err")).not_to include "No French Title Part"
|
1296
|
+
end
|
1297
|
+
|
1281
1298
|
it "Warning if non-IEC document with subpart" do
|
1282
1299
|
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1283
1300
|
= Document title
|
data/spec/spec_helper.rb
CHANGED
@@ -24,6 +24,7 @@ RSpec.configure do |config|
|
|
24
24
|
c.syntax = :expect
|
25
25
|
end
|
26
26
|
|
27
|
+
=begin
|
27
28
|
config.around do |example|
|
28
29
|
Dir.mktmpdir("rspec-") do |dir|
|
29
30
|
tmp_assets = File.join(dir, "spec/assets/")
|
@@ -32,6 +33,7 @@ RSpec.configure do |config|
|
|
32
33
|
Dir.chdir(dir) { example.run }
|
33
34
|
end
|
34
35
|
end
|
36
|
+
=end
|
35
37
|
end
|
36
38
|
|
37
39
|
def strip_guid(xml)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-iso
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.4
|
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-03-
|
11
|
+
date: 2021-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-jing
|
@@ -196,16 +196,16 @@ dependencies:
|
|
196
196
|
name: rubocop
|
197
197
|
requirement: !ruby/object:Gem::Requirement
|
198
198
|
requirements:
|
199
|
-
- -
|
199
|
+
- - "~>"
|
200
200
|
- !ruby/object:Gem::Version
|
201
|
-
version:
|
201
|
+
version: 1.5.2
|
202
202
|
type: :development
|
203
203
|
prerelease: false
|
204
204
|
version_requirements: !ruby/object:Gem::Requirement
|
205
205
|
requirements:
|
206
|
-
- -
|
206
|
+
- - "~>"
|
207
207
|
- !ruby/object:Gem::Version
|
208
|
-
version:
|
208
|
+
version: 1.5.2
|
209
209
|
- !ruby/object:Gem::Dependency
|
210
210
|
name: simplecov
|
211
211
|
requirement: !ruby/object:Gem::Requirement
|