asciidoctor-gb 0.2.5 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +10 -9
- data/asciidoctor-gb.gemspec +2 -2
- data/lib/asciidoctor/gb/converter.rb +2 -2
- data/lib/asciidoctor/gb/version.rb +1 -1
- data/lib/asciidoctor-gb.rb +5 -0
- data/lib/isodoc/gb/gbhtmlconvert.rb +1 -1
- data/lib/isodoc/gb/gbhtmlrender.rb +3 -3
- data/lib/isodoc/gb/gbwordconvert.rb +1 -0
- data/lib/metanorma/gb/processor.rb +35 -0
- data/lib/metanorma/gb.rb +7 -0
- metadata +9 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05fd934d04e964153dbc4a60fc64478b96b286c42ba80c0b154ab821db11e5de
|
4
|
+
data.tar.gz: f05e4828dfe59146657900740535bcd98807536be0fd69c158672d40450af2f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
5
|
-
asciidoctor-iso (>= 0.
|
6
|
-
isodoc (>= 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.
|
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.
|
16
|
+
asciidoctor-iso (0.9.0)
|
17
17
|
asciidoctor (~> 1.5.7)
|
18
|
-
|
19
|
-
|
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.
|
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.
|
68
|
+
isodoc (0.8)
|
68
69
|
asciimath
|
69
70
|
html2doc (>= 0.7.1)
|
70
71
|
htmlentities (~> 4.3.4)
|
data/asciidoctor-gb.gemspec
CHANGED
@@ -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.
|
30
|
-
spec.add_dependency "isodoc", ">= 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::
|
41
|
-
IsoDoc::Gb::
|
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"),
|
data/lib/asciidoctor-gb.rb
CHANGED
@@ -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
|
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
|
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) }
|
@@ -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
|
data/lib/metanorma/gb.rb
ADDED
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.
|
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-
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|