metanorma-iec 2.3.0 → 2.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isodoc/iec/iec.international-standard.xsl +34 -15
- data/lib/metanorma/iec/converter.rb +4 -5
- data/lib/metanorma/iec/front.rb +2 -38
- data/lib/metanorma/iec/isodoc.rng +4 -1
- data/lib/metanorma/iec/version.rb +1 -1
- data/metanorma-iec.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 775ea3e8ebe1ca3b1f99a984c20cd6bab0d47ecd96b66af97c6a3d1701d5539a
|
4
|
+
data.tar.gz: 77c767e8dc7f34d00bbd6efc742932b8799574a26ced31f964688ba99a9f7eb5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36af1bdfc571c505d61b2f645a8c9b17688f4ad66d0fbbd53b169e7ccacb31ba2de46ec98bcff92a7ab84ac9e028e2f29a30855c85be2824549c3794b5d2432f
|
7
|
+
data.tar.gz: c3ad912193409e961b414a963dbf0ef96727be45c1895e6c554054dd5b2210d95f28fcd1a0d64259e849b79020e3976280e94edf68097a603f72960dacf1d006
|
@@ -2424,11 +2424,26 @@
|
|
2424
2424
|
<xsl:value-of select="$font_extended"/><xsl:text>, </xsl:text>
|
2425
2425
|
</xsl:if>
|
2426
2426
|
|
2427
|
-
<xsl:
|
2427
|
+
<xsl:variable name="font_family" select="."/>
|
2428
2428
|
|
2429
|
-
<xsl:
|
2430
|
-
<xsl:
|
2431
|
-
|
2429
|
+
<xsl:choose>
|
2430
|
+
<xsl:when test="$additional_fonts = ''">
|
2431
|
+
<xsl:value-of select="$font_family"/>
|
2432
|
+
</xsl:when>
|
2433
|
+
<xsl:otherwise> <!-- $additional_fonts != '' -->
|
2434
|
+
<xsl:choose>
|
2435
|
+
<xsl:when test="contains($font_family, ',')">
|
2436
|
+
<xsl:value-of select="substring-before($font_family, ',')"/>
|
2437
|
+
<xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
|
2438
|
+
<xsl:text>, </xsl:text><xsl:value-of select="substring-after($font_family, ',')"/>
|
2439
|
+
</xsl:when>
|
2440
|
+
<xsl:otherwise>
|
2441
|
+
<xsl:value-of select="$font_family"/>
|
2442
|
+
<xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
|
2443
|
+
</xsl:otherwise>
|
2444
|
+
</xsl:choose>
|
2445
|
+
</xsl:otherwise>
|
2446
|
+
</xsl:choose>
|
2432
2447
|
</xsl:attribute>
|
2433
2448
|
</xsl:when>
|
2434
2449
|
<xsl:otherwise>
|
@@ -5077,21 +5092,21 @@
|
|
5077
5092
|
|
5078
5093
|
<xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name() = 'example']" priority="2">
|
5079
5094
|
|
5080
|
-
|
5095
|
+
<fo:block xsl:use-attribute-sets="table-note-style">
|
5081
5096
|
|
5082
|
-
|
5097
|
+
<xsl:call-template name="refine_table-note-style"/>
|
5083
5098
|
|
5084
|
-
|
5085
|
-
|
5099
|
+
<!-- Table's note/example name (NOTE, for example) -->
|
5100
|
+
<fo:inline xsl:use-attribute-sets="table-note-name-style">
|
5086
5101
|
|
5087
|
-
|
5102
|
+
<xsl:call-template name="refine_table-note-name-style"/>
|
5088
5103
|
|
5089
|
-
|
5104
|
+
<xsl:apply-templates select="*[local-name() = 'name']"/>
|
5090
5105
|
|
5091
|
-
|
5106
|
+
</fo:inline>
|
5092
5107
|
|
5093
|
-
|
5094
|
-
|
5108
|
+
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
5109
|
+
</fo:block>
|
5095
5110
|
|
5096
5111
|
</xsl:template> <!-- table/note -->
|
5097
5112
|
|
@@ -8292,8 +8307,12 @@
|
|
8292
8307
|
<xsl:variable name="isAdded" select="../@added"/>
|
8293
8308
|
<xsl:variable name="isDeleted" select="../@deleted"/>
|
8294
8309
|
<xsl:choose>
|
8295
|
-
<xsl:when test="ancestor::*[local-name() = 'title']">
|
8310
|
+
<xsl:when test="ancestor::*[local-name() = 'title'] or not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
|
8296
8311
|
<fo:inline padding-left="1mm" padding-right="1mm">
|
8312
|
+
<xsl:if test="not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
|
8313
|
+
<xsl:attribute name="padding-left">0mm</xsl:attribute>
|
8314
|
+
<xsl:attribute name="padding-right">0mm</xsl:attribute>
|
8315
|
+
</xsl:if>
|
8297
8316
|
<xsl:variable name="src">
|
8298
8317
|
<xsl:call-template name="image_src"/>
|
8299
8318
|
</xsl:variable>
|
@@ -8326,7 +8345,7 @@
|
|
8326
8345
|
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
|
8327
8346
|
<xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
|
8328
8347
|
|
8329
|
-
<xsl:if test="@width != '' and @width != 'auto'">
|
8348
|
+
<xsl:if test="@width != '' and @width != 'auto' and @width != 'text-width' and @width != 'full-page-width' and @width != 'narrow'">
|
8330
8349
|
<xsl:attribute name="width">
|
8331
8350
|
<xsl:value-of select="@width"/>
|
8332
8351
|
</xsl:attribute>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require "asciidoctor"
|
2
2
|
require "metanorma-iso"
|
3
3
|
require "metanorma/iso/converter"
|
4
|
-
require_relative "
|
4
|
+
require_relative "front"
|
5
5
|
|
6
6
|
module Metanorma
|
7
7
|
module Iec
|
@@ -29,13 +29,12 @@ module Metanorma
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def doctype_validate(xmldoc)
|
32
|
-
doctype = xmldoc&.at("//bibdata/ext/doctype")&.text
|
33
32
|
%w(international-standard technical-specification technical-report
|
34
33
|
publicly-available-specification international-workshop-agreement
|
35
|
-
guide interpretation-sheet).include? doctype or
|
34
|
+
guide interpretation-sheet).include? @doctype or
|
36
35
|
@log.add("Document Attributes", nil,
|
37
|
-
"#{doctype} is not a recognised document type")
|
38
|
-
if function = xmldoc
|
36
|
+
"#{@doctype} is not a recognised document type")
|
37
|
+
if function = xmldoc.at("//bibdata/ext/function")&.text
|
39
38
|
%w(emc quality-assurance safety environment).include? function or
|
40
39
|
@log.add("Document Attributes", nil,
|
41
40
|
"#{function} is not a recognised document function")
|
data/lib/metanorma/iec/front.rb
CHANGED
@@ -3,44 +3,8 @@ require "pubid-iec"
|
|
3
3
|
module Metanorma
|
4
4
|
module Iec
|
5
5
|
class Converter < ISO::Converter
|
6
|
-
def
|
7
|
-
|
8
|
-
csv_split(publishers)&.each do |p|
|
9
|
-
xml.contributor do |c|
|
10
|
-
c.role type: "author"
|
11
|
-
c.organization do |a|
|
12
|
-
organization(a, p, false, node, !node.attr("publisher"))
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
def metadata_publisher(node, xml)
|
19
|
-
publishers = node.attr("publisher") || "IEC"
|
20
|
-
csv_split(publishers)&.each do |p|
|
21
|
-
xml.contributor do |c|
|
22
|
-
c.role type: "publisher"
|
23
|
-
c.organization do |a|
|
24
|
-
organization(a, p, true, node, !node.attr("publisher"))
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
def metadata_copyright(node, xml)
|
31
|
-
publishers = node.attr("copyright-holder") || node.attr("publisher") ||
|
32
|
-
"IEC"
|
33
|
-
csv_split(publishers)&.each do |p|
|
34
|
-
xml.copyright do |c|
|
35
|
-
c.from (node.attr("copyright-year") || Date.today.year)
|
36
|
-
c.owner do |owner|
|
37
|
-
owner.organization do |o|
|
38
|
-
organization(o, p, true, node, !node.attr("copyright-holder") ||
|
39
|
-
node.attr("publisher"))
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
6
|
+
def home_agency
|
7
|
+
"IEC"
|
44
8
|
end
|
45
9
|
|
46
10
|
def iso_id(node, xml)
|
@@ -17,7 +17,7 @@
|
|
17
17
|
these elements; we just want one namespace for any child grammars
|
18
18
|
of this.
|
19
19
|
-->
|
20
|
-
<!-- VERSION v1.2.
|
20
|
+
<!-- VERSION v1.2.4 -->
|
21
21
|
<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">
|
22
22
|
<include href="reqt.rng"/>
|
23
23
|
<include href="basicdoc.rng">
|
@@ -2068,6 +2068,9 @@
|
|
2068
2068
|
</define>
|
2069
2069
|
<define name="termdefinition">
|
2070
2070
|
<element name="definition">
|
2071
|
+
<optional>
|
2072
|
+
<attribute name="type"/>
|
2073
|
+
</optional>
|
2071
2074
|
<choice>
|
2072
2075
|
<ref name="verbaldefinition"/>
|
2073
2076
|
<ref name="nonverbalrep"/>
|
data/metanorma-iec.gemspec
CHANGED
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
|
|
30
30
|
spec.test_files = `git ls-files -- {spec}/*`.split("\n")
|
31
31
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
|
32
32
|
|
33
|
-
spec.add_dependency "metanorma-iso", "~> 2.5.
|
33
|
+
spec.add_dependency "metanorma-iso", "~> 2.5.2"
|
34
34
|
spec.add_dependency "pubid-iec"
|
35
35
|
spec.add_dependency "ruby-jing"
|
36
36
|
|
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: 2.3.
|
4
|
+
version: 2.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-09-11 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: 2.5.
|
19
|
+
version: 2.5.2
|
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: 2.5.
|
26
|
+
version: 2.5.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: pubid-iec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|