# 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: html formating, css template
=end
module SiSU_HTML_Format
include SiSU_Viz
class ParagraphNumber
def initialize(md,ocn)
@md,@ocn=md,ocn.to_s
@ocn ||=''
vz=SiSU_Env::GetInit.instance.skin
@skin_no_ocn=if defined? vz.ocn_display_off \
and vz.ocn_display_off==true
true
else false
end
end
def ocn_display
if @md.markup.inspect =~/no_ocn/ \
or @md.opt.mod.inspect =~/--no-ocn/ \
or @skin_no_ocn
ocn_class='ocn_off'
@ocn.gsub(/^(\d+|)$/,
%{})
elsif @ocn.to_i==0
@ocn.gsub(/^(\d+|)$/,
%{})
else
ocn_class='ocn'
@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 HeadInformation
require_relative 'shared_xml' # shared_xml.rb
include SiSU_Viz
attr_reader :md,:rdf,:vz
def initialize(md)
@md=md
# DublinCore 1 - title
@vz=SiSU_Env::GetInit.instance.skin
@css=SiSU_Env::CSS_Stylesheet.new(md)
@seg_name_html=(SiSU_HTML::Source::Seg.new.seg_name_html || [])
@seg_name_html_tracker=(SiSU_HTML::Source::Seg.new.seg_name_html_tracker || [])
@toc,@index='toc','index'
@metalink='#metadata'
@tocband_scroll,@tocband_segtoc=nil,nil
end
def doc_types #used in toc & seg_nav_band
scroll=seg=''
wgt=Widget.new(@md)
%{
#{wgt.manifest}
#{wgt.search}
}
end
def rdf
SiSU_XML_Tags::RDF.new(md)
end
def doc_type
%{
\n}
end
def table_close
%{
#{@vz.table_close}}
end
def buttons_home
%{
#{@vz.banner_home_and_index_buttons}
}
end
def copyat
%{#{@vz.paragraph_font_tiny}copy @
#{@vz.txt_home}
}
end
def html_close #moved
%{