asciidoctor-gb 0.2.5 → 0.3.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b75cd19574a490445f390f3e9d69d5bbeeca40695948561b7d9acf97f2037d8e
4
- data.tar.gz: d1752a876bc91b6e41259ec7654871f09b6f05a10175524ffadc68f6d48703ed
3
+ metadata.gz: 05fd934d04e964153dbc4a60fc64478b96b286c42ba80c0b154ab821db11e5de
4
+ data.tar.gz: f05e4828dfe59146657900740535bcd98807536be0fd69c158672d40450af2f9
5
5
  SHA512:
6
- metadata.gz: 6ab057c83e120e8b6a81159b72b093841e255597fe458b906397200c7f9a471de7947506c0292ae4a40bdfeb03914a15662c9da69289ebac7ba4cfda4c31761f
7
- data.tar.gz: 39c61307b05a2ded3e0b34072caeb1c1294796537a3f1866f764c64e4b24a585ee9e52863bb53969efcc3bee9cdb90876867d2172a1ba8303eeb190c82cf8828
6
+ metadata.gz: d2550d7415566a3068d99b8bc2116d6ce36b67917e5656d5b6492e9ffccc55d1b72c7b1f8bf616c26c31685afb65ab2d9c3d72a0f3397ac0e22f9a6f0ef8fa27
7
+ data.tar.gz: c3de41e9727717bf657c38b200b447b2b395310aacf79012341a1a72b14c5d4764ab4b1fd5dd7c5b58a17a36c2c78bac4e6826e1fb2c108b596939ad117a838e
data/Gemfile.lock CHANGED
@@ -1,22 +1,23 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- asciidoctor-gb (0.2.4)
5
- asciidoctor-iso (>= 0.7.9)
6
- isodoc (>= 0.7.0)
4
+ asciidoctor-gb (0.3.0)
5
+ asciidoctor-iso (>= 0.9.0)
6
+ isodoc (>= 0.8.0)
7
7
  twitter_cldr
8
8
 
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- algoliasearch (1.22.0)
12
+ algoliasearch (1.23.2)
13
13
  httpclient (~> 2.8, >= 2.8.3)
14
14
  json (>= 1.5.1)
15
15
  asciidoctor (1.5.7.1)
16
- asciidoctor-iso (0.8.1)
16
+ asciidoctor-iso (0.9.0)
17
17
  asciidoctor (~> 1.5.7)
18
- isobib (~> 0.1.4)
19
- isodoc (>= 0.7.0)
18
+ iso-bib-item (~> 0.1.6)
19
+ isobib (~> 0.1.6)
20
+ isodoc (>= 0.8)
20
21
  ruby-jing
21
22
  asciimath (1.0.4)
22
23
  ast (2.4.0)
@@ -57,14 +58,14 @@ GEM
57
58
  htmlentities (4.3.4)
58
59
  httpclient (2.8.3)
59
60
  image_size (2.0.0)
60
- iso-bib-item (0.1.5)
61
+ iso-bib-item (0.1.6)
61
62
  duplicate
62
63
  isoics (~> 0.1.6)
63
64
  nokogiri
64
65
  isobib (0.1.6)
65
66
  algoliasearch
66
67
  iso-bib-item (~> 0.1.2)
67
- isodoc (0.7.1)
68
+ isodoc (0.8)
68
69
  asciimath
69
70
  html2doc (>= 0.7.1)
70
71
  htmlentities (~> 4.3.4)
@@ -26,8 +26,8 @@ Gem::Specification.new do |spec|
26
26
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
27
27
  spec.require_paths = ["lib"]
28
28
 
29
- spec.add_dependency "asciidoctor-iso", ">= 0.7.9"
30
- spec.add_dependency "isodoc", ">= 0.7.0"
29
+ spec.add_dependency "asciidoctor-iso", ">= 0.9.0"
30
+ spec.add_dependency "isodoc", ">= 0.8.0"
31
31
  spec.add_dependency "twitter_cldr"
32
32
 
33
33
  spec.add_development_dependency "bundler", "~> 1.15"
@@ -37,8 +37,8 @@ module Asciidoctor
37
37
  end
38
38
 
39
39
  def html_converter(node)
