metanorma-csa 1.4.12 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1155,4 +1155,3 @@ ol
1155
1155
  ul
1156
1156
  {margin-bottom:0cm;
1157
1157
  margin-left:18pt;}
1158
-
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative 'base_convert'
4
+ require_relative 'init'
4
5
  require 'isodoc'
5
6
 
6
7
  module IsoDoc
@@ -52,6 +53,7 @@ module IsoDoc
52
53
  end
53
54
 
54
55
  include BaseConvert
56
+ include Init
55
57
  end
56
58
  end
57
59
  end
@@ -0,0 +1,2 @@
1
+ annex: Appendix
2
+
@@ -0,0 +1,10 @@
1
+ module IsoDoc
2
+ module Csa
3
+ class I18n < IsoDoc::I18n
4
+ def load_yaml1(lang, script)
5
+ y = YAML.load_file(File.join(File.dirname(__FILE__), "i18n-en.yaml"))
6
+ super.merge(y)
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,24 @@
1
+ require "isodoc"
2
+ require_relative "metadata"
3
+ require_relative "xref"
4
+ require_relative "i18n"
5
+
6
+ module IsoDoc
7
+ module Csa
8
+ module Init
9
+ def metadata_init(lang, script, i18n)
10
+ @meta = Metadata.new(lang, script, i18n)
11
+ end
12
+
13
+ def xref_init(lang, script, klass, i18n, options)
14
+ html = HtmlConvert.new(language: lang, script: script)
15
+ @xrefs = Xref.new(lang, script, html, i18n, options)
16
+ end
17
+
18
+ def i18n_init(lang, script, i18nyaml = nil)
19
+ @i18n = I18n.new(lang, script, i18nyaml || @i18nyaml)
20
+ end
21
+ end
22
+ end
23
+ end
24
+
@@ -13,18 +13,8 @@ module IsoDoc
13
13
  super
14
14
  end
15
15
 
16
- def convert(filename, file = nil, debug = false)
17
- file = File.read(filename, encoding: "utf-8") if file.nil?
18
- docxml, outname_html, dir = convert_init(file, filename, debug)
19
- /\.xml$/.match(filename) or
20
- filename = Tempfile.open([outname_html, ".xml"], encoding: "utf-8") do |f|
21
- f.write file
22
- f.path
23
- end
24
- FileUtils.rm_rf dir
25
- ::Metanorma::Output::XslfoPdf.new.convert(
26
- filename, outname_html + ".pdf",
27
- File.join(@libdir, "csa.standard.xsl"))
16
+ def pdf_stylesheet(docxml)
17
+ "csa.standard.xsl"
28
18
  end
29
19
  end
30
20
  end
@@ -0,0 +1,19 @@
1
+ require_relative "init"
2
+ require "isodoc"
3
+
4
+ module IsoDoc
5
+ module Csa
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, "<br/>", lbl, "title")
13
+ end
14
+
15
+ include Init
16
+ end
17
+ end
18
+ end
19
+
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative 'base_convert'
4
+ require_relative 'init'
4
5
  require 'isodoc'
5
6
 
6
7
  module IsoDoc
@@ -35,6 +36,7 @@ module IsoDoc
35
36
  end
36
37
 
37
38
  include BaseConvert
39
+ include Init
38
40
  end
39
41
  end
40
42
  end
@@ -0,0 +1,6 @@
1
+ module IsoDoc
2
+ module Csa
3
+ class Xref < IsoDoc::Xref
4
+ end
5
+ end
6
+ end
@@ -33,18 +33,16 @@ module Metanorma
33
33
  "Metanorma::Csa #{Metanorma::Csa::VERSION}"
34
34
  end
35
35
 
36
- def input_to_isodoc(file, filename)
37
- Metanorma::Input::Asciidoc.new.process(file, filename, @asciidoctor_backend)
38
- end
39
-
40
- def output(isodoc_node, outname, format, options={})
36
+ def output(isodoc_node, inname, outname, format, options={})
41
37
  case format
42
38
  when :html
43
- IsoDoc::Csa::HtmlConvert.new(options).convert(outname, isodoc_node)
39
+ IsoDoc::Csa::HtmlConvert.new(options).convert(inname, isodoc_node, nil, outname)
44
40
  when :doc
45
- IsoDoc::Csa::WordConvert.new(options).convert(outname, isodoc_node)
41
+ IsoDoc::Csa::WordConvert.new(options).convert(inname, isodoc_node, nil, outname)
46
42
  when :pdf
47
- IsoDoc::Csa::PdfConvert.new(options).convert(outname, isodoc_node)
43
+ IsoDoc::Csa::PdfConvert.new(options).convert(inname, isodoc_node, nil, outname)
44
+ when :presentation
45
+ IsoDoc::Csa::PresentationXMLConvert.new(options).convert(inname, isodoc_node, nil, outname)
48
46
  else
