lib/isodoc/function/to_word_html.rb in isodoc-1.6.3 vs lib/isodoc/function/to_word_html.rb in isodoc-1.6.4
- old
+ new
@@ -19,13 +19,14 @@
def init_file(filename, debug)
filepath = Pathname.new(filename)
filename = filepath.sub_ext("").sub(/\.presentation$/, "").to_s
dir = init_dir(filename, debug)
@filename = filename
- @localdir = filepath.parent.to_s + "/"
+ @localdir = "#{filepath.parent}/"
@sourcedir = @localdir
- @sourcefilename and @sourcedir = Pathname.new(@sourcefilename).parent.to_s + "/"
+ @sourcefilename and
+ @sourcedir = "#{Pathname.new(@sourcefilename).parent}/"
[filename, dir]
end
def init_dir(filename, debug)
dir = "#{filename}_files"
@@ -45,11 +46,11 @@
Pathname.new(@filename).basename.to_s + tmpimagedir_suffix
end
# isodoc.css overrides any CSS injected by Html2Doc, which
# is inserted before this CSS.
- def define_head(head, filename, _dir)
+ def define_head(head, _filename, _dir)
if @standardstylesheet
head.style do |style|
@standardstylesheet.open
stylesheet = @standardstylesheet.read
style.comment "\n#{stylesheet}\n"
@@ -126,9 +127,11 @@
annex isoxml, out
bibliography isoxml, out
end
def boilerplate(node, out)
+ return if @bare
+
boilerplate = node.at(ns("//boilerplate")) or return
out.div **{ class: "authority" } do |s|
boilerplate.children.each do |n|
if n.name == "title"
s.h1 do |h|