metanorma-mpfa 0.4.1 → 0.5.2

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.
@@ -1154,4 +1154,3 @@ ol
1154
1154
  ul
1155
1155
  {margin-bottom:0cm;
1156
1156
  margin-left:18pt;}
1157
-
@@ -1,4 +1,5 @@
1
1
  require_relative "base_convert"
2
+ require_relative "init"
2
3
  require "isodoc"
3
4
 
4
5
  module IsoDoc
@@ -57,6 +58,8 @@ module IsoDoc
57
58
  comments div3
58
59
  end
59
60
  end
61
+
62
+ include Init
60
63
  end
61
64
  end
62
65
  end
@@ -1,2 +1,7 @@
1
1
  clause: Paragraph
2
2
  annex: Appendix
3
+ termsdef: Glossary
4
+ termsdefsymbolsabbrev: Glossary
5
+ termsdefsymbols: Glossary
6
+ termsdefabbrev: Glossary
7
+
@@ -0,0 +1,16 @@
1
+ module IsoDoc
2
+ module MPFA
3
+ class I18n < IsoDoc::I18n
4
+ def load_yaml1(lang, script)
5
+ y = if lang == "en"
6
+ YAML.load_file(File.join(File.dirname(__FILE__), "i18n-en.yaml"))
7
+ elsif lang == "zh" && script == "Hans"
8
+ YAML.load_file(File.join(File.dirname(__FILE__), "i18n-zh-Hans.yaml"))
9
+ else
10
+ YAML.load_file(File.join(File.dirname(__FILE__), "i18n-en.yaml"))
11
+ end
12
+ super.merge(y)
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,28 @@
1
+ require "isodoc"
2
+ require_relative "metadata"
3
+ require_relative "xref"
4
+ require_relative "i18n"
5
+
6
+ module IsoDoc
7
+ module MPFA
8
+ module Init
9
+ def metadata_init(lang, script, labels)
10
+ @meta = Metadata.new(lang, script, labels)
11
+ end
12
+
13
+ def xref_init(lang, script, klass, labels, options)
14
+ html = HtmlConvert.new(language: lang, script: script)
15
+ @xrefs = Xref.new(lang, script, html, labels, options)
16
+ end
17
+
18
+ def i18n_init(lang, script, i18nyaml = nil)
19
+ @i18n = I18n.new(lang, script, i18nyaml || @i18nyaml)
20
+ end
21
+
22
+ def fileloc(loc)
23
+ File.join(File.dirname(__FILE__), loc)
24
+ end
25
+ end
26
+ end
27
+ end
28
+
@@ -1,9 +1,18 @@
1
- require_relative "base_convert"
1
+ require_relative "init"
2
2
  require "isodoc"
3
3
 
4
4
  module IsoDoc
5
5
  module MPFA
6
6
  class PresentationXMLConvert < IsoDoc::PresentationXMLConvert
7
+ def annex1(f)
8
+ lbl = @xrefs.anchor(f['id'], :label)
9
+ if t = f.at(ns("./title"))
10
+ t.children = "<strong>#{t.children.to_xml}</strong>"
11
+ end
12
+ prefix_name(f, " ", lbl, "title")
13
+ end
14
+
15
+ include Init
7
16
  end
8
17
  end
9
18
  end
@@ -1,4 +1,5 @@
1
1
  require_relative "base_convert"
2
+ require_relative "init"
2
3
  require "isodoc"
3
4
 
4
5
  module IsoDoc
@@ -49,6 +50,7 @@ module IsoDoc
49
50
  def make_body2(body, docxml)
50
51
  body.div **{ class: "WordSection2" } do |div2|
51
52
  info docxml, div2
53
+ #preface_block docxml, div2
52
54
  abstract docxml, div2
53
55
  foreword docxml, div2
54
56
  introduction docxml, div2
@@ -57,6 +59,8 @@ module IsoDoc
57
59
  end
58
60
  section_break(body)
59
61
  end
