metanorma-iho 0.1.1 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ubuntu.yml +1 -1
- data/lib/asciidoctor/iho/basicdoc.rng +31 -1
- data/lib/asciidoctor/iho/converter.rb +12 -4
- data/lib/asciidoctor/iho/iho.rng +30 -6
- data/lib/asciidoctor/iho/isodoc.rng +124 -15
- data/lib/isodoc/iho/base_convert.rb +121 -10
- data/lib/isodoc/iho/html/htmlstyle.css +1007 -0
- data/lib/isodoc/iho/html/iho.css +810 -0
- data/lib/isodoc/iho/html/iho.scss +18 -4
- data/lib/isodoc/iho/html/wordstyle.css +1252 -0
- data/lib/isodoc/iho/html_convert.rb +14 -12
- data/lib/isodoc/iho/i18n-en.yaml +2 -0
- data/lib/isodoc/iho/iho.specification.xsl +2093 -1478
- data/lib/isodoc/iho/iho.standard.xsl +2093 -1478
- data/lib/isodoc/iho/init.rb +25 -0
- data/lib/isodoc/iho/pdf_convert.rb +0 -1
- data/lib/isodoc/iho/presentation_xml_convert.rb +2 -1
- data/lib/isodoc/iho/word_convert.rb +3 -1
- data/lib/isodoc/iho/xref.rb +11 -1
- data/lib/metanorma/iho/version.rb +1 -1
- data/metanorma-iho.gemspec +3 -3
- data/metanorma.yml +1 -0
- metadata +13 -8
@@ -0,0 +1,25 @@
|
|
1
|
+
require "isodoc"
|
2
|
+
require_relative "metadata"
|
3
|
+
require_relative "xref"
|
4
|
+
|
5
|
+
module IsoDoc
|
6
|
+
module IHO
|
7
|
+
module Init
|
8
|
+
def metadata_init(lang, script, labels)
|
9
|
+
@meta = Metadata.new(lang, script, labels)
|
10
|
+
end
|
11
|
+
|
12
|
+
def xref_init(lang, script, klass, labels, options)
|
13
|
+
html = HtmlConvert.new(language: lang, script: script)
|
14
|
+
@xrefs = Xref.new(lang, script, html, labels, options)
|
15
|
+
end
|
16
|
+
|
17
|
+
def i18n_init(lang, script, i18nyaml = nil)
|
18
|
+
@i18n = I18n.new(
|
19
|
+
lang, script, i18nyaml ||
|
20
|
+
Metanorma::IHO.configuration.i18nyaml || @i18nyaml)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require "isodoc"
|
2
2
|
require "isodoc/generic/word_convert"
|
3
|
-
|
3
|
+
require_relative "init"
|
4
4
|
|
5
5
|
module IsoDoc
|
6
6
|
module IHO
|
@@ -23,6 +23,7 @@ module IsoDoc
|
|
23
23
|
def make_body2(body, docxml)
|
24
24
|
body.div **{ class: "WordSection2" } do |div2|
|
25
25
|
boilerplate docxml, div2
|
26
|
+
preface_block docxml, div2
|
26
27
|
abstract docxml, div2
|
27
28
|
foreword docxml, div2
|
28
29
|
introduction docxml, div2
|
@@ -41,6 +42,7 @@ module IsoDoc
|
|
41
42
|
end
|
42
43
|
|
43
44
|
include BaseConvert
|
45
|
+
include Init
|
44
46
|
end
|
45
47
|
end
|
46
48
|
end
|
data/lib/isodoc/iho/xref.rb
CHANGED
@@ -6,7 +6,7 @@ module IsoDoc
|
|
6
6
|
def annex_name_lbl(clause, num)
|
7
7
|
lbl = clause["obligation"] == "informative" ?
|
8
8
|
@labels["appendix"] : @labels["annex"]
|
9
|
-
l10n("<
|
9
|
+
l10n("<strong>#{lbl} #{num}</strong>")
|
10
10
|
end
|
11
11
|
|
12
12
|
def annex_names(clause, num)
|
@@ -59,6 +59,16 @@ module IsoDoc
|
|
59
59
|
@anchors[c["id"]][:container] = clause["id"]
|
60
60
|
end
|
61
61
|
end
|
62
|
+
|
63
|
+
def section_names1(clause, num, level)
|
64
|
+
@anchors[clause["id"]] =
|
65
|
+
{ label: num, level: level, xref: l10n("#{@labels["subclause"]} #{num}"),
|
66
|
+
type: "clause" }
|
67
|
+
clause.xpath(ns(SUBCLAUSES)).
|
68
|
+
each_with_index do |c, i|
|
69
|
+
section_names1(c, "#{num}.#{i + 1}", level + 1)
|
70
|
+
end
|
71
|
+
end
|
62
72
|
end
|
63
73
|
end
|
64
74
|
end
|
data/metanorma-iho.gemspec
CHANGED
@@ -27,9 +27,9 @@ 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-standoc", "~> 1.
|
31
|
-
spec.add_dependency "isodoc", "~> 1.
|
32
|
-
spec.add_dependency 'metanorma-generic', '~> 1.
|
30
|
+
spec.add_dependency "metanorma-standoc", "~> 1.5.0"
|
31
|
+
spec.add_dependency "isodoc", "~> 1.2.0"
|
32
|
+
spec.add_dependency 'metanorma-generic', '~> 1.6.0'
|
33
33
|
|
34
34
|
spec.add_development_dependency "byebug", "~> 9.1"
|
35
35
|
spec.add_development_dependency "sassc", "2.4.0"
|
data/metanorma.yml
CHANGED
@@ -9,6 +9,7 @@ logo_paths:
|
|
9
9
|
- lib/isodoc/iho/html/image002.png
|
10
10
|
- lib/isodoc/iho/html/image003.png
|
11
11
|
validate_rng_file: lib/asciidoctor/iho/iho.rng
|
12
|
+
i18nyaml: lib/isodoc/iho/i18n-en.yaml
|
12
13
|
htmlcoverpage: lib/isodoc/iho/html/html_iho_titlepage.html
|
13
14
|
htmlintropage: lib/isodoc/iho/html/html_iho_intro.html
|
14
15
|
htmlstylesheet: lib/isodoc/iho/html/htmlstyle.scss
|
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.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-09-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: htmlentities
|
@@ -30,42 +30,42 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.
|
33
|
+
version: 1.5.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.5.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: isodoc
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.
|
47
|
+
version: 1.2.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.
|
54
|
+
version: 1.2.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: metanorma-generic
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 1.
|
61
|
+
version: 1.6.0
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 1.
|
68
|
+
version: 1.6.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: byebug
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -239,7 +239,9 @@ files:
|
|
239
239
|
- lib/isodoc/iho/html/header.html
|
240
240
|
- lib/isodoc/iho/html/html_iho_intro.html
|
241
241
|
- lib/isodoc/iho/html/html_iho_titlepage.html
|
242
|
+
- lib/isodoc/iho/html/htmlstyle.css
|
242
243
|
- lib/isodoc/iho/html/htmlstyle.scss
|
244
|
+
- lib/isodoc/iho/html/iho.css
|
243
245
|
- lib/isodoc/iho/html/iho.scss
|
244
246
|
- lib/isodoc/iho/html/image001.png
|
245
247
|
- lib/isodoc/iho/html/image002.png
|
@@ -249,10 +251,13 @@ files:
|
|
249
251
|
- lib/isodoc/iho/html/scripts.html
|
250
252
|
- lib/isodoc/iho/html/word_iho_intro.html
|
251
253
|
- lib/isodoc/iho/html/word_iho_titlepage.html
|
254
|
+
- lib/isodoc/iho/html/wordstyle.css
|
252
255
|
- lib/isodoc/iho/html/wordstyle.scss
|
253
256
|
- lib/isodoc/iho/html_convert.rb
|
257
|
+
- lib/isodoc/iho/i18n-en.yaml
|
254
258
|
- lib/isodoc/iho/iho.specification.xsl
|
255
259
|
- lib/isodoc/iho/iho.standard.xsl
|
260
|
+
- lib/isodoc/iho/init.rb
|
256
261
|
- lib/isodoc/iho/metadata.rb
|
257
262
|
- lib/isodoc/iho/pdf_convert.rb
|
258
263
|
- lib/isodoc/iho/presentation_xml_convert.rb
|