metanorma-iho 0.2.9 → 0.2.14
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/.github/workflows/rake.yml +20 -15
- data/.rubocop.yml +6 -0
- data/lib/asciidoctor/iho/basicdoc.rng +20 -3
- data/lib/asciidoctor/iho/iho.rng +6 -0
- data/lib/asciidoctor/iho/isodoc.rng +118 -4
- data/lib/isodoc/iho/iho.specification.xsl +428 -194
- data/lib/isodoc/iho/iho.standard.xsl +428 -194
- data/lib/isodoc/iho/xref.rb +28 -13
- data/lib/metanorma/iho/processor.rb +14 -0
- data/lib/metanorma/iho/version.rb +1 -1
- data/metanorma-iho.gemspec +1 -1
- metadata +6 -6
- data/lib/metanorma/iho/fonts_manifest.yaml +0 -8
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
|
@@ -15,6 +15,20 @@ module Metanorma
|
|
15
15
|
)
|
16
16
|
end
|
17
17
|
|
18
|
+
def fonts_manifest
|
19
|
+
{
|
20
|
+
"Arial" => nil,
|
21
|
+
"Cambria Math" => nil,
|
22
|
+
"Courier" => nil,
|
23
|
+
"Fira Code" => nil,
|
24
|
+
"Source Sans Pro" => [ "Light" ],
|
25
|
+
"Source Serif Pro" => nil,
|
26
|
+
"Source Code Pro" => [ "Light" ],
|
27
|
+
"Source Han Sans" => nil,
|
28
|
+
"STIX Two Math" => nil,
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
18
32
|
def version
|
19
33
|
"Metanorma::IHO #{Metanorma::IHO::VERSION}"
|
20
34
|
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.
|
30
|
+
spec.add_dependency 'metanorma-generic', '~> 1.9.0'
|
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.14
|
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-02-22 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.
|
33
|
+
version: 1.9.0
|
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.
|
40
|
+
version: 1.9.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: byebug
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -189,6 +189,7 @@ extensions: []
|
|
189
189
|
extra_rdoc_files: []
|
190
190
|
files:
|
191
191
|
- ".github/workflows/rake.yml"
|
192
|
+
- ".rubocop.yml"
|
192
193
|
- CODE_OF_CONDUCT.md
|
193
194
|
- Gemfile
|
194
195
|
- LICENSE
|
@@ -235,7 +236,6 @@ files:
|
|
235
236
|
- lib/isodoc/iho/xref.rb
|
236
237
|
- lib/metanorma-iho.rb
|
237
238
|
- lib/metanorma/iho.rb
|
238
|
-
- lib/metanorma/iho/fonts_manifest.yaml
|
239
239
|
- lib/metanorma/iho/processor.rb
|
240
240
|
- lib/metanorma/iho/version.rb
|
241
241
|
- metanorma-iho.gemspec
|
@@ -259,7 +259,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
259
259
|
- !ruby/object:Gem::Version
|
260
260
|
version: '0'
|
261
261
|
requirements: []
|
262
|
-
rubygems_version: 3.
|
262
|
+
rubygems_version: 3.1.4
|
263
263
|
signing_key:
|
264
264
|
specification_version: 4
|
265
265
|
summary: metanorma-iho lets you write IHO in AsciiDoc.
|