62
+
63
+ include Init
60
64
  end
61
65
  end
62
66
  end
@@ -15,7 +15,7 @@ module IsoDoc
15
15
  end
16
16
 
17
17
  def annex_name_lbl(clause, num)
18
- l10n("<b>#{@labels['annex']} #{num}</b>")
18
+ l10n("<strong>#{@labels['annex']} #{num}</strong>")
19
19
  end
20
20
 
21
21
  def clause_names(docxml, sect_num)
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module MPFA
3
- VERSION = "0.4.1"
3
+ VERSION = "0.5.2"
4
4
  end
5
5
  end
@@ -29,12 +29,12 @@ Gem::Specification.new do |spec|
29
29
  spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
30
30
 
31
31
  spec.add_dependency "htmlentities", "~> 4.3.4"
32
- #spec.add_dependency "nokogiri"
33
- spec.add_dependency "metanorma-standoc", "~> 1.4.0"
34
- spec.add_dependency "isodoc", "~> 1.1.0"
32
+ spec.add_dependency "metanorma-standoc", "~> 1.5.0"
33
+ spec.add_dependency "isodoc", "~> 1.2.0"
35
34
  spec.add_dependency "twitter_cldr"
36
35
 
37
36
  spec.add_development_dependency "byebug", "~> 9.1"
37
+ spec.add_development_dependency "sassc", "2.4.0"
38
38
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
39
39
  spec.add_development_dependency "guard", "~> 2.14"
40
40
  spec.add_development_dependency "guard-rspec", "~> 4.7"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-mpfa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.2
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-07-10 00:00:00.000000000 Z
11
+ date: 2020-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities
@@ -30,28 +30,28 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.4.0
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.4.0
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.1.0
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.1.0
54
+ version: 1.2.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: twitter_cldr
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '9.1'
83
+ - !ruby/object:Gem::Dependency
84
+ name: sassc
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '='
88
+ - !ruby/object:Gem::Version
89
+ version: 2.4.0
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '='
95
+ - !ruby/object:Gem::Version
96
+ version: 2.4.0
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: equivalent-xml
85
99
  requirement: !ruby/object:Gem::Requirement
@@ -232,19 +246,24 @@ files:
232
246
  - lib/isodoc/mpfa/html/header.html
233
247
  - lib/isodoc/mpfa/html/html_rsd_intro.html
234
248
  - lib/isodoc/mpfa/html/html_rsd_titlepage.html
249
+ - lib/isodoc/mpfa/html/htmlstyle.css
235
250
  - lib/isodoc/mpfa/html/htmlstyle.scss
236
251
  - lib/isodoc/mpfa/html/logo.jpg
237
252
  - lib/isodoc/mpfa/html/logo.svg
238
253
  - lib/isodoc/mpfa/html/mpfa-logo-no-text@4x.png
239
254
  - lib/isodoc/mpfa/html/mpfa-logo@4x.png
255
+ - lib/isodoc/mpfa/html/rsd.css
240
256
  - lib/isodoc/mpfa/html/rsd.scss
241
257
  - lib/isodoc/mpfa/html/scripts.html
242
258
  - lib/isodoc/mpfa/html/word_rsd_intro.html
243
259
  - lib/isodoc/mpfa/html/word_rsd_titlepage.html
260
+ - lib/isodoc/mpfa/html/wordstyle.css
244
261
  - lib/isodoc/mpfa/html/wordstyle.scss
245
262
  - lib/isodoc/mpfa/html_convert.rb
246
263
  - lib/isodoc/mpfa/i18n-en.yaml
247
264
  - lib/isodoc/mpfa/i18n-zh-Hans.yaml
265
+ - lib/isodoc/mpfa/i18n.rb
266
+ - lib/isodoc/mpfa/init.rb
248
267
  - lib/isodoc/mpfa/metadata.rb
249
268
  - lib/isodoc/mpfa/presentation_xml_convert.rb
250
269
  - lib/isodoc/mpfa/word_convert.rb