40
- node.nil? ? IsoDoc::Gb::Convert.new({}) :
41
- IsoDoc::Gb::Convert.new(
40
+ node.nil? ? IsoDoc::Gb::HtmlConvert.new({}) :
41
+ IsoDoc::Gb::HtmlConvert.new(
42
42
  script: node.attr("script"),
43
43
  bodyfont: node.attr("body-font"),
44
44
  headerfont: node.attr("header-font"),
@@ -1,5 +1,5 @@
1
1
  module Asciidoctor
2
2
  module Gb
3
- VERSION = "0.2.5"
3
+ VERSION = "0.3.0"
4
4
  end
5
5
  end
@@ -4,3 +4,8 @@ require_relative "asciidoctor/gb/version"
4
4
  require "isodoc/gb/gbconvert"
5
5
  require "isodoc/gb/gbhtmlconvert"
6
6
  require "isodoc/gb/gbwordconvert"
7
+
8
+ if defined? Metanorma
9
+ require_relative "metanorma/gb"
10
+ Metanorma::Registry.instance.register(Metanorma::Gb::Processor)
11
+ end
@@ -8,7 +8,7 @@ module IsoDoc
8
8
  module Gb
9
9
  # A {Converter} implementation that generates GB output, and a document
10
10
  # schema encapsulation of the document for validation
11
- class Convert < IsoDoc::Convert
11
+ class HtmlConvert < IsoDoc::HtmlConvert
12
12
  def default_fonts(options)
13
13
  script = options[:script] || "Hans"
14
14
  b = options[:bodyfont] ||
@@ -2,7 +2,7 @@ module IsoDoc
2
2
  module Gb
3
3
  # A {Converter} implementation that generates GB output, and a document
4
4
  # schema encapsulation of the document for validation
5
- class Convert < IsoDoc::Convert
5
+ class HtmlConvert < IsoDoc::HtmlConvert
6
6
  def formula_parse(node, out)
7
7
  out.div **attr_code(id: node["id"], class: "formula") do |div|
8
8
  insert_tab(div, 1)
@@ -89,7 +89,7 @@ module IsoDoc
89
89
 
90
90
  def end_line(_isoxml, out)
91
91
  out.hr **{ width: "25%" }
92
- end
92
+ end
93
93
 
94
94
  def error_parse(node, out)
95
95
  # catch elements not defined in ISO
@@ -110,7 +110,7 @@ module IsoDoc
110
110
  end
111
111
  end
112
112
 
113
- def deprecated_term_parse(node, out)
113
+ def deprecated_term_parse(node, out)
114
114
  out.p **{ class: "DeprecatedTerms" } do |p|
115
115
  p << l10n("#{@deprecated_lbl}: ")
116
116
  node.children.each { |c| parse(c, p) }
@@ -105,6 +105,7 @@ module IsoDoc
105
105
  system "cp #{@common.fileloc(File.join('html', 'blank.png'))} blank.png"
106
106
  @files_to_delete << "blank.png"
107
107
  @files_to_delete << "header.html"
108
+ "header.html"
108
109
  end
109
110
 
110
111
  def header_strip(h)
@@ -0,0 +1,35 @@
1
+ require "metanorma/processor"
2
+
3
+ module Metanorma
4
+ module Gb
5
+ class Processor < Metanorma::Processor
6
+
7
+ def initialize
8
+ @short = :gb
9
+ @input_format = :asciidoc
10
+ @asciidoctor_backend = :gb
11
+ end
12
+
13
+ def output_formats
14
+ {
15
+ html: "html",
16
+ doc: "doc"
17
+ }
18
+ end
19
+
20
+ def input_to_isodoc(file)
21
+ Metanorma::Input::Asciidoc.new.process(file, @asciidoctor_backend)
22
+ end
23
+
24
+ def output(isodoc_node, outname, format, options={})
25
+ case format
26
+ when :html
27
+ IsoDoc::Gb::HtmlConvert.new(options).convert(outname, isodoc_node)
28
+ when :doc
29
+ IsoDoc::Gb::WordConvert.new(options).convert(outname, isodoc_node)
30
+ end
31
+ end
32
+
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,7 @@
1
+ require_relative "./gb/processor"
2
+
3
+ module Metanorma
4
+ module Gb
5
+
6
+ end
7
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciidoctor-gb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-06-18 00:00:00.000000000 Z
11
+ date: 2018-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor-iso
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.7.9
19
+ version: 0.9.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: 0.7.9
26
+ version: 0.9.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: 0.7.0
33
+ version: 0.8.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: 0.7.0
40
+ version: 0.8.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: twitter_cldr
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -305,6 +305,8 @@ files:
305
305
  - lib/isodoc/gb/i18n-en.yaml
306
306
  - lib/isodoc/gb/i18n-zh-Hans.yaml
307
307
  - lib/isodoc/gb/metadata.rb
308
+ - lib/metanorma/gb.rb
309
+ - lib/metanorma/gb/processor.rb
308
310
  homepage: https://github.com/riboseinc/asciidoctor-gb
309
311
  licenses:
310
312
  - MIT
@@ -325,7 +327,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
325
327
  version: '0'
326
328
  requirements: []
327
329
  rubyforge_project:
328
- rubygems_version: 2.7.6
330
+ rubygems_version: 2.7.7
329
331
  signing_key:
330
332
  specification_version: 4
331
333
  summary: asciidoctor-gb lets you write GB standards in AsciiDoc.