isodoc 2.6.2 → 2.6.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5b66faaa134c306dcb9be32f7a587682d9910f0863d2d252824eb0df319735ee
4
- data.tar.gz: 9f8b6559fa659841260b72430137ea8f93614f877a22089617e7976f7c2b61a3
3
+ metadata.gz: 7006fe8d8b97cf4224ddb1887323ed738c7710641451295fe87caf164e158059
4
+ data.tar.gz: 63926717876a67586dd1182af72a3c777690b7993f4b10b9b58fd09449a17739
5
5
  SHA512:
6
- metadata.gz: 93267016a42a2f247bbbc9e6cd20d500fb3845fadcf32337e46cb94b84cea9939c11a3180c90355a5350928cc628cb0a88eaf36720775a7eae59adf74e3a70c9
7
- data.tar.gz: deb0709eb785d832c3b3fe2602bd4d3549b2126731c6d44fcc9c752a8d38dab572c3926bed2d27d168bf9e47de65adff8b34699b941185f906742b16138b1d1d
6
+ metadata.gz: 30c171d99b4ca59293c0679ca8906c46bd21d5deba795a39f731c8705f53f2ec38bbd4f4c4b4578536e440088de8e67b985c75f057453d39bc89e4163b6351e1
7
+ data.tar.gz: 52a0c50bdd62a0a973905c71984bf19d12c4b9e9734cf804d89aabff958a922fb77ef0d62e98983fb44994afdfdc5c52d1a39628f88c606b970e52576ab8063c
data/isodoc.gemspec CHANGED
@@ -28,12 +28,11 @@ Gem::Specification.new do |spec|
28
28
  end
29
29
  spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
30
30
 
31
- spec.add_dependency "html2doc", "~> 1.6.0"
31
+ spec.add_dependency "html2doc", "~> 1.7.0"
32
32
  spec.add_dependency "htmlentities", "~> 4.3.4"
33
33
  # spec.add_dependency "isodoc-i18n", "~> 1.1.0" # already in relaton-render and mn-requirements
34
34
  spec.add_dependency "emf2svg"
35
35
  spec.add_dependency "liquid", "~> 5"
36
- spec.add_dependency "plurimath"
37
36
  spec.add_dependency "relaton-cli"
38
37
  # spec.add_dependency "metanorma-utils", "~> 1.5.0" # already in isodoc-i18n
39
38
  spec.add_dependency "mn2pdf"
@@ -10,7 +10,7 @@ require "mn-requirements"
10
10
  module IsoDoc
11
11
  class Convert < ::IsoDoc::Common
12
12
  attr_accessor :options, :i18n, :meta, :xrefs, :reqt_models,
13
- :requirements_processor
13
+ :requirements_processor, :doctype
14
14
 
15
15
  # htmlstylesheet: Generic stylesheet for HTML
16
16
  # htmlstylesheet_override: Override stylesheet for HTML
@@ -7,7 +7,7 @@ module IsoDoc
7
7
  url = node["target"]
8
8
  node["update-type"] == "true" and url = suffix_url(url)
9
9
  out.a **attr_code(href: url, title: node["alt"]) do |l|
10
- if node.text.empty?
10
+ if node.elements.empty? && node.text.strip.empty?
11
11
  l << node["target"].sub(/^mailto:/, "")
12
12
  else node.children.each { |n| parse(n, l) }
13
13
  end
@@ -37,7 +37,7 @@ module IsoDoc
37
37
  end
38
38
 
39
39
  def xref_parse(node, out)
40
- target = if /#/.match?(node["target"])
40
+ target = if node["target"].include?("#")
41
41
  node["target"].sub("#", ".html#")
42
42
  else
43
43
  "##{node['target']}"
data/lib/isodoc/init.rb CHANGED
@@ -19,6 +19,8 @@ module IsoDoc
19
19
  end
20
20
 
21
21
  def toc_init(docxml)
22
+ @doctype = docxml.at(ns("//bibdata/ext/doctype"))&.text
23
+ @xrefs.klass.doctype = @doctype
22
24
  x = "//metanorma-extension/presentation-metadata" \
23
25
  "[name[text() = 'TOC Heading Levels']]/value"
24
26
  n = docxml.at(ns(x.sub("TOC", "DOC TOC"))) and
@@ -77,7 +77,9 @@ module IsoDoc
77
77
  img = emf_encode(img)
78
78
  img.children.first.previous = emf_to_svg(img)
79
79
  elsif img["mimetype"] == "image/svg+xml"
80
- src = svg_to_emf(img) and img << "<emf src='#{src}'/>"
80
+ src = svg_to_emf(img) or return
81
+ img.add_child("<emf/>")
82
+ img.elements.last["src"] = src
81
83
  end
82
84
  end
83
85
 
@@ -136,7 +138,6 @@ module IsoDoc
136
138
  File.exist?(file) and return Metanorma::Utils::datauri(file)
137
139
  file2 = uri + File.extname(file)
138
140
  warn "Checking #{file2}"
139
- warn `ls #{File.dirname(file2)}`
140
141
  File.exist?(file2) and return Metanorma::Utils::datauri(file2)
141
142
  raise %(Fail on #{exe} #{option} #{uri} outputting #{file}: status #{err})
142
143
  end
@@ -1,3 +1,3 @@
1
1
  module IsoDoc
2
- VERSION = "2.6.2".freeze
2
+ VERSION = "2.6.4".freeze
3
3
  end
@@ -9,7 +9,7 @@ module IsoDoc
9
9
  s&.previous_element&.remove # page break
10
10
  s.remove
11
11
  end
12
- intro.sub(/WORDTOC/, toc)
12
+ intro.sub("WORDTOC", toc)
13
13
  else
14
14
  source = docxml.at("//div[@class = 'TOC']") and
15
15
  source.children = toc
data/lib/isodoc/xref.rb CHANGED
@@ -58,6 +58,7 @@ module IsoDoc
58
58
 
59
59
  # extract names for all anchors, xref and label
60
60
  def parse(docxml)
61
+ @doctype = docxml.at(ns("//bibdata/ext/doctype"))&.text
61
62
  @seen = SeenAnchor.new(docxml)
62
63
  amend_preprocess(docxml) if @parse_settings.empty?
63
64
  initial_anchor_names(docxml)
@@ -57,6 +57,7 @@ module IsoDoc
57
57
  file = File.read(input_fname, encoding: "utf-8") if file.nil?
58
58
  input_file, docxml, filename =
59
59
  input_xml_path(input_fname, file, debug)
60
+ @doctype = Nokogiri::XML(file).at(ns("//bibdata/ext/doctype"))&.text
60
61
  ::Metanorma::Output::XslfoPdf.new.convert(
61
62
  filename,
62
63
  output_fname || output_filename(input_fname),
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isodoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.2
4
+ version: 2.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-30 00:00:00.000000000 Z
11
+ date: 2023-09-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: html2doc
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.6.0
19
+ version: 1.7.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.6.0
26
+ version: 1.7.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: htmlentities
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -66,20 +66,6 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '5'
69
- - !ruby/object:Gem::Dependency
70
- name: plurimath
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: '0'
76
- type: :runtime
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: '0'
83
69
  - !ruby/object:Gem::Dependency
84
70
  name: relaton-cli
85
71
  requirement: !ruby/object:Gem::Requirement