49
47
  super
50
48
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Metanorma
4
4
  module Csa
5
- VERSION = '1.4.12'
5
+ VERSION = '1.6.0'
6
6
  end
7
7
  end
@@ -36,10 +36,11 @@ Gem::Specification.new do |spec|
36
36
  spec.add_dependency "thread_safe"
37
37
  spec.add_dependency "uuidtools"
38
38
 
39
- spec.add_dependency "metanorma-standoc", "~> 1.4.0"
40
- spec.add_dependency "isodoc", "~> 1.0.0"
39
+ spec.add_dependency "metanorma-standoc", "~> 1.5.0"
40
+ spec.add_dependency "isodoc", "~> 1.2.0"
41
41
 
42
42
  spec.add_development_dependency "byebug", "~> 9.1"
43
+ spec.add_development_dependency "sassc", "2.4.0"
43
44
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
44
45
  spec.add_development_dependency "guard", "~> 2.14"
45
46
  spec.add_development_dependency "guard-rspec", "~> 4.7"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-csa
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.12
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-06-08 00:00:00.000000000 Z
11
+ date: 2020-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities
@@ -100,28 +100,28 @@ dependencies:
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 1.4.0
103
+ version: 1.5.0
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 1.4.0
110
+ version: 1.5.0
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: isodoc
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: 1.0.0
117
+ version: 1.2.0
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: 1.0.0
124
+ version: 1.2.0
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: byebug
127
127
  requirement: !ruby/object:Gem::Requirement
@@ -136,6 +136,20 @@ dependencies:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
138
  version: '9.1'
139
+ - !ruby/object:Gem::Dependency
140
+ name: sassc
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - '='
144
+ - !ruby/object:Gem::Version
145
+ version: 2.4.0
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - '='
151
+ - !ruby/object:Gem::Version
152
+ version: 2.4.0
139
153
  - !ruby/object:Gem::Dependency
140
154
  name: equivalent-xml
141
155
  requirement: !ruby/object:Gem::Requirement
@@ -286,6 +300,7 @@ files:
286
300
  - lib/isodoc/csa/base_convert.rb
287
301
  - lib/isodoc/csa/csa.standard.xsl
288
302
  - lib/isodoc/csa/html/csa-logo-white.png
303
+ - lib/isodoc/csa/html/csa.css
289
304
  - lib/isodoc/csa/html/csa.png
290
305
  - lib/isodoc/csa/html/csa.scss
291
306
  - lib/isodoc/csa/html/dots-w@2x.png
@@ -293,15 +308,22 @@ files:
293
308
  - lib/isodoc/csa/html/header.html
294
309
  - lib/isodoc/csa/html/html_csa_intro.html
295
310
  - lib/isodoc/csa/html/html_csa_titlepage.html
311
+ - lib/isodoc/csa/html/htmlstyle.css
296
312
  - lib/isodoc/csa/html/htmlstyle.scss
297
313
  - lib/isodoc/csa/html/scripts.html
298
314
  - lib/isodoc/csa/html/word_csa_intro.html
299
315
  - lib/isodoc/csa/html/word_csa_titlepage.html
316
+ - lib/isodoc/csa/html/wordstyle.css
300
317
  - lib/isodoc/csa/html/wordstyle.scss
301
318
  - lib/isodoc/csa/html_convert.rb
319
+ - lib/isodoc/csa/i18n-en.yaml
320
+ - lib/isodoc/csa/i18n.rb
321
+ - lib/isodoc/csa/init.rb
302
322
  - lib/isodoc/csa/metadata.rb
303
323
  - lib/isodoc/csa/pdf_convert.rb
324
+ - lib/isodoc/csa/presentation_xml_convert.rb
304
325
  - lib/isodoc/csa/word_convert.rb
326
+ - lib/isodoc/csa/xref.rb
305
327
  - lib/metanorma-csa.rb
306
328
  - lib/metanorma/csa.rb
307
329
  - lib/metanorma/csa/processor.rb
@@ -311,7 +333,7 @@ homepage: https://github.com/metanorma/metanorma-csa
311
333
  licenses:
312
334
  - BSD-2-Clause
313
335
  metadata: {}
314
- post_install_message:
336
+ post_install_message:
315
337
  rdoc_options: []
316
338
  require_paths:
317
339
  - lib
@@ -326,9 +348,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
326
348
  - !ruby/object:Gem::Version
327
349
  version: '0'
328
350
  requirements: []
329
- rubyforge_project:
330
- rubygems_version: 2.7.6
331
- signing_key:
351
+ rubygems_version: 3.0.3
352
+ signing_key:
332
353
  specification_version: 4
333
354
  summary: metanorma-csa lets you write CSA Normal Documents (CSAND) in AsciiDoc.
334
355
  test_files: []