metanorma-iho 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,8 +11,15 @@ module IsoDoc
11
11
  super
12
12
  end
13
13
 
14
+ def pdf_stylesheet(docxml)
15
+ case doctype = docxml&.at(ns("//bibdata/ext/doctype"))&.text
16
+ when "standard" then "iho.standard.xsl"
17
+ else
18
+ "iho.specification.xsl"
19
+ end
20
+ end
21
+
14
22
  def convert(filename, file = nil, debug = false)
15
- return
16
23
  file = File.read(filename, encoding: "utf-8") if file.nil?
17
24
  docxml, outname_html, dir = convert_init(file, filename, debug)
18
25
  /\.xml$/.match(filename) or
@@ -22,8 +29,7 @@ module IsoDoc
22
29
  end
23
30
  FileUtils.rm_rf dir
24
31
  ::Metanorma::Output::XslfoPdf.new.convert(
25
- filename, outname_html + ".pdf",
26
- File.join(@libdir, "rsd.standard.xsl"))
32
+ filename, outname_html + ".pdf", File.join(@libdir, pdf_stylesheet(docxml)))
27
33
  end
28
34
  end
29
35
  end
@@ -6,6 +6,7 @@ module Metanorma
6
6
  {
7
7
  html: ["SourceSansPro-Light", "SourceSerifPro", "SourceCodePro-Light", "HanSans"],
8
8
  doc: ["SourceSansPro-Light", "SourceSerifPro", "SourceCodePro-Light", "HanSans"],
9
+ pdf: ["SourceSansPro-Light", "SourceSerifPro", "SourceCodePro-Light", "HanSans"],
9
10
  }
10
11
  end
11
12
 
@@ -18,7 +19,8 @@ module Metanorma
18
19
  super.merge(
19
20
  html: "html",
20
21
  doc: "doc",
21
- ).tap { |hs| hs.delete(:pdf) }
22
+ pdf: "pdf",
23
+ )
22
24
  end
23
25
 
24
26
  def version
@@ -31,6 +33,8 @@ module Metanorma
31
33
  IsoDoc::IHO::HtmlConvert.new(options).convert(outname, isodoc_node)
32
34
  when :doc
33
35
  IsoDoc::IHO::WordConvert.new(options).convert(outname, isodoc_node)
36
+ when :pdf
37
+ IsoDoc::IHO::PdfConvert.new(options).convert(outname, isodoc_node)
34
38
  else
35
39
  super
36
40
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module IHO
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
28
28
 
29
29
  spec.add_dependency "htmlentities", "~> 4.3.4"
30
- spec.add_dependency "metanorma-standoc", "~> 1.3.0"
30
+ spec.add_dependency "metanorma-standoc", "~> 1.4.0"
31
31
  spec.add_dependency "isodoc", "~> 1.0.0"
32
32
  spec.add_dependency 'metanorma-generic', '~> 1.4.0'
33
33
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iho
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-05-26 00:00:00.000000000 Z
11
+ date: 2020-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.3.0
33
+ version: 1.4.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.3.0
40
+ version: 1.4.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: isodoc
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -237,6 +237,8 @@ files:
237
237
  - lib/isodoc/iho/html/word_iho_titlepage.html
238
238
  - lib/isodoc/iho/html/wordstyle.scss
239
239
  - lib/isodoc/iho/html_convert.rb
240
+ - lib/isodoc/iho/iho.specification.xsl
241
+ - lib/isodoc/iho/iho.standard.xsl
240
242
  - lib/isodoc/iho/metadata.rb
241
243
  - lib/isodoc/iho/pdf_convert.rb
242
244
  - lib/isodoc/iho/word_convert.rb