metanorma-gb 1.3.27 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/asciidoctor/gb/converter.rb +15 -17
- data/lib/isodoc/gb/{gbbaseconvert.rb → base_convert.rb} +5 -5
- data/lib/isodoc/gb/{gbcleanup.rb → cleanup.rb} +0 -0
- data/lib/isodoc/gb/{gbconvert.rb → common.rb} +1 -1
- data/lib/isodoc/gb/gb.recommendation.xsl +720 -351
- data/lib/isodoc/gb/{gbhtmlconvert.rb → html_convert.rb} +2 -2
- data/lib/isodoc/gb/pdf_convert.rb +2 -11
- data/lib/isodoc/gb/presentation_xml_convert.rb +10 -0
- data/lib/isodoc/gb/{gbwordconvert.rb → word_convert.rb} +2 -2
- data/lib/metanorma-gb.rb +3 -3
- data/lib/metanorma/gb/processor.rb +13 -6
- data/lib/metanorma/gb/version.rb +1 -1
- data/metanorma-gb.gemspec +2 -2
- metadata +16 -16
@@ -1,4 +1,4 @@
|
|
1
|
-
require_relative "
|
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
|
@@ -12,17 +12,8 @@ module IsoDoc
|
|
12
12
|
super
|
13
13
|
end
|
14
14
|
|
15
|
-
def
|
16
|
-
|
17
|
-
docxml, outname_html, dir = convert_init(file, filename, debug)
|
18
|
-
/\.xml$/.match(filename) or
|
19
|
-
filename = Tempfile.open([outname_html, ".xml"], encoding: "utf-8") do |f|
|
20
|
-
f.write file
|
21
|
-
f.path
|
22
|
-
end
|
23
|
-
FileUtils.rm_rf dir
|
24
|
-
::Metanorma::Output::XslfoPdf.new.convert(
|
25
|
-
filename, outname_html + ".pdf", File.join(@libdir, "gb.recommendation.xsl"))
|
15
|
+
def pdf_stylesheet(docxml)
|
16
|
+
"gb.recommendation.xsl"
|
26
17
|
end
|
27
18
|
end
|
28
19
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require_relative "
|
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
|
data/lib/metanorma-gb.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
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/
|
5
|
-
require "isodoc/gb/
|
6
|
-
require "isodoc/gb/
|
4
|
+
require "isodoc/gb/common"
|
5
|
+
require "isodoc/gb/html_convert"
|
6
|
+
require "isodoc/gb/word_convert"
|
7
7
|
require "isodoc/gb/pdf_convert"
|
8
8
|
|
9
9
|
if defined? Metanorma
|
@@ -51,16 +51,23 @@ module Metanorma
|
|
51
51
|
super.merge(new_options)
|
52
52
|
end
|
53
53
|
|
54
|
-
def
|
54
|
+
def use_presentation_xml(ext)
|
55
|
+
return true if ext == :compliant_html
|
56
|
+
super
|
57
|
+
end
|
58
|
+
|
59
|
+
def output(isodoc_node, inname, outname, format, options={})
|
55
60
|
case format
|
56
61
|
when :html
|
57
|
-
IsoDoc::Gb::HtmlConvert.new(options).convert(
|
62
|
+
IsoDoc::Gb::HtmlConvert.new(options).convert(inname, isodoc_node, nil, outname)
|
58
63
|
when :compliant_html
|
59
|
-
IsoDoc::Gb::HtmlConvert.new(options.merge(compliant: true)).convert(
|
60
|
-
when :doc
|
61
|
-
IsoDoc::Gb::WordConvert.new(options).convert(outname, isodoc_node)
|
64
|
+
IsoDoc::Gb::HtmlConvert.new(options.merge(compliant: true)).convert(inname, isodoc_node, nil, outname)
|
62
65
|
when :doc
|
63
|
-
IsoDoc::Gb::
|
66
|
+
IsoDoc::Gb::WordConvert.new(options).convert(inname, isodoc_node, nil, outname)
|
67
|
+
when :pdf
|
68
|
+
IsoDoc::Gb::PdfConvert.new(options).convert(inname, isodoc_node, nil, outname)
|
69
|
+
when :presentation
|
70
|
+
IsoDoc::Gb::PresentationXMLConvert.new(options).convert(inname, isodoc_node, nil, outname)
|
64
71
|
else
|
65
72
|
super
|
66
73
|
end
|
data/lib/metanorma/gb/version.rb
CHANGED
data/metanorma-gb.gemspec
CHANGED
@@ -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.
|
33
|
-
spec.add_dependency "isodoc", "~> 1.
|
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.
|
4
|
+
version: 1.4.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-
|
11
|
+
date: 2020-06-26 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.
|
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.
|
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.
|
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.
|
40
|
+
version: 1.1.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: twitter_cldr
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -262,12 +262,10 @@ files:
|
|
262
262
|
- lib/asciidoctor/gb/reqt.rng
|
263
263
|
- lib/asciidoctor/gb/section_input.rb
|
264
264
|
- lib/asciidoctor/gb/validate.rb
|
265
|
+
- lib/isodoc/gb/base_convert.rb
|
266
|
+
- lib/isodoc/gb/cleanup.rb
|
267
|
+
- lib/isodoc/gb/common.rb
|
265
268
|
- lib/isodoc/gb/gb.recommendation.xsl
|
266
|
-
- lib/isodoc/gb/gbbaseconvert.rb
|
267
|
-
- lib/isodoc/gb/gbcleanup.rb
|
268
|
-
- lib/isodoc/gb/gbconvert.rb
|
269
|
-
- lib/isodoc/gb/gbhtmlconvert.rb
|
270
|
-
- lib/isodoc/gb/gbwordconvert.rb
|
271
269
|
- lib/isodoc/gb/html/_coverpage.scss
|
272
270
|
- lib/isodoc/gb/html/blank.png
|
273
271
|
- lib/isodoc/gb/html/footer.png
|
@@ -304,10 +302,13 @@ files:
|
|
304
302
|
- lib/isodoc/gb/html/word_gb_intro.html
|
305
303
|
- lib/isodoc/gb/html/word_gb_titlepage.html
|
306
304
|
- lib/isodoc/gb/html/wordstyle.scss
|
305
|
+
- lib/isodoc/gb/html_convert.rb
|
307
306
|
- lib/isodoc/gb/i18n-en.yaml
|
308
307
|
- lib/isodoc/gb/i18n-zh-Hans.yaml
|
309
308
|
- lib/isodoc/gb/metadata.rb
|
310
309
|
- lib/isodoc/gb/pdf_convert.rb
|
310
|
+
- lib/isodoc/gb/presentation_xml_convert.rb
|
311
|
+
- lib/isodoc/gb/word_convert.rb
|
311
312
|
- lib/metanorma-gb.rb
|
312
313
|
- lib/metanorma/gb.rb
|
313
314
|
- lib/metanorma/gb/processor.rb
|
@@ -317,7 +318,7 @@ homepage: https://github.com/metanorma/metanorma-gb
|
|
317
318
|
licenses:
|
318
319
|
- BSD-2-Clause
|
319
320
|
metadata: {}
|
320
|
-
post_install_message:
|
321
|
+
post_install_message:
|
321
322
|
rdoc_options: []
|
322
323
|
require_paths:
|
323
324
|
- lib
|
@@ -332,9 +333,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
332
333
|
- !ruby/object:Gem::Version
|
333
334
|
version: '0'
|
334
335
|
requirements: []
|
335
|
-
|
336
|
-
|
337
|
-
signing_key:
|
336
|
+
rubygems_version: 3.0.3
|
337
|
+
signing_key:
|
338
338
|
specification_version: 4
|
339
339
|
summary: metanorma-gb lets you write GB standards in AsciiDoc.
|
340
340
|
test_files: []
|