metanorma-gb 1.3.24 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
- require_relative "gbbaseconvert"
1
+ require_relative "base_convert"
2
2
  require "isodoc"
3
3
 
4
4
  module IsoDoc
@@ -54,7 +54,7 @@ module IsoDoc
54
54
 
55
55
  def annex_name(annex, name, div)
56
56
  div.h1 **{ class: "Annex" } do |t|
57
- t << "#{anchor(annex['id'], :label)}<br/><br/>"
57
+ t << "#{@xrefs.anchor(annex['id'], :label)}<br/><br/>"
58
58
  t.b do |b|
59
59
  name&.children&.each { |c2| parse(c2, b) }
60
60
  end
@@ -0,0 +1,21 @@
1
+ require "isodoc"
2
+
3
+ module IsoDoc
4
+ module Gb
5
+
6
+ # A {Converter} implementation that generates HTML output, and a document
7
+ # schema encapsulation of the document for validation
8
+ #
9
+ class PdfConvert < IsoDoc::XslfoPdfConvert
10
+ def initialize(options)
11
+ @libdir = File.dirname(__FILE__)
12
+ super
13
+ end
14
+
15
+ def pdf_stylesheet(docxml)
16
+ "gb.recommendation.xsl"
17
+ end
18
+ end
19
+ end
20
+ end
21
+
@@ -0,0 +1,10 @@
1
+ require_relative "base_convert"
2
+ require "isodoc"
3
+
4
+ module IsoDoc
5
+ module Gb
6
+ class PresentationXMLConvert < IsoDoc::Iso::PresentationXMLConvert
7
+ end
8
+ end
9
+ end
10
+
@@ -1,4 +1,4 @@
1
- require_relative "gbbaseconvert"
1
+ require_relative "base_convert"
2
2
  require "isodoc"
3
3
 
4
4
  module IsoDoc
@@ -84,7 +84,7 @@ module IsoDoc
84
84
 
85
85
  def annex_name(annex, name, div)
86
86
  div.h1 **{ class: "Annex" } do |t|
87
- t << "#{anchor(annex['id'], :label)}<br/><br/>"
87
+ t << "#{@xrefs.anchor(annex['id'], :label)}<br/><br/>"
88
88
  name&.children&.each { |c2| parse(c2, t) }
89
89
  end
90
90
  end
@@ -1,9 +1,10 @@
1
1
  require "asciidoctor" unless defined? Asciidoctor::Converter
2
2
  require_relative "asciidoctor/gb/converter"
3
3
  require_relative "metanorma/gb/version"
4
- require "isodoc/gb/gbconvert"
5
- require "isodoc/gb/gbhtmlconvert"
6
- require "isodoc/gb/gbwordconvert"
4
+ require "isodoc/gb/common"
5
+ require "isodoc/gb/html_convert"
6
+ require "isodoc/gb/word_convert"
7
+ require "isodoc/gb/pdf_convert"
7
8
 
8
9
  if defined? Metanorma
9
10
  require_relative "metanorma/gb"
@@ -7,6 +7,7 @@ module Metanorma
7
7
  compliant_html: ["SimSun", "Cambria", "SimHei", "Calibri", "Courier New"],
8
8
  html: ["SimSun", "Cambria", "SimHei", "Calibri", "Courier New"],
9
9
  doc: ["SimSun", "Cambria", "SimHei", "Calibri", "Courier New"],
10
+ pdf: ["SimSun", "Cambria", "SimHei", "Calibri", "Courier New"],
10
11
  }
11
12
  end
12
13
 
@@ -22,7 +23,8 @@ module Metanorma
22
23
  super.merge(
23
24
  html: "html",
24
25
  compliant_html: "compliant.html",
25
- doc: "doc"
26
+ doc: "doc",
27
+ pdf: "pdf",
26
28
  )
27
29
  end
28
30
 
@@ -30,10 +32,6 @@ module Metanorma
30
32
  "Metanorma::Gb #{Metanorma::Gb::VERSION}"
31
33
  end
32
34
 
33
- def input_to_isodoc(file, filename)
34
- Metanorma::Input::Asciidoc.new.process(file, filename, @asciidoctor_backend)
35
- end
36
-
37
35
  def extract_options(file)
38
36
  head = file.sub(/\n\n.*$/m, "\n")
39
37
  /\n:standard-logo-img: (?<standardlogoimg>[^\n]+)\n/ =~ head
@@ -49,14 +47,23 @@ module Metanorma
49
47
  super.merge(new_options)
50
48
  end
51
49
 
52
- def output(isodoc_node, outname, format, options={})
50
+ def use_presentation_xml(ext)
51
+ return true if ext == :compliant_html
52
+ super
53
+ end
54
+
55
+ def output(isodoc_node, inname, outname, format, options={})
53
56
  case format
54
57
  when :html
55
- IsoDoc::Gb::HtmlConvert.new(options).convert(outname, isodoc_node)
58
+ IsoDoc::Gb::HtmlConvert.new(options).convert(inname, isodoc_node, nil, outname)
56
59
  when :compliant_html
