diff options
Diffstat (limited to 'lib/sisu/xhtml_epub2.rb')
-rw-r--r-- | lib/sisu/xhtml_epub2.rb | 120 |
1 files changed, 63 insertions, 57 deletions
diff --git a/lib/sisu/xhtml_epub2.rb b/lib/sisu/xhtml_epub2.rb index 513b8436..8f6ef05a 100644 --- a/lib/sisu/xhtml_epub2.rb +++ b/lib/sisu/xhtml_epub2.rb @@ -1,57 +1,55 @@ -# encoding: utf-8 -=begin - -* Name: SiSU - -** Description: documents, structuring, processing, publishing, search -*** epub generation, processing - -** Author: Ralph Amissah - [ralph@amissah.com] - [ralph.amissah@gmail.com] - -** Copyright: (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, - 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Ralph Amissah, - All Rights Reserved. - -** License: GPL 3 or later: - - SiSU, a framework for document structuring, publishing and search - - Copyright (C) Ralph Amissah - - This program is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the Free - Software Foundation, either version 3 of the License, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - - You should have received a copy of the GNU General Public License along with - this program. If not, see [http://www.gnu.org/licenses/]. - - If you have Internet connection, the latest version of the GPL should be - available at these locations: - [http://www.fsf.org/licensing/licenses/gpl.html] - [http://www.gnu.org/licenses/gpl.html] - -** SiSU uses: - * Standard SiSU markup syntax, - * Standard SiSU meta-markup syntax, and the - * Standard SiSU object citation numbering and system - -** Hompages: - [http://www.jus.uio.no/sisu] - [http://www.sisudoc.org] - -** Git - [http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=summary] - [http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=blob;f=lib/sisu/xhtml_epub2.rb;hb=HEAD] - -=end +#encoding: utf-8 +#- Name: SiSU +# +# - Description: documents, structuring, processing, publishing, search +# xhtml +# +# - Author: Ralph Amissah +# <ralph.amissah@gmail.com> +# +# - Copyright: (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, +# 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2019, +# 2020, 2021, Ralph Amissah, +# All Rights Reserved. +# +# - License: GPL 3 or later: +# +# SiSU, a framework for document structuring, publishing and search +# +# Copyright (C) Ralph Amissah +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the Free +# Software Foundation, either version 3 of the License, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. +# +# You should have received a copy of the GNU General Public License along with +# this program. If not, see <http://www.gnu.org/licenses/>. +# +# If you have Internet connection, the latest version of the GPL should be +# available at these locations: +# <http://www.fsf.org/licensing/licenses/gpl.html> +# <http://www.gnu.org/licenses/gpl.html> +# +# <http://www.sisudoc.org/sisu/en/manifest/gpl.fsf.html> +# +# - SiSU uses: +# - Standard SiSU markup syntax, +# - Standard SiSU meta-markup syntax, and the +# - Standard SiSU object citation numbering and system +# +# - Homepages: +# <http://www.sisudoc.org> +# +# - Git +# <https://git.sisudoc.org/projects/> +# <https://git.sisudoc.org/projects/?p=software/sisu.git;a=summary> +# <https://git.sisudoc.org/projects/?p=markup/sisu-markup-samples.git;a=summary> module SiSU_XHTML_EPUB2 begin require 'pstore' @@ -579,7 +577,7 @@ module SiSU_XHTML_EPUB2 ocn=dob.ocn toc={} if ocn \ - and ocn !~/#/ + and ocn.to_s !~/#/ p_num=SiSU_XHTML_EPUB2_Format::ParagraphNumber.new(@md,ocn) lnk_n_txt=%{ <a href="#{@@seg_url}#{Sfx[:epub_xhtml]}#o#{ocn}"> #{linkname} @@ -600,7 +598,7 @@ module SiSU_XHTML_EPUB2 ocn=dob.ocn toc={} if ocn \ - and ocn !~/#/ + and ocn.to_s !~/#/ p_num=SiSU_XHTML_EPUB2_Format::ParagraphNumber.new(@md,ocn) lnk_n_txt=%{ <a href="#{@@seg_url}#{Sfx[:epub_xhtml]}#o#{ocn}"> #{linkname} @@ -621,7 +619,7 @@ module SiSU_XHTML_EPUB2 ocn=dob.ocn toc={} if ocn \ - and ocn !~/#/ + and ocn.to_s !~/#/ p_num=SiSU_XHTML_EPUB2_Format::ParagraphNumber.new(@md,ocn) lnk_n_txt=%{ <a href="#{@@seg_url}#{Sfx[:epub_xhtml]}#o#{ocn}"> #{linkname} @@ -788,6 +786,11 @@ module SiSU_XHTML_EPUB2 end end def images +#puts @md.env.path.image_source_include +#puts @md.env.processing_path.epub +#puts @md.env.path.image_source_include_local +puts @md.file.output_path.epub.rel_image + #img_pth=$sisu_base_data + '/image' img_pth=@md.env.path.image_source_include img_src_pth=unless @md.opt.f_pth[:pth] =~/\/\S+?\/sisupod\/\S+?\/sisupod\/doc/ @md.file.output_path.epub.rel_image @@ -799,6 +802,9 @@ module SiSU_XHTML_EPUB2 if FileTest.directory?("#{@md.env.processing_path.epub}/#{Ep[:d_oebps]}/image") \ && FileTest.file?("#{img_src_pth}/#{x}") FileUtils::cp("#{img_src_pth}/#{x}","#{@md.env.processing_path.epub}/#{Ep[:d_oebps]}/image") + #elsif FileTest.directory?("#{$sisu_base_data}/image") \ + #&& FileTest.file?("#{img_pth}/#{x}") + # FileUtils::cp("#{img_pth}/#{x}","#{@md.env.processing_path.epub}/#{Ep[:d_oebps]}/image") elsif FileTest.directory?("#{@md.env.processing_path.epub}/#{Ep[:d_oebps]}/image") \ && FileTest.file?("#{img_pth}/#{x}") FileUtils::cp("#{img_pth}/#{x}","#{@md.env.processing_path.epub}/#{Ep[:d_oebps]}/image") |