})
end
end
end
class ScrollHeadAndSegToc < Toc
include SiSU_Parts_HTML
def initialize(md='',toc='',links_guide_toc='')
@md,@toc,@links_guide_toc=md,toc,links_guide_toc
@make=SiSU_Env::ProcessingSettings.new(@md)
end
def in_common
toc_shared=[]
@segtoc=[]
if (@md.opt.act[:verbose][:set]==:on \
|| @md.opt.act[:verbose_plus][:set]==:on \
|| @md.opt.act[:maintenance][:set]==:on)
SiSU_Screen::Ansi.new(
@md.opt.act[:color_state][:set],
'Scroll & Segtoc'
).txt_grey
end
format_head_toc=SiSU_HTML_Format::HeadToc.new(@md)
dochead=format_head_toc.head
dochead=dochead.gsub(/toc\.(html)/,'doc.\1') #kludge
toc_shared << dochead
@segtoc << format_head_toc.head
if @make.build.html_top_band?
toc_shared << format_head_toc.scroll_head_navigation_band
end
if defined? @md.rights.all
rights=format_head_toc.rights.all
rights=SiSU_HTML_Tune::CleanHTML.new(rights).clean
end
if @md.prefix_b
prefix_b=format_head_toc.notes.prefix_b
prefix_b=SiSU_HTML_Tune::CleanHTML.new(prefix_b).clean
end
if @make.build.html_top_band?
@segtoc << format_head_toc.seg_head_navigation_band
end
toc_shared << format_head_toc.scroll_head_title_banner_open
@segtoc << format_head_toc.seg_head_title_banner_open
tmp_head=nil
doc_title_endnote=@md.title.full.gsub(/(\*+)/,
'\1')
tmp_head=doc_title_endnote + "\n"
txt_obj={ txt: tmp_head }
format_txt_obj=SiSU_HTML_Format::FormatTextObject.new(@md,txt_obj)
toc_shared << format_txt_obj.center_bold
@segtoc << format_txt_obj.center_bold
if defined? @md.creator.author
creator=SiSU_HTML_Tune::CleanHTML.new(@md.creator.author).clean_for_html
creator_endnote=creator.gsub(/(\*+)/,
%{ \\1})
tmp_head=creator_endnote + "\n"
txt_obj={ txt: tmp_head }
format_txt_obj=SiSU_HTML_Format::FormatTextObject.new(@md,txt_obj)
toc_shared << format_txt_obj.center_bold
@segtoc << format_txt_obj.center_bold
end
toc_shared << "#{the_table_close*1}\n"
@segtoc << "#{the_table_close*1}\n"
tmp_head=nil
if @md.prefix_a
tmp_head ||= %{
#{@md.prefix_a}\n}
toc_shared << tmp_head.dup
@segtoc << tmp_head.dup
end
tmp_head=nil
toc_shared << @links_guide_toc
if defined? @md.rights.all #and ? @md.rights.all
toc_shared << rights
end
if defined? @md.prefix_b
toc_shared << prefix_b
end
if @make.build.toc? #Table of Contents added/appended here
toc_shared << @toc[:scr]
end
@segtoc << @links_guide_toc
@segtoc << @toc[:seg]
if defined? @md.rights.all \
and not @md.rights.all.empty?
@segtoc << rights
end
@segtoc << prefix_b if @md.prefix_b
#Segtoc tail added here
@segtoc << "
\n" #bugfix sort later DEBUGNOW
@segtoc << @seg_toc_band_bottom
@segtoc << format_head_toc.seg_navigation_tail << format_head_toc.html_close
@segtoc=@segtoc.flatten.compact #watch
if @md.opt.act[:html_seg][:set]==:on
SiSU_HTML::Source::Output.new(@segtoc,@md).segtoc
end
@segtoc=[]
@toc[:scr],@toc[:seg]=[],[]
toc_shared
end
end
class Table < SiSU_HTML_Table::TableHTML
end
class Scroll < SiSU_HTML_Scroll::Scroll
end
class ScrollOutput
def initialize(scr_toc,scr_body,scr_metadata,scr_owner_details,scr_tails,md)
@scr_toc,@scr_body,@scr_metadata,@scr_owner_details,@scr_tails,@md=scr_toc,scr_body,scr_metadata,scr_owner_details,scr_tails,md
end
def publish
scroll=[]
scroll << @scr_toc << '
' << @scr_tails
scroll=scroll.flatten.compact #watch
end
end
class Seg < SiSU_HTML_Seg::Seg
end
class Output
def initialize(data='',md='')
@data,@md=data,md
@file=SiSU_Env::FileOp.new(md)
@o_str ||=SiSU_Env::ProcessingSettings.new(md).output_dir_structure
end
def scroll
if @md.opt.act[:html_scroll][:set]==:on
begin
@filename_html_scroll=@file.write_file.html_scroll
@data.each do |para|
para=para.strip.
gsub(/<:.+?>/,'').
gsub(Xx[:html_relative2],@file.path_rel_links.html_scroll_2).
gsub(Xx[:html_relative1],@file.path_rel_links.html_scroll_1).
#gsub(/#{Xx[:html_relative]}/,@file.path_rel_links.html_scroll).
gsub(/#{Rx[:mx_fa_clean]}/,'')
unless para =~/\A\s*\Z/
@filename_html_scroll.puts para,"\n"
end
end
rescue
SiSU_Errors::Rescued.new($!,$@,@md.opt.selections.str,@md.fns).location do
__LINE__.to_s + ':' + __FILE__
end
ensure
@filename_html_scroll.close
end
end
end
def segtoc
if @md.opt.act[:html_seg][:set]==:on
begin
@filename_html_segtoc=@file.write_file.html_segtoc
@data.each do |para|
para=para.strip.
gsub(//,'').
gsub(Xx[:html_relative2],@file.path_rel_links.html_seg_2).
gsub(Xx[:html_relative1],@file.path_rel_links.html_seg_1)
unless para =~/\A\s*\Z/
@filename_html_segtoc.puts para,"\n"
end
end
rescue
SiSU_Errors::Rescued.new($!,$@,@md.opt.selections.str,@md.fns).location do
__LINE__.to_s + ':' + __FILE__
end
ensure
@filename_html_segtoc.close
pwd_set=Dir.pwd
idx_lnk=(@o_str.dump_or_redirect?) \
? @file.base_filename.manifest
: @file.base_filename.html_segtoc
mlnk=@file.base_filename.html_seg_index
Dir.chdir(@file.output_path.html_seg.dir)
FileUtils::rm_f(mlnk)
FileUtils::ln_s(idx_lnk,mlnk)
Dir.chdir(pwd_set)
end
end
end
end
end
end
__END__
#+END_SRC
*** html_parts.rb
#+HEADER: :tangle "../lib/sisu/html_parts.rb"
#+BEGIN_SRC ruby
#<>
module SiSU_Parts_HTML
require_relative 'generic_parts' # generic_parts.rb
include SiSU_Parts_Generic
def the_line_break
' '
end
def the_table_close
'
'
end
def the_table_cellpad_box
'"20"'
end
def the_color
def white
'#ffffff'
end
def black
'#000000'
end
def grey_pale
'#eeeeee'
end
def grey_medium
'#cccccc'
end
def grey
'#999999'
end
def blue_ink
'#003399'
end
def blue_tinge
'#e3ecef'
end
def yellow_light
'#fff3b6'
end
def table1
'ffffcc'
end
def table2
'c0d0f0'
end
def band1
%{"#{white}"}
end
def band2
%{"#{white}"}
end
self
end
def the_url_decoration
#def tex_open #'{\UseTextSymbol{OML}{<}}'
# Dx[:url_o]
#end
#def tex_close #'{\UseTextSymbol{OML}{>}}'
# Dx[:url_c]
#end
def xml_open #'<'
Dx[:url_o]
end
def xml_close #'>'
Dx[:url_c]
end
def txt_open
'<'
end
def txt_close
'>'
end
self
end
def the_width
def table1
'"100%"'
end
def table2
'"99%"'
end
def table_txt
'"94%"'
end
def table_txt_r
'"96%"'
end
self
end
def the_png
def _url_path_image_base #used for html image display
"#{Xx[:html_relative2]}_sisu/image"
end
def ico
%{ }
end
def png_home
%{}
end
def png_home_button
rel=@dir.path_rel_links.html_scroll_2
%{}
end
self
end
def the_font
def set_fonts
'verdana, arial, georgia, tahoma, sans-serif, helvetica, times, roman'
#'verdana, arial, georgia, tahoma, sans-serif, helvetica, "times new roman", times, roman'
end
def set_face
%{face="#{set_fonts}"}
end
def set_color
'color="#000000"'
end
def set_size_endnote
'size="3"'
end
def set_small
'size="3"'
end
def set_tiny
'size="2"'
end
def paragraph_font_tiny
%{}
end
def paragraph_font_small
%{}
end
self
end
def the_nav
def txt_homepage
%{
home
}
end
def txt_toc_link
%{
toc
}
end
def txt_doc_link
%{
scroll
}
end
def txt_manifest
#{png_manifest} document manifest
%{
[ document manifest ]
}
end
def txt_concordance
%{
A-Z
}
end
self
end
def the_banner
def home_button_only
%{
#{the_png.png_home_button}
}
end
def banner_band
%{
#{the_table_close}}
end
def instrument_cover_band_scr
'
'
end
def instrument_cover_band_seg
'
'
end
self
end
def the_margin
def txt_0
%{
}
end
def txt_1
%{
}
end
def txt_2
%{
}
end
def txt_3
%{
}
end
def css
'
'
end
def num
'
'
end
def numless
'
'
end
def num_css
'
'
end
self
end
end
module SiSU_Proj_HTML
require_relative 'se' # se.rb
include SiSU_Env
#require_relative 'css' # css.rb
# include SiSU_Style
class Bits
include SiSU_Parts_HTML
def initialize
@v=SiSU_Env::InfoVersion.instance.get_version
#@dir=SiSU_Env::InfoEnv.new
#@date=SiSU_Env::InfoDate.new #{@date.year}
end
def txt_generator
%{
}
end
def widget_sisu_text
<
Output generated by
#{@v.project}
#{@v.version} #{@v.date} (#{@v.date_stamp})
WOK
end
def credits_sisu_manifest
widget_sisu_text
end
def widget_sisu
<
#{widget_sisu_text}
WOK
end
def credits_sisu
%{
#{widget_sisu}
}
''
end
def widget_promo # Array used to build promo from list.yml and promo.yml
# ['sisu_icon','sisu','sisu_search_libre','open_society','fsf','ruby']
end
end
class Home
def initialize
@v=SiSU_Env::InfoVersion.instance.get_version
@dir=SiSU_Env::InfoEnv.new
@date=SiSU_Env::InfoDate.new #{@date.year}
end
def redirect
<SiSU
SiSU informtion provided at www.sisudoc.org/sisu/SiSU
If your browser supports redirection, you will be escorted there shortly.