From d873e8da3d74dce23702e98a911593fdcc314f3a Mon Sep 17 00:00:00 2001 From: Keith Fahlgren Date: Tue, 16 Jun 2009 03:41:55 +0000 Subject: [PATCH] Cleaning up hardcoded values into parameters and fixing Ruby library to pass them properly; all thanks to patch from Liza Daly --- xsl/epub/bin/lib/docbook.rb | 8 ++++---- xsl/epub/docbook.xsl | 20 +++++--------------- 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/xsl/epub/bin/lib/docbook.rb b/xsl/epub/bin/lib/docbook.rb index ef72ef874..39627d0bd 100755 --- a/xsl/epub/bin/lib/docbook.rb +++ b/xsl/epub/bin/lib/docbook.rb @@ -68,12 +68,12 @@ module DocBook callout_limit = "--stringparam callout.graphics.number.limit #{CALLOUT_LIMIT}" callout_ext = "--stringparam callout.graphics.extension #{CALLOUT_EXT}" html_stylesheet = "--stringparam html.stylesheet #{File.basename(@css_file)}" if @css_file - base = "--stringparam base.dir #{@oebps_dir}/" + base = "--stringparam base.dir #{OEBPS_DIR}/" unless @embedded_fonts.empty? font = "--stringparam epub.embedded.font \"#{File.basename(@embedded_fonts.first)}\"" end - meta = "--stringparam epub.metainf.dir #{@meta_dir}/" - oebps = "--stringparam epub.oebps.dir #{@oebps_dir}/" + meta = "--stringparam epub.metainf.dir #{META_DIR}/" + oebps = "--stringparam epub.oebps.dir #{OEBPS_DIR}/" options = [chunk_quietly, callout_path, callout_limit, @@ -85,7 +85,7 @@ module DocBook html_stylesheet, ].join(" ") # Double-quote stylesheet & file to help Windows cmd.exe - db2epub_cmd = "#{XSLT_PROCESSOR} #{options} \"#{@stylesheet}\" \"#{@collapsed_docbook_file}\"" + db2epub_cmd = "cd #{@output_dir} && #{XSLT_PROCESSOR} #{options} \"#{@stylesheet}\" \"#{@collapsed_docbook_file}\"" STDERR.puts db2epub_cmd if $DEBUG success = system(db2epub_cmd) raise "Could not render as .epub to #{output_file} (#{db2epub_cmd})" unless success diff --git a/xsl/epub/docbook.xsl b/xsl/epub/docbook.xsl index a1e5ba6ab..a11f3ebb8 100644 --- a/xsl/epub/docbook.xsl +++ b/xsl/epub/docbook.xsl @@ -41,6 +41,7 @@ + ncxtoc @@ -363,8 +364,7 @@ - - + application/oebps-package+xml @@ -585,9 +585,6 @@ - @@ -708,8 +705,7 @@ - - + cover Cover @@ -719,7 +715,6 @@ - @@ -795,7 +790,6 @@ - application/x-dtbncx+xml @@ -826,8 +820,7 @@ - - + application/xhtml+xml @@ -847,7 +840,7 @@ ) - + @@ -998,7 +991,6 @@ - - -- 2.40.0