# encoding: utf-8
=begin
* Name: SiSU
* Description: a framework for document structuring, publishing and search
* Author: Ralph Amissah
* Copyright: (C) 1997 - 2012, 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 .
If you have Internet connection, the latest version of the GPL should be
available at these locations:
* SiSU uses:
* Standard SiSU markup syntax,
* Standard SiSU meta-markup syntax, and the
* Standard SiSU object citation numbering and system
* Hompages:
* Download:
* Ralph Amissah
** Description: epub formating, css template
=end
module SiSU_EPUB_Format
include SiSU_Viz
class ParagraphNumber
def initialize(md,ocn)
@md,@ocn=md,ocn.to_s
@ocn ||=''
vz=SiSU_Env::GetInit.instance.skin
end
def ocn_display
@make=SiSU_Env::ProcessingSettings.new(@md)
if @make.build.ocn?
ocn_class='ocn'
if @ocn.to_i==0
@ocn.gsub(/^(\d+|)$/,
%{})
else
@ocn.gsub(/^(\d+|)$/,
%{})
end
else
ocn_class='ocn_off'
@ocn.gsub(/^(\d+|)$/,
%{})
end
end
def name
%{}
end
def id #w3c? "tidy" complains about numbers as identifiers ! annoying
%{id="o#{@ocn}"}
end
def goto
%{}
end
end
class CSS
def css_epub_xhtml
<
WOK
end
=begin
~/epub
|-- META-INF
| `-- container.xml #✓ simple, make sure full-path of rootfile points to metadata.opf
|-- content
| |-- 1.xhtml
| |-- 2.xhtml
| |-- 3.xhtml
| |-- ... .xhtml
| |-- concordance.xhtml
| |-- css
| | `-- xhtml.css
| |-- endnotes.xhtml
| |-- image
| | |-- arrow_next_red.png
| | |-- arrow_prev_red.png
| | |-- arrow_up_red.png
| | `-- bullet_09.png
| |-- index.xhtml
| |-- meta.xhtml
| |-- metadata.xhtml
| `-- toc.xhtml
|-- metadata.opf #(i) metadata dc; (ii) manifest (contents); (iii) spine (mimetypes)
|-- mimetype #✓ application/epub+zip
`-- toc.ncx #✓ (i) head (ii) doc title (iii) navmap, list of navigation points (like chapters)
=end
def doc_type
doc_type_xhtml
end
def mimetype
<
WOK
end
def sections(dob,name)
filename="#{name}#{Sfx[:epub_xhtml]}"
dir_epub_cont="#{@md.env.processing_path.epub}/#{Ep[:d_oebps]}"
segfilename="#{dir_epub_cont}/#{filename}"
output_epub_cont_seg=File.new(segfilename,'w')
output_epub_cont_seg << %{#{doc_type}
#{dob.obj} -
#{@md.html_title}
#{@css.xhtml_epub}
#{@vz.color_body}