57
- IsoDoc::Gb::HtmlConvert.new(options.merge(compliant: true)).convert(outname, isodoc_node)
60
+ IsoDoc::Gb::HtmlConvert.new(options.merge(compliant: true)).convert(inname, isodoc_node, nil, outname)
58
61
  when :doc
59
- IsoDoc::Gb::WordConvert.new(options).convert(outname, isodoc_node)
62
+ IsoDoc::Gb::WordConvert.new(options).convert(inname, isodoc_node, nil, outname)
63
+ when :pdf
64
+ IsoDoc::Gb::PdfConvert.new(options).convert(inname, isodoc_node, nil, outname)
65
+ when :presentation
66
+ IsoDoc::Gb::PresentationXMLConvert.new(options).convert(inname, isodoc_node, nil, outname)
60
67
  else
61
68
  super
62
69
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Gb
3
- VERSION = "1.3.24"
3
+ VERSION = "1.4.1"
4
4
  end
5
5
  end
@@ -29,8 +29,8 @@ Gem::Specification.new do |spec|
29
29
  spec.require_paths = ["lib"]
30
30
  spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
31
31
 
32
- spec.add_dependency "metanorma-iso", "~> 1.3.0"
33
- spec.add_dependency "isodoc", "~> 1.0.0"
32
+ spec.add_dependency "metanorma-iso", "~> 1.4.0"
33
+ spec.add_dependency "isodoc", "~> 1.1.0"
34
34
  spec.add_dependency "twitter_cldr", "~> 4.4.4"
35
35
  spec.add_dependency "gb-agencies", "~> 0.0.4"
36
36
  spec.add_dependency "htmlentities", "~> 4.3.4"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-gb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.24
4
+ version: 1.4.1
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-05-26 00:00:00.000000000 Z
11
+ date: 2020-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-iso
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.3.0
19
+ version: 1.4.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.3.0
26
+ version: 1.4.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: isodoc
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.0.0
33
+ version: 1.1.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.0.0
40
+ version: 1.1.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: twitter_cldr
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -255,17 +255,17 @@ files:
255
255
  - lib/asciidoctor/gb/boilerplate.xml
256
256
  - lib/asciidoctor/gb/converter.rb
257
257
  - lib/asciidoctor/gb/front.rb
258
+ - lib/asciidoctor/gb/front_id.rb
258
259
  - lib/asciidoctor/gb/gbstandard.rng
259
260
  - lib/asciidoctor/gb/isodoc.rng
260
261
  - lib/asciidoctor/gb/isostandard.rng
261
262
  - lib/asciidoctor/gb/reqt.rng
262
263
  - lib/asciidoctor/gb/section_input.rb
263
264
  - lib/asciidoctor/gb/validate.rb
264
- - lib/isodoc/gb/gbbaseconvert.rb
265
- - lib/isodoc/gb/gbcleanup.rb
266
- - lib/isodoc/gb/gbconvert.rb
267
- - lib/isodoc/gb/gbhtmlconvert.rb
268
- - lib/isodoc/gb/gbwordconvert.rb
265
+ - lib/isodoc/gb/base_convert.rb
266
+ - lib/isodoc/gb/cleanup.rb
267
+ - lib/isodoc/gb/common.rb
268
+ - lib/isodoc/gb/gb.recommendation.xsl
269
269
  - lib/isodoc/gb/html/_coverpage.scss
270
270
  - lib/isodoc/gb/html/blank.png
271
271
  - lib/isodoc/gb/html/footer.png
@@ -302,9 +302,13 @@ files:
302
302
  - lib/isodoc/gb/html/word_gb_intro.html
303
303
  - lib/isodoc/gb/html/word_gb_titlepage.html
304
304
  - lib/isodoc/gb/html/wordstyle.scss
305
+ - lib/isodoc/gb/html_convert.rb
305
306
  - lib/isodoc/gb/i18n-en.yaml
306
307
  - lib/isodoc/gb/i18n-zh-Hans.yaml
307
308
  - lib/isodoc/gb/metadata.rb
309
+ - lib/isodoc/gb/pdf_convert.rb
310
+ - lib/isodoc/gb/presentation_xml_convert.rb
311
+ - lib/isodoc/gb/word_convert.rb
308
312
  - lib/metanorma-gb.rb
309
313
  - lib/metanorma/gb.rb
310
314
  - lib/metanorma/gb/processor.rb
@@ -314,7 +318,7 @@ homepage: https://github.com/metanorma/metanorma-gb
314
318
  licenses:
315
319
  - BSD-2-Clause
316
320
  metadata: {}
317
- post_install_message:
321
+ post_install_message:
318
322
  rdoc_options: []
319
323
  require_paths:
320
324
  - lib
@@ -329,9 +333,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
329
333
  - !ruby/object:Gem::Version
330
334
  version: '0'
331
335
  requirements: []
332
- rubyforge_project:
333
- rubygems_version: 2.7.6
334
- signing_key:
336
+ rubygems_version: 3.0.3
337
+ signing_key:
335
338
  specification_version: 4
336
339
  summary: metanorma-gb lets you write GB standards in AsciiDoc.
337
340
  test_files: []