metanorma-ogc 1.0.5 → 1.0.6

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.
@@ -11,12 +11,18 @@ module IsoDoc
11
11
  super
12
12
  end
13
13
 
14
+ def pdf_stylesheet(docxml)
15
+ doctype = docxml&.at(ns("//bibdata/ext/doctype"))&.text
16
+ doctype = "other" unless %w(abstract-specification-topic best-practice
17
+ change-request-supporting-document community-practice community-standard
18
+ discussion-paper engineering-report policy reference-model release-notes
19
+ standard user-guide test-suite white-paper).include? doctype
20
+ "ogc.#{doctype}.xsl"
21
+ end
22
+
14
23
  def convert(filename, file = nil, debug = false)
15
24
  file = File.read(filename, encoding: "utf-8") if file.nil?
16
25
  docxml, outname_html, dir = convert_init(file, filename, debug)
17
- doctype = docxml&.at(ns("//bibdata/ext/doctype"))&.text
18
- doctype = "other" unless %w(community-standard engineering-report policy
19
- reference-model release-notes standard user-guide test-suite).include? doctype
20
26
  /\.xml$/.match(filename) or
21
27
  filename = Tempfile.open([outname_html, ".xml"], encoding: "utf-8") do |f|
22
28
  f.write file
@@ -24,10 +30,8 @@ module IsoDoc
24
30
  end
25
31
  FileUtils.rm_rf dir
26
32
  ::Metanorma::Output::XslfoPdf.new.convert(
27
- filename, outname_html + ".pdf",
28
- File.join(@libdir, "unece.#{doctype}.xsl"))
33
+ filename, outname_html + ".pdf", File.join(@libdir, pdf_stylesheet(docxml)))
29
34
  end
30
35
  end
31
36
  end
32
37
  end
33
-
@@ -2,8 +2,8 @@ require "metanorma/processor"
2
2
 
3
3
  module Metanorma
4
4
  module Ogc
5
- def self.pdf_fonts
6
- ["Arial", "Courier", "Times New Roman"]
5
+ def self.fonts_used
6
+ ["Arial", "Courier New", "Times New Roman"]
7
7
  end
8
8
 
9
9
  class Processor < Metanorma::Processor
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ogc
3
- VERSION = "1.0.5"
3
+ VERSION = "1.0.6"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-ogc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
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-01 00:00:00.000000000 Z
11
+ date: 2020-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities
@@ -257,7 +257,12 @@ files:
257
257
  - lib/isodoc/ogc/html_convert.rb
258
258
  - lib/isodoc/ogc/i18n-en.yaml
259
259
  - lib/isodoc/ogc/metadata.rb
260
+ - lib/isodoc/ogc/ogc.abstract-specification-topic.xsl
261
+ - lib/isodoc/ogc/ogc.best-practice.xsl
262
+ - lib/isodoc/ogc/ogc.change-request-supporting-document.xsl
263
+ - lib/isodoc/ogc/ogc.community-practice.xsl
260
264
  - lib/isodoc/ogc/ogc.community-standard.xsl
265
+ - lib/isodoc/ogc/ogc.discussion-paper.xsl
261
266
  - lib/isodoc/ogc/ogc.engineering-report.xsl
262
267
  - lib/isodoc/ogc/ogc.other.xsl
263
268
  - lib/isodoc/ogc/ogc.policy.xsl
@@ -266,6 +271,7 @@ files:
266
271
  - lib/isodoc/ogc/ogc.standard.xsl
267
272
  - lib/isodoc/ogc/ogc.test-suite.xsl
268
273
  - lib/isodoc/ogc/ogc.user-guide.xsl
274
+ - lib/isodoc/ogc/ogc.white-paper.xsl
269
275
  - lib/isodoc/ogc/pdf_convert.rb
270
276
  - lib/isodoc/ogc/reqt.rb
271
277
  - lib/isodoc/ogc/sections.rb