metanorma-iho 0.2.10 → 0.2.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +20 -0
- data/lib/asciidoctor/iho/isodoc.rng +26 -3
- data/lib/isodoc/iho/iho.specification.xsl +18 -2
- data/lib/isodoc/iho/iho.standard.xsl +18 -2
- data/lib/isodoc/iho/xref.rb +28 -13
- data/lib/metanorma/iho/version.rb +1 -1
- data/metanorma-iho.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: bd85496107cc3e3258582fcf76c2fd5dfc160efda0feffc52f99b1569efd28d5
|
4
|
+
data.tar.gz: 45cf3fb26f7f401942b9f709d134a15e907111d153384b34a2d7a44b9d1ccf04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 137cf95e99b5387d1e020144b48ebce1ddb82ead718c8d0667f43a1abd87b5da262e0481860b448c816ec3d129670af8c8ea8be7d3c113ad15d7df8e9a4bf71a
|
7
|
+
data.tar.gz: be22cd670adb4c83a8081152d5ff104b141103d9d2534aefedc8e13afe105b5c51b5ebce551cf45cb3e2baefe47f1437c7a1fb88d0e5740daaa9e416ef7d949d
|
data/.github/workflows/rake.yml
CHANGED
@@ -36,6 +36,9 @@ jobs:
|
|
36
36
|
with:
|
37
37
|
ruby-version: ${{ matrix.ruby }}
|
38
38
|
|
39
|
+
- if: matrix.os == 'macos-latest'
|
40
|
+
run: brew install autoconf automake libtool
|
41
|
+
|
39
42
|
- uses: actions/cache@v2
|
40
43
|
with:
|
41
44
|
path: vendor/bundle
|
@@ -63,4 +66,21 @@ jobs:
|
|
63
66
|
- if: matrix.os == 'windows-latest'
|
64
67
|
run: cinst -y plantuml
|
65
68
|
|
69
|
+
- if: matrix.os == 'macos-latest'
|
70
|
+
run: brew install autoconf automake libtool
|
71
|
+
|
66
72
|
- run: bundle exec rake
|
73
|
+
|
74
|
+
tests-passed:
|
75
|
+
needs: rake
|
76
|
+
runs-on: ubuntu-latest
|
77
|
+
continue-on-error: true
|
78
|
+
steps:
|
79
|
+
- name: Trigger tests passed event
|
80
|
+
uses: Sibz/github-status-action@v1
|
81
|
+
with:
|
82
|
+
authToken: ${{ secrets.METANORMA_CI_PAT_TOKEN || secrets.GITHUB_TOKEN }}
|
83
|
+
context: 'tests-passed-successfully'
|
84
|
+
description: 'Tests passed successfully'
|
85
|
+
state: 'success'
|
86
|
+
sha: ${{ github.event.pull_request.head.sha || github.sha }}
|
@@ -253,6 +253,9 @@
|
|
253
253
|
<data type="boolean"/>
|
254
254
|
</attribute>
|
255
255
|
</optional>
|
256
|
+
<optional>
|
257
|
+
<attribute name="width"/>
|
258
|
+
</optional>
|
256
259
|
<optional>
|
257
260
|
<ref name="colgroup"/>
|
258
261
|
</optional>
|
@@ -836,6 +839,9 @@
|
|
836
839
|
<data type="boolean"/>
|
837
840
|
</attribute>
|
838
841
|
</optional>
|
842
|
+
<optional>
|
843
|
+
<attribute name="number"/>
|
844
|
+
</optional>
|
839
845
|
<optional>
|
840
846
|
<attribute name="obligation">
|
841
847
|
<choice>
|
@@ -891,9 +897,11 @@
|
|
891
897
|
<element name="code">
|
892
898
|
<text/>
|
893
899
|
</element>
|
894
|
-
<
|
895
|
-
<text
|
896
|
-
|
900
|
+
<optional>
|
901
|
+
<element name="text">
|
902
|
+
<text/>
|
903
|
+
</element>
|
904
|
+
</optional>
|
897
905
|
</element>
|
898
906
|
</define>
|
899
907
|
<define name="standard-document">
|
@@ -1063,6 +1071,9 @@
|
|
1063
1071
|
</choice>
|
1064
1072
|
</attribute>
|
1065
1073
|
</optional>
|
1074
|
+
<optional>
|
1075
|
+
<attribute name="number"/>
|
1076
|
+
</optional>
|
1066
1077
|
<optional>
|
1067
1078
|
<attribute name="type"/>
|
1068
1079
|
</optional>
|
@@ -1116,6 +1127,9 @@
|
|
1116
1127
|
<optional>
|
1117
1128
|
<attribute name="type"/>
|
1118
1129
|
</optional>
|
1130
|
+
<optional>
|
1131
|
+
<attribute name="number"/>
|
1132
|
+
</optional>
|
1119
1133
|
<optional>
|
1120
1134
|
<ref name="section-title"/>
|
1121
1135
|
</optional>
|
@@ -1218,6 +1232,9 @@
|
|
1218
1232
|
<optional>
|
1219
1233
|
<attribute name="type"/>
|
1220
1234
|
</optional>
|
1235
|
+
<optional>
|
1236
|
+
<attribute name="number"/>
|
1237
|
+
</optional>
|
1221
1238
|
<optional>
|
1222
1239
|
<attribute name="obligation">
|
1223
1240
|
<choice>
|
@@ -1546,6 +1563,7 @@
|
|
1546
1563
|
<value>add</value>
|
1547
1564
|
<value>modify</value>
|
1548
1565
|
<value>delete</value>
|
1566
|
+
<value>replace</value>
|
1549
1567
|
</choice>
|
1550
1568
|
</attribute>
|
1551
1569
|
<optional>
|
@@ -1576,6 +1594,11 @@
|
|
1576
1594
|
</optional>
|
1577
1595
|
<optional>
|
1578
1596
|
<element name="newcontent">
|
1597
|
+
<optional>
|
1598
|
+
<attribute name="id">
|
1599
|
+
<data type="ID"/>
|
1600
|
+
</attribute>
|
1601
|
+
</optional>
|
1579
1602
|
<zeroOrMore>
|
1580
1603
|
<ref name="BasicBlock"/>
|
1581
1604
|
</zeroOrMore>
|
@@ -1581,7 +1581,12 @@
|
|
1581
1581
|
|
1582
1582
|
<xsl:variable name="table_attributes">
|
1583
1583
|
<attribute name="table-layout">fixed</attribute>
|
1584
|
-
<attribute name="width">
|
1584
|
+
<attribute name="width">
|
1585
|
+
<xsl:choose>
|
1586
|
+
<xsl:when test="@width"><xsl:value-of select="@width"/></xsl:when>
|
1587
|
+
<xsl:otherwise>100%</xsl:otherwise>
|
1588
|
+
</xsl:choose>
|
1589
|
+
</attribute>
|
1585
1590
|
<attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
|
1586
1591
|
<attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
|
1587
1592
|
|
@@ -2748,6 +2753,10 @@
|
|
2748
2753
|
</xsl:if>
|
2749
2754
|
<xsl:apply-templates/>
|
2750
2755
|
</fo:inline>
|
2756
|
+
</xsl:template><xsl:template match="*[local-name()='underline']">
|
2757
|
+
<fo:inline text-decoration="underline">
|
2758
|
+
<xsl:apply-templates/>
|
2759
|
+
</fo:inline>
|
2751
2760
|
</xsl:template><xsl:template match="*[local-name()='del']">
|
2752
2761
|
<fo:inline font-size="10pt" color="red" text-decoration="line-through">
|
2753
2762
|
<xsl:apply-templates/>
|
@@ -4415,6 +4424,8 @@
|
|
4415
4424
|
<xsl:value-of select="translate(.,'. ','')"/>
|
4416
4425
|
</xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
|
4417
4426
|
<xsl:value-of select="substring(.,1,1)"/>
|
4427
|
+
</xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
|
4428
|
+
<fo:inline><xsl:apply-templates/></fo:inline>
|
4418
4429
|
</xsl:template><xsl:template name="convertDate">
|
4419
4430
|
<xsl:param name="date"/>
|
4420
4431
|
<xsl:param name="format" select="'short'"/>
|
@@ -4694,6 +4705,11 @@
|
|
4694
4705
|
<xsl:call-template name="getLang"/>
|
4695
4706
|
</xsl:variable>
|
4696
4707
|
|
4697
|
-
<xsl:
|
4708
|
+
<xsl:choose>
|
4709
|
+
<xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
|
4710
|
+
<xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
|
4711
|
+
</xsl:when>
|
4712
|
+
<xsl:otherwise><xsl:value-of select="$key"/></xsl:otherwise>
|
4713
|
+
</xsl:choose>
|
4698
4714
|
|
4699
4715
|
</xsl:template></xsl:stylesheet>
|
@@ -1581,7 +1581,12 @@
|
|
1581
1581
|
|
1582
1582
|
<xsl:variable name="table_attributes">
|
1583
1583
|
<attribute name="table-layout">fixed</attribute>
|
1584
|
-
<attribute name="width">
|
1584
|
+
<attribute name="width">
|
1585
|
+
<xsl:choose>
|
1586
|
+
<xsl:when test="@width"><xsl:value-of select="@width"/></xsl:when>
|
1587
|
+
<xsl:otherwise>100%</xsl:otherwise>
|
1588
|
+
</xsl:choose>
|
1589
|
+
</attribute>
|
1585
1590
|
<attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
|
1586
1591
|
<attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
|
1587
1592
|
|
@@ -2748,6 +2753,10 @@
|
|
2748
2753
|
</xsl:if>
|
2749
2754
|
<xsl:apply-templates/>
|
2750
2755
|
</fo:inline>
|
2756
|
+
</xsl:template><xsl:template match="*[local-name()='underline']">
|
2757
|
+
<fo:inline text-decoration="underline">
|
2758
|
+
<xsl:apply-templates/>
|
2759
|
+
</fo:inline>
|
2751
2760
|
</xsl:template><xsl:template match="*[local-name()='del']">
|
2752
2761
|
<fo:inline font-size="10pt" color="red" text-decoration="line-through">
|
2753
2762
|
<xsl:apply-templates/>
|
@@ -4415,6 +4424,8 @@
|
|
4415
4424
|
<xsl:value-of select="translate(.,'. ','')"/>
|
4416
4425
|
</xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
|
4417
4426
|
<xsl:value-of select="substring(.,1,1)"/>
|
4427
|
+
</xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
|
4428
|
+
<fo:inline><xsl:apply-templates/></fo:inline>
|
4418
4429
|
</xsl:template><xsl:template name="convertDate">
|
4419
4430
|
<xsl:param name="date"/>
|
4420
4431
|
<xsl:param name="format" select="'short'"/>
|
@@ -4694,6 +4705,11 @@
|
|
4694
4705
|
<xsl:call-template name="getLang"/>
|
4695
4706
|
</xsl:variable>
|
4696
4707
|
|
4697
|
-
<xsl:
|
4708
|
+
<xsl:choose>
|
4709
|
+
<xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
|
4710
|
+
<xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
|
4711
|
+
</xsl:when>
|
4712
|
+
<xsl:otherwise><xsl:value-of select="$key"/></xsl:otherwise>
|
4713
|
+
</xsl:choose>
|
4698
4714
|
|
4699
4715
|
</xsl:template></xsl:stylesheet>
|
data/lib/isodoc/iho/xref.rb
CHANGED
@@ -2,6 +2,9 @@ require "isodoc/generic/xref"
|
|
2
2
|
|
3
3
|
module IsoDoc
|
4
4
|
module IHO
|
5
|
+
class Counter < IsoDoc::XrefGen::Counter
|
6
|
+
end
|
7
|
+
|
5
8
|
class Xref < IsoDoc::Generic::Xref
|
6
9
|
def annex_name_lbl(clause, num)
|
7
10
|
lbl = clause["obligation"] == "informative" ?
|
@@ -19,9 +22,11 @@ module IsoDoc
|
|
19
22
|
if a = single_annex_special_section(clause)
|
20
23
|
annex_names1(a, "#{num}", 1)
|
21
24
|
else
|
25
|
+
i = Counter.new
|
22
26
|
clause.xpath(ns("./clause | ./references | ./terms | ./definitions")).
|
23
|
-
|
24
|
-
|
27
|
+
each do |c|
|
28
|
+
i.increment(c)
|
29
|
+
annex_names1(c, "#{num}.#{i.print}", 2)
|
25
30
|
end
|
26
31
|
end
|
27
32
|
hierarchical_asset_names(clause, num)
|
@@ -29,13 +34,18 @@ module IsoDoc
|
|
29
34
|
|
30
35
|
def back_anchor_names(docxml)
|
31
36
|
super
|
37
|
+
i = Counter.new
|
32
38
|
docxml.xpath(ns("//annex[@obligation = 'informative']")).
|
33
|
-
|
34
|
-
|
39
|
+
each do |c|
|
40
|
+
i.increment(c)
|
41
|
+
annex_names(c, i.print)
|
35
42
|
end
|
43
|
+
i = Counter.new("@")
|
36
44
|
docxml.xpath(ns("//annex[not(@obligation = 'informative')]")).
|
37
|
-
|
38
|
-
|
45
|
+
each do |c|
|
46
|
+
i.increment(c)
|
47
|
+
i.increment(c) if i.print == "I"
|
48
|
+
annex_names(c, i.print)
|
39
49
|
end
|
40
50
|
end
|
41
51
|
|
@@ -45,16 +55,20 @@ module IsoDoc
|
|
45
55
|
@anchors[clause["id"]] =
|
46
56
|
{ label: num, xref: l10n("#{lbl} #{num}"),
|
47
57
|
level: level, type: "clause" }
|
58
|
+
i = Counter.new
|
48
59
|
clause.xpath(ns("./clause | ./references | ./terms | ./definitions")).
|
49
|
-
|
50
|
-
|
60
|
+
each do |c|
|
61
|
+
i.increment(c)
|
62
|
+
annex_names1(c, "#{num}.#{i.print}", level + 1)
|
51
63
|
end
|
52
64
|
end
|
53
65
|
|
54
66
|
def appendix_names(clause, num)
|
55
|
-
|
67
|
+
i = Counter.new
|
68
|
+
clause.xpath(ns("./appendix")).each_with_index do |c|
|
69
|
+
i.increment(c)
|
56
70
|
@anchors[c["id"]] =
|
57
|
-
anchor_struct(i
|
71
|
+
anchor_struct(i.print, nil, @labels["appendix"], "clause")
|
58
72
|
@anchors[c["id"]][:level] = 2
|
59
73
|
@anchors[c["id"]][:container] = clause["id"]
|
60
74
|
end
|
@@ -64,9 +78,10 @@ module IsoDoc
|
|
64
78
|
@anchors[clause["id"]] =
|
65
79
|
{ label: num, level: level, xref: l10n("#{@labels["subclause"]} #{num}"),
|
66
80
|
type: "clause" }
|
67
|
-
|
68
|
-
|
69
|
-
|
81
|
+
i = Counter.new
|
82
|
+
clause.xpath(ns(SUBCLAUSES)).each_with_index do |c|
|
83
|
+
i.increment(c)
|
84
|
+
section_names1(c, "#{num}.#{i.print}", level + 1)
|
70
85
|
end
|
71
86
|
end
|
72
87
|
end
|
data/metanorma-iho.gemspec
CHANGED
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
|
28
28
|
|
29
29
|
spec.add_dependency "htmlentities", "~> 4.3.4"
|
30
|
-
spec.add_dependency 'metanorma-generic', '~> 1.8.
|
30
|
+
spec.add_dependency 'metanorma-generic', '~> 1.8.2'
|
31
31
|
|
32
32
|
spec.add_development_dependency "byebug", "~> 9.1"
|
33
33
|
spec.add_development_dependency "sassc", "2.4.0"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-iho
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: htmlentities
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.8.
|
33
|
+
version: 1.8.2
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.8.
|
40
|
+
version: 1.8.2
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: byebug
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|