From 32fd8f3908bc8632e2d8ab4d872f6e4362fe031b Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 12 Oct 2014 10:52:35 -0400 Subject: v5: merge v6: remove defaults.rb & some relics related to sisu skins --- data/doc/sisu/CHANGELOG_v5 | 4 + lib/sisu/v5/ao.rb | 2 - lib/sisu/v5/ao_syntax.rb | 29 +- lib/sisu/v5/css.rb | 78 +- lib/sisu/v5/defaults.rb | 1214 -------------------------------- lib/sisu/v5/generic_parts.rb | 134 ++++ lib/sisu/v5/html.rb | 13 +- lib/sisu/v5/html_concordance.rb | 5 - lib/sisu/v5/html_format.rb | 238 +++---- lib/sisu/v5/html_harvest_authors.rb | 4 +- lib/sisu/v5/html_harvest_topics.rb | 7 +- lib/sisu/v5/html_lite_shared.rb | 15 +- lib/sisu/v5/html_manifest.rb | 15 +- lib/sisu/v5/html_parts.rb | 440 ++++++++++++ lib/sisu/v5/html_promo.rb | 3 - lib/sisu/v5/html_scroll.rb | 1 - lib/sisu/v5/html_segments.rb | 25 +- lib/sisu/v5/html_shared.rb | 1 - lib/sisu/v5/html_table.rb | 7 +- lib/sisu/v5/html_tune.rb | 18 +- lib/sisu/v5/hub.rb | 2 - lib/sisu/v5/hub_loop_markup_files.rb | 2 - lib/sisu/v5/manpage.rb | 13 +- lib/sisu/v5/manpage_format.rb | 2 - lib/sisu/v5/po4a.rb | 6 - lib/sisu/v5/qrcode.rb | 18 +- lib/sisu/v5/rexml.rb | 1 - lib/sisu/v5/se_createsite.rb | 13 +- lib/sisu/v5/se_get_init.rb | 3 +- lib/sisu/v5/se_info_env.rb | 32 +- lib/sisu/v5/shared_metadata.rb | 9 +- lib/sisu/v5/sst_do_inline_footnotes.rb | 54 -- lib/sisu/v5/sst_to_s_xml_sax.rb | 3 - lib/sisu/v5/texinfo.rb | 4 - lib/sisu/v5/texinfo_format.rb | 2 - lib/sisu/v5/texpdf.rb | 9 +- lib/sisu/v5/texpdf_format.rb | 98 +-- lib/sisu/v5/texpdf_parts.rb | 238 +++++++ lib/sisu/v5/txt_asciidoc.rb | 13 +- lib/sisu/v5/txt_markdown.rb | 13 +- lib/sisu/v5/txt_plain.rb | 13 +- lib/sisu/v5/txt_rst.rb | 13 +- lib/sisu/v5/txt_shared.rb | 1 + lib/sisu/v5/txt_textile.rb | 14 +- lib/sisu/v5/wikispeak.rb | 11 +- lib/sisu/v5/xhtml.rb | 5 - lib/sisu/v5/xhtml_epub2.rb | 5 - lib/sisu/v5/xhtml_epub2_concordance.rb | 10 +- lib/sisu/v5/xhtml_epub2_format.rb | 67 +- lib/sisu/v5/xhtml_epub2_segments.rb | 1 - lib/sisu/v5/xhtml_epub2_tune.rb | 14 +- lib/sisu/v5/xhtml_parts.rb | 186 +++++ lib/sisu/v5/xhtml_shared.rb | 1 - lib/sisu/v5/xhtml_table.rb | 7 +- lib/sisu/v5/xml_dom.rb | 5 - lib/sisu/v5/xml_format.rb | 629 +---------------- lib/sisu/v5/xml_odf_odt.rb | 20 +- lib/sisu/v5/xml_odf_odt_format.rb | 3 - lib/sisu/v5/xml_parts.rb | 194 +++++ lib/sisu/v5/xml_sax.rb | 3 - lib/sisu/v5/xml_shared.rb | 15 +- lib/sisu/v5/xml_tables.rb | 24 +- 62 files changed, 1561 insertions(+), 2468 deletions(-) delete mode 100644 lib/sisu/v5/defaults.rb create mode 100644 lib/sisu/v5/generic_parts.rb create mode 100644 lib/sisu/v5/html_parts.rb create mode 100644 lib/sisu/v5/texpdf_parts.rb create mode 100644 lib/sisu/v5/xhtml_parts.rb create mode 100644 lib/sisu/v5/xml_parts.rb diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5 index 235d4db5..6294f34a 100644 --- a/data/doc/sisu/CHANGELOG_v5 +++ b/data/doc/sisu/CHANGELOG_v5 @@ -38,6 +38,10 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_5.7.0.orig.tar.xz sisu_5.7.0.orig.tar.xz sisu_5.7.0-1.dsc +* '*_parts', remove defaults.rb & some relics related to sisu skins (long gone) + * old code removed & substituted as required by *_parts + * attending code changes, fairly wide ranging + * html, epub, set document body language * html_format, label, re: object number object names diff --git a/lib/sisu/v5/ao.rb b/lib/sisu/v5/ao.rb index 3f1ce71e..ebb17a8f 100644 --- a/lib/sisu/v5/ao.rb +++ b/lib/sisu/v5/ao.rb @@ -59,8 +59,6 @@ =end module SiSU_AO - require_relative 'defaults' # defaults.rb - include SiSU_Viz require_relative 'se' # se.rb include SiSU_Env require_relative 'dp' # dp.rb diff --git a/lib/sisu/v5/ao_syntax.rb b/lib/sisu/v5/ao_syntax.rb index e9f4d3bd..be184a5e 100644 --- a/lib/sisu/v5/ao_syntax.rb +++ b/lib/sisu/v5/ao_syntax.rb @@ -66,7 +66,6 @@ module SiSU_AO_Syntax class Markup def initialize(md='',data='') @md,@data=md,data - @vz=SiSU_Viz::Defaults.new @data_new=[] url_and_stub=SiSU_Env::InfoEnv.new.url @output_url="#{url_and_stub.remote}" @@ -98,23 +97,13 @@ module SiSU_AO_Syntax #ital_line=%{^/_\s.+?(?:#{Mx[:br_line]}|\n|$)} #not implemented @line_scan_ital=if defined? @md.italics_match_list[:str] /#{@http_m}|#{bold_line}|#{@manmkp_ital}#{tail_m_ital}|#{@md.italics_match_list[:str]}#{tail_m_ital}|\S+|\n/i - elsif defined? @vz.markup_make_italic[:str] - /#{@http_m}|#{bold_line}|#{@manmkp_ital}#{tail_m_ital}|#{@vz.markup_make_italic[:str]}#{tail_m_ital}|\S+|\n/i end @manmkp_bold=emph_italics \ ? '^!_\s.+?(?:\n|$)|[!b]\\{.+?\\}[*!b]|[*!][a-zA-Z0-9\-_]+[!]' : '^!_\s.+?(?:\n|$)|[*!b]\\{.+?\\}[*!b]|[*!][a-zA-Z0-9\-_]+[*!]' - @line_scan_bold=if (defined? @md.bold_match_list[:str] \ - and @md.bold_match_list[:str]) \ - and (defined? @vz.markup_make_bold[:str] \ - and @vz.markup_make_bold[:str]) - /#{@http_m}|#{bold_line}|(?:#{@manmkp_bold}|#{@md.bold_match_list[:str]}|#{@vz.markup_make_bold[:str]})#{tail_m_bold}|\S+|\n/i - elsif defined? @md.bold_match_list[:str] \ + @line_scan_bold=if defined? @md.bold_match_list[:str] \ and @md.bold_match_list[:str] /#{@http_m}|#{bold_line}|(?:#{@manmkp_bold}|#{@md.bold_match_list[:str]})#{tail_m_bold}|\S+|\n/i - elsif defined? @vz.markup_make_bold[:str] \ - and @vz.markup_make_bold[:str] - /#{@http_m}|#{bold_line}|(?:#{@manmkp_bold}|#{@vz.markup_make_bold[:str]})#{tail_m_bold}|\S+|\n/i end end def songsheet @@ -154,9 +143,7 @@ module SiSU_AO_Syntax def wordlist_italics(dob) dob=dob.dup if (defined? @md.italics_match_list[:str] \ - and @md.italics_match_list[:str]) \ - or (defined? @vz.markup_make_italic[:str] \ - and @vz.markup_make_italic[:str]) + and @md.italics_match_list[:str]) dob.obj=if dob.is !=:meta \ && dob.is !=:heading \ && dob.is !=:heading_insert \ @@ -172,10 +159,6 @@ module SiSU_AO_Syntax and @md.italics_match_list[:regx] w=w.gsub(@md.italics_match_list[:regx], "#{Mx[:fa_italics_o]}\\1#{Mx[:fa_italics_c]}") - elsif defined? @vz.markup_make_italic \ - and @vz.markup_make_italic - w=w.gsub(@vz.markup_make_italic, - "#{Mx[:fa_italics_o]}\\1#{Mx[:fa_italics_c]}") else w end end @@ -267,9 +250,7 @@ module SiSU_AO_Syntax def wordlist_bold(dob) dob=dob.dup if (defined? @md.bold_match_list[:str] \ - and @md.bold_match_list[:str]) \ - or (defined? @vz.markup_make_bold[:str] \ - and @vz.markup_make_bold[:str]) + and @md.bold_match_list[:str]) dob.obj=if dob.is !=:meta \ && dob.is !=:heading \ && dob.is !=:heading_insert \ @@ -285,10 +266,6 @@ module SiSU_AO_Syntax and @md.bold_match_list[:regx] #document header: @bold: [bold word list] w=w.gsub(@md.bold_match_list[:regx], "#{Mx[:fa_bold_o]}\\1#{Mx[:fa_bold_c]}") - elsif defined? @vz.markup_make_bold \ - and @vz.markup_make_bold #defaults adjusted bold word list - w=w.gsub(@vz.markup_make_bold, - "#{Mx[:fa_bold_o]}\\1#{Mx[:fa_bold_c]}") end else w=if w =~ /(?:^!_|^#{Mx[:lv_o]}[7-9]:\S*?#{Mx[:lv_c]})\s+/ diff --git a/lib/sisu/v5/css.rb b/lib/sisu/v5/css.rb index 09f5a435..b70d3edd 100644 --- a/lib/sisu/v5/css.rb +++ b/lib/sisu/v5/css.rb @@ -59,7 +59,7 @@ =end module SiSU_Style require_relative 'se' # se.rb - require_relative 'defaults' # defaults.rb + require_relative 'html_parts' # html_parts.rb class CSS_HeadInfo def initialize(md,ft='html') @md,@ft=md,ft @@ -159,40 +159,38 @@ module SiSU_Style end end class CSS - def initialize - @vz=SiSU_Viz::Defaults.new - end + include SiSU_Parts_HTML def fonts - @vz.font_fonts + the_font.set_fonts end def html_tables #stylesheet for css table_pages <. - - 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: - - - - * Git - - - - * Ralph Amissah - - - - ** Description: Default values - -=end -$latex_run=nil -module SiSU_Viz - begin - require 'uri' - rescue LoadError - SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia). - error('uri NOT FOUND (LoadError)') - end - require_relative 'se' # se.rb - include SiSU_Env - require_relative 'css' # css.rb - include SiSU_Style - class Defaults - def initialize - @fonts='verdana, arial, georgia, tahoma, sans-serif, helvetica, times, roman' # 'verdana, arial, georgia, tahoma, sans-serif, helvetica, "times new roman", times, roman' - @dir=SiSU_Env::InfoEnv.new - @date=SiSU_Env::InfoDate.new #{@date.year} - @v=SiSU_Env::InfoVersion.instance.get_version - end - #% glyph - def glyph_bullet # • - '• ' # [• flagged] - end - #% html - def html_hardspace - ' ' - end - def semantic_tags - def default - { - pub: 'publication', - conv: 'convention', - vol: 'volume', - pg: 'page', - cty: 'city', - org: 'organization', - uni: 'university', - dept: 'department', - fac: 'faculty', - inst: 'institute', - co: 'company', - com: 'company', - conv: 'convention', - dt: 'date', - y: 'year', - m: 'month', - d: 'day', - ti: 'title', - au: 'author', - ed: 'editor', #editor? - v: 'version', #edition - n: 'name', - fn: 'firstname', - mn: 'middlename', - ln: 'lastname', - in: 'initials', - qt: 'quote', - ct: 'cite', - ref: 'reference', - ab: 'abreviation', - def: 'define', - desc: 'description', - trans: 'translate', - } - end - self - end - #% decorate - def decorate_italics - 'title|article|book|journal' - end - def decorate_bold - end - def decorate_uppercase - 'surname' - end - #% semantic - def sem_title #dc 1 - 'title' - end - def sem_article - 'article' - end - def sem_book - 'book' - end - def sem_journal - 'journal' - end - def sem_fullname # (contains: firstname, surname) #issues arise as contains surname etc. - 'fullname' - end - def sem_first - 'first' - end - def sem_surname - 'surname' - end - def sem_middle - 'middle' - end - def sem_creator #dc 2 #==fullname (contains: firstname, surname) - 'creator' - end - def sem_author #==fullname (contains: firstname, surname) - 'author' - end - def sem_editor #==fullname (contains: firstname, surname) - 'editor' - end - def sem_illustrator #==fullname (contains: firstname, surname) - 'illustrator' - end - def sem_translator #==fullname (contains: firstname, surname) - 'translator' - end - def sem_isbn # 10 or 13 - 'isbn' - end - def sem_isbn_10 - 'isbn10' - end - def sem_isbn_13 - 'isbn13' - end - def sem_loc # library of congress - 'loc' - end - def sem_dewey - 'dewey' - end - def sem_pg # project gutenberg number - 'pg' - end - def sem_subject #dc 3 - 'subject' - end - def sem_date #dc 7 - 'date' - end - def sem_date_created - 'date_created' - end - def sem_date_issued - 'date_issued' - end - def sem_date_available - 'date_available' - end - def sem_date_valid - 'date_valid' - end - def sem_date_modified - 'date_modified' - end - def sem_type #dc 8 - 'type' - end - def sem_description #dc 4 - 'description' - end - def sem_publisher #dc 5 - 'publisher' - end - def sem_contributor #dc 6 - 'contributor' - end - def sem_format #dc 9 - 'format' - end - def sem_identifier #dc 10 - 'identifier' - end - def sem_source #dc 11 - 'source' - end - def sem_language #dc 12 - 'language' - end - def sem_relation #dc 13 - 'source' - end - def sem_coverage #dc 14 - 'coverage' - end - def sem_rights #dc 15 - 'rights' - end - def sem_copyright - 'copyright' - end - def sem_license - 'license' - end - def sem_prepared_by - 'prepared_by' - end - def sem_digitized_by - 'digitized_by' - end - def sem_keywords - 'keywords' - end - def sem_comments - 'comments' - end - def sem_abstract - 'abstract' - end - #% path - def path_stylesheet_home - %{ } - end - #% text #changed from txt to avoid naming conflicts #FOLLOW - def txt_generator - %{ - } - end - def txt_generator_comment - %{ } - end - def txt_hp - ' SiSU' - end - def txt_hp_alias - 'SiSU' - end - def txt_home - 'SiSU' - end - def txt_signature # used in latex/pdf footer - 'SiSU' - end - #% url - def url_urify(uri) - URI.parse(uri) - end - def url_sisu - 'http://www.sisudoc.org/' - end - def url_sisudoc - 'http://www.sisudoc.org' - end - def url_footer_signature - 'http://www.sisudoc.org/' - end - def url_root - '/sisu' #watch - end - def url_root_http - 'http://www.sisudoc.org/' #watch - end - def url_home - 'http://www.sisudoc.org/' # used in pdf header - end - def url_site #used as stub... where there are subdirectories and is different from home - url_home - #'http://www.sisudoc.org/' # used in pdf header - end - def url_txt - 'www.sisudoc.org/' - end - def url_path_image_base #used for html image display - "#{Xx[:html_relative2]}_sisu/image" - end - def url_path_image #used for html image display - "#{Xx[:html_relative2]}_sisu/image" - end - def url_path_image_sys #used for html image display - "#{Xx[:html_relative2]}_sisu/image_sys" - end - def 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 rel_decoration - def tex_open #'{\UseTextSymbol{OML}{<}}' - Dx[:rel_o] - end - def tex_close #'{\UseTextSymbol{OML}{>}}' - Dx[:rel_c] - end - def xml_open #'<' - Dx[:rel_o] - end - def xml_close #'>' - Dx[:rel_c] - end - def txt_open - '<' - end - def txt_close - '>' - end - self - end - #% color - def color_body - %{} - end - def color_white - '"#ffffff"' - end - def color_black - '#000000' - end - def color_blue_ink - '#003399' - end - def color_blue_tinge - '#e3ecef' - end - def color_blue_grey - '#8faebf' - end - def color_blue_murky - '#437389' - end - def color_beige - '#f1e8de' - end - def color_subtleglow - '#dddccc' - end - def color_glow - '#fff0c3' - end - def color_rose - '#ffdec9' - end - def color_turquoise - '#1c869b' - end - def color_grey_pale - '#eeeeee' - end - def color_grey_medium - '#cccccc' - end - def color_grey - '#999999' - end - def color_yellow_light - '#fff3b6' - end - def color_yellow - '#ffde14' - end - def color_yellow_dark - '#ffcc00' - end - def color_green_light - '#b7d398' # #e2efd5 #b7d398 #b1c999 # '#aed19e' - end - def color_green - '#0a8400' - end - def color_green_dark - '#086800' - end - def color_ruby - '#a00000' - end - def color_maroon - '#800000' - end - def color_paper - %{"#{color_white}"} - end - def color_band1 - %{"#{color_white}"} - end - def color_band2 - %{"#{color_white}"} - end - def color_body - %{} - end - def color_font_face #was font WATCH - "#{color_black}" - end - def color_surround - %{"#{color_white}"} - end - def color_band - %{"#{color_white}"} - end - def color_table1 - 'ffffcc' - end - def color_table2 - 'c0d0f0' - end - def color_band1 - '"#ffffff"' - end - def color_band2 - '"#ffffff"' - end - #% icon - def icon_ico - 'rb7.ico' - end - def icon_sisu - 'sisu.png' - end - def icon_manifest - 'b_info.png' - end - def icon_doc - 'b_doc.png' - end - def icon_toc - 'b_toc.png' - end - def icon_wmp - 'b_wmp.png' - end - def icon_odf - 'b_odf.png' - end - def icon_epub - 'b_epub.png' - end - def icon_pdf - 'b_pdf.png' - end - def icon_pdf_portrait - 'b_pdf.png' - end - def icon_pdf_landscape - 'b_pdf.png' - end - def icon_choice - 'b_choice.png' - end - def icon_new - 'b_new.png' - end - def icon_dot_clear - 'dot_clear.png' - end - def icon_dot_white - 'dot_white.png' - end - def icon_dot - icon_dot_white - end - def icon_home_button - 'sisu.png' - end - def icon_next - 'arrow_next_red.png' - end - def icon_previous - 'arrow_prev_red.png' - end - def icon_up - 'arrow_up_red.png' - end - #% font - def font_fonts - @fonts - end - def font_face - %{face="#{font_fonts}"} - end - def font_color - 'color="#000000"' - end - def font_size_endnote - 'size="3"' - end - def font_small - 'size="3"' - end - def font_tiny - 'size="2"' - end - #% markup - def markup_italics_list #regular expression of words to be italised - end - def markup_bold_list #regular expression of words to be made bold - 'SiSU' - end - def markup_make_italic - if defined? italics_list \ - and italics_list - make={} - if italics_list - r=italics_list.dup - x=case r - when /\/i$/ then 'i' - else '' - end - r=r.gsub(/^\/(.+?)\/i?/,'\1'). - gsub(/\(/,'(?:') # avoid need to escape use of brackets within regex provided - m='\b(' + r + ')\b' - make[:str] - make[:regx]=(x =~/i/) \ - ? (/#{m}/i) - : (/#{m}/) - else nil - end - end - end - def markup_make_bold - if defined? bold_list \ - and not bold_list.empty? - make={} - if bold_list - r=bold_list.dup - x=case r - when /\/i$/ then 'i' - else '' - end - r.gsub(/^\/(.+?)\/i?/,'\1'). - gsub(/\(/,'(?:') # avoid need to escape use of brackets within regex provided - m='\b(' + r + ')\b' - make[:str] - make[:regx]=(x =~/i/) \ - ? (/#{m}/i) - : (/#{m}/) - else nil - end - make - end - end - #% paragraph - def paragraph_txt - %{

} - end - def paragraph_endnote - %{

} - end - def paragraph_font_tiny - %{} - end - def paragraph_font_small - %{} - end - #% table - def table_close - ' -' - end - def table_width_1 - '"100%"' - end - def table_width_2 - '"99%"' - end - def table_width_txt - '"94%"' - end - def table_width_txt_r - '"96%"' - end - def table_cellpad_box - '"20"' - end - #% indent - def indent_level_0 - '"1%"' - end - def indent_level_1 - '"4%"' - end - def indent_level_2 - '"6%"' - end - def indent_level_3 - '"8%"' - end - def indent_level_4 - '"10%"' - end - #% margin - def margin_num - '

' - end - def margin_numless - '' - end - def margin_num_css - ' - ' - end - def margin_txt_w1 - %{ - -
 } - end - def margin_txt_w2 - %{ - -
 } - end - def margin_txt_0 - %{ -
-} - end - def margin_txt_1 - %{ -
} - end - def margin_txt_2 - %{ - -
-} - end - def margin_txt_3 - %{ - -
-} - end - def margin_css - ' -
' - end - #% png - def png_ico - %{ } - end - def png_sisu #check url path - %{ - SiSU - } - end - def png_site - %{@} - end - def png_nav - %{Contents} - end - def png_manifest - %{Document Manifest} - end - def png_doc - %{Full Text} - end - def png_toc - %{TOC linked} - end - def png_odf - %{ODF/ODT} - end - def png_epub - %{EPUB} - end - def png_pdf - %{PDF} - end - def png_pdf_portrait - %{PDF portrait} - end - def png_pdf_landscape - %{PDF landscape} - end - def png_home - #dir=SiSU_Env::InfoEnv.new #(@fns) - %{#{txt_home} -->} - #%{#{txt_home} -->} - end - def png_home_button - rel=@dir.path_rel_links.html_scroll_2 - %{#{txt_home} -->} - end - #% png_nav #not currently used - #% nav_txt - def nav_txt_homepage - %{ -  home  - } - end - def nav_txt_toc_link - %{ -   toc  - } - end - def nav_txt_doc_link - %{ -  scroll  - } - end - def nav_txt_manifest - #{png_manifest} document manifest - %{ - [ document manifest ] - } - end - def nav_txt_concordance - %{ -   A-Z  - } - end - def nav_txt_pdf_portrait - %{ -  pdf  - } - end - def nav_txt_pdf_landscape - %{ -  pdf  - } - end - #% banner - def banner_home_button_only - %{ - #{png_home_button} - } - end - def banner_band #yellow_dark now white - %{ - -
- - #{png_home} - - -#{table_close}} - end - def banner_instrument_cover_band_scr - ' -
' - end - def banner_instrument_cover_band_seg - ' - -WOK - end - def widget_sisu_verbose -< - -WOK - end - def widget_way_better - < - -WOK - end - #% credits - def credits_sisu_manifest - widget_sisu_text - end - def credits_sisu - %{
-
' - end - #% widget - 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 - def widgets_open -< -WOK - end - def widget_sisu_text -< - Output generated by - - #{@v[:project]} - - #{@v[:version]} #{@v[:date]} (#{@v[:date_stamp]}) -

-WOK - end - def widget_sisu -< -
- -#{widget_sisu_text} -
-

- - SiSU - -

-
- -

- Output generated by - - #{@v[:project]} - - #{@v[:version]} #{@v[:date]} (#{@v[:date_stamp]}) -
- - #{@v[:project]} - - Copyright © Ralph Amissah - 1997, current #{@date.year_static}. - All Rights Reserved. -
- - #{@v[:project]} - - is software for document structuring, publishing and search, -
- - www.sisudoc.org/ - - and - - www.sisudoc.org - -
- w3 since October 3 1993 - - ralph@amissah.com - -

-
-

- #{@v[:project]} using: -
Standard SiSU markup syntax, -
Standard SiSU meta-markup syntax, and the -
Standard SiSU object citation numbering and system, (object/text positioning system) -
- Copyright © Ralph Amissah 1997, current #{@date.year_static}. - All Rights Reserved. -

-
-

- - GPLv3 - -

-
-

- - #{@v[:project]} - - is released under - GPLv3 - or later, - #{url_decoration.xml_open}http://www.gnu.org/licenses/gpl.html#{url_decoration.xml_close} -

-
-

- #{@v[:project]}, developed using - - Ruby - - on - - Debian/Gnu/Linux - - software infrastructure, - with the usual GPL (or OSS) suspects. -
- Better - "performance, reliability, scalability, security & total cost of ownership" - [not to mention flexibility & choice] use of and adherence to open standards (where practical and fair) and it is software libré. -
- Get With the Future - - Way Better! - -

-
-
- #{widget_sisu} -
} - '' - end - def credits_splash - end - def credits_sisu_epub - %{
-

EPUB generated by #{@v[:project]} v#{@v[:version]}, GPL3

-
} - '' - end - end - class Home < Defaults - 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. - - -WOK - end - def homepage - < - - -SiSU information Structuring Universe - Structured information, Serialized Units - software for electronic texts, documents, books, digital libraries in plaintext, HTML, EPUB, XHTML, XML, ODF (OpenDocument), LaTeX, PDF, SQL (PostgreSQL and SQLite), and for search - - - - - - - - - - - - - - - - - -

SiSU

-

-[Manual] -

-

-[Source] -[List Info (sisu@lists.sisudoc.org)] -

- -

SiSU Markup Samples

-

-[Source] -[Output] -

- -
- -

- Structured information, Serialized Units -    - - <www.sisudoc.org> - -   or   - - <www.jus.uio.no/sisu/> - -software for electronic texts, document collections, books, digital libraries & search, with "atomic search" & text locating system (shared object citation numbering: "ocn"). -Outputs include: plaintext, HTML, EPUB, ODT (OpenDocumentText), (XHTML, XML,) LaTeX, PDF, SQL (PostgreSQL and SQLite). -

-

- -<sisu@lists.sisudoc.org> - - -<http://lists.sisudoc.org/listinfo/sisu> - -

-

- -<ralph@amissah.com> - - -<ralph.amissah@gmail.com> - -

-

-#{@v[:project]} #{@v[:version]} of #{@v[:date_stamp]} (#{@v[:date]}) (n*x and Ruby!), #{@date.year_static}. -

-

-w3 since October 3 1993. -

- - -WOK - end - def home_toc - ' ' - end - end - class Inserts - end - class TeX < Defaults - def initialize(papersize='') - @papersize=papersize - end - def a4 - def portrait - def w - 160 - end - def h - 228 - end - def img_px - 450 - end - self - end - def landscape - def w - 238 - end - def h - 160 - end - def img_px - 300 - end - self - end - self - end - def letter - def portrait - def w - 166 - end - def h - 212 - end - def img_px - 468 - end - self - end - def landscape - def w - 226 - end - def h - 166 - end - def img_px - 290 - end - self - end - self - end - def legal - def portrait - def w - 168 - end - def h - 286 - end - def img_px - 474 - end - self - end - def landscape - def w - 296 - end - def h - 166 - end - def img_px - 420 - end - self - end - self - end - def b5 - def portrait - def w - 140 - end - def h - 204 - end - def img_px - 356 - end - self - end - def landscape - def w - 200 - end - def h - 130 - end - def img_px - 260 - end - self - end - self - end - def a5 - def portrait - def w - 112 - end - def h - 162 - end - def img_px - 280 - end - self - end - def landscape - def w - 152 - end - def h - 100 - end - def img_px - 190 - end - self - end - self - end - def dimensions - case @papersize - when /a4/ then a4 - when /letter/ then letter - when /legal/ then legal - when /b5/ then b5 - when /a5/ then a5 - else a4 - end - end - end -end -__END__ diff --git a/lib/sisu/v5/generic_parts.rb b/lib/sisu/v5/generic_parts.rb new file mode 100644 index 00000000..c7a702e9 --- /dev/null +++ b/lib/sisu/v5/generic_parts.rb @@ -0,0 +1,134 @@ +# encoding: utf-8 +=begin + + * Name: SiSU + + * Description: a framework for document structuring, publishing and search + + * Author: Ralph Amissah + + * Copyright: (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, + 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 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: + + + + * Git + + + + * Ralph Amissah + + + + ** Description: shared html parts + +=end +module SiSU_Parts_Generic + def the_url + def urify(uri) + URI.parse(uri) + end + def sisu + 'http://www.sisudoc.org/' + end + def sisudoc + 'http://www.sisudoc.org' + end + def footer_signature + 'http://www.sisudoc.org/' + end + def rl_root + '/sisu' #watch + end + def root_http + 'http://www.sisudoc.org/' #watch + end + def home + 'http://www.sisudoc.org/' # used in pdf header + end + def site #used as stub... where there are subdirectories and is different from home + home + end + def home_txt + 'www.sisudoc.org' + end + def sisu_txt + 'www.sisudoc.org' + end + self + end + def the_text + def home + 'SiSU' + end + def txt_hp + ' SiSU' + end + def txt_hp_alias + 'SiSU' + end + def txt_home + 'SiSU' + end + def txt_signature # used in latex/pdf footer + 'SiSU' + end + def url_open + '<' + end + def url_close + '>' + end + self + end + def the_icon + def i_ico + 'rb7.ico' + end + def i_home_button + 'sisu.png' + end + def i_choice + 'b_choice.png' + end + def i_new + 'b_new.png' + end + self + end +end +__END__ diff --git a/lib/sisu/v5/html.rb b/lib/sisu/v5/html.rb index 76dbe2a2..1a8d6608 100644 --- a/lib/sisu/v5/html.rb +++ b/lib/sisu/v5/html.rb @@ -66,9 +66,8 @@ module SiSU_HTML end require_relative 'se_hub_particulars' # se_hub_particulars.rb include SiSU_Particulars - require_relative 'defaults' # defaults.rb - include SiSU_Viz require_relative 'html_table' # html_table.rb + require_relative 'html_parts' # html_parts.rb require_relative 'html_format' # html_format.rb include SiSU_HTML_Format require_relative 'html_segments' # html_segments.rb @@ -181,7 +180,6 @@ module SiSU_HTML def initialize(particulars) @particulars=particulars @md,@env=particulars.md,particulars.env - @vz=SiSU_Viz::Defaults.new @env,@css=particulars.env,SiSU_Style::CSS.new end def tuned_file_instructions @@ -267,7 +265,6 @@ module SiSU_HTML @@firstseg=nil def initialize(md=nil,data='') @data,@md=data,md - @vz=SiSU_Viz::Defaults.new @ocn_html_identifier= SiSU_Env::ProcessingSettings.new(@md).ocn_html_identifier @tell=SiSU_Screen::Ansi.new(@md.opt.act[:color_state][:set]) if @md @@ -334,7 +331,7 @@ module SiSU_HTML @@toc[:seg] <<<
-

+

(relatively static) RSS feeds for DOCUMENTS:
RSS feed http://www.jus.uio.no/lm/rssfeed/documents.xml
RSS feed http://www.jus.uio.no/lm/rssfeed/tradelaw.xml
@@ -607,9 +604,9 @@ WOK 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 - @vz=SiSU_Viz::Defaults.new @make=SiSU_Env::ProcessingSettings.new(@md) end def in_common @@ -662,8 +659,8 @@ WOK toc_shared << format_txt_obj.center_bold @segtoc << format_txt_obj.center_bold end - toc_shared << "#{@vz.table_close*1}\n" - @segtoc << "#{@vz.table_close*1}\n" + 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} diff --git a/lib/sisu/v5/html_concordance.rb b/lib/sisu/v5/html_concordance.rb index 6053bd61..231eb4c1 100644 --- a/lib/sisu/v5/html_concordance.rb +++ b/lib/sisu/v5/html_concordance.rb @@ -63,8 +63,6 @@ module SiSU_Concordance include SiSU_Particulars require_relative 'se' # se.rb include SiSU_Env - require_relative 'defaults' # defaults.rb - include SiSU_Viz require_relative 'html_format' # html_format.rb include SiSU_HTML_Format require_relative 'html_minitoc' # html_minitoc.rb @@ -125,7 +123,6 @@ module SiSU_Concordance end private class DocTitle - include SiSU_Viz #revisit, both requires (html & xml_shared) needed for stand alone operation (sisu -w [filename]) require_relative 'xml_shared' # xml_shared.rb require_relative 'html' # html.rb @@ -206,8 +203,6 @@ WOK class Words require_relative 'i18n' # i18n.rb include SiSU_i18n - require_relative 'defaults' # defaults.rb - include SiSU_Viz require_relative 'html_format' # html_format.rb include SiSU_HTML_Format require_relative 'se' # se.rb diff --git a/lib/sisu/v5/html_format.rb b/lib/sisu/v5/html_format.rb index 75bacdc2..b0611508 100644 --- a/lib/sisu/v5/html_format.rb +++ b/lib/sisu/v5/html_format.rb @@ -58,7 +58,7 @@ =end module SiSU_HTML_Format - include SiSU_Viz + require_relative 'html_parts' # html_parts.rb class ParagraphNumber def initialize(md,ocn) @md,@ocn=md,ocn.to_s @@ -97,13 +97,13 @@ module SiSU_HTML_Format end class HeadInformation require_relative 'css' # css.rb + include SiSU_Parts_HTML require_relative 'xml_shared' # xml_shared.rb - include SiSU_Viz - attr_reader :md,:rdf,:vz + attr_reader :md,:rdf def initialize(md) @md=md # DublinCore 1 - title - @vz=SiSU_Viz::Defaults.new + @bits=SiSU_Proj_HTML::Bits.new @seg_name_html=(SiSU_HTML::Source::Seg.new.seg_name_html || []) @seg_name_html_tracker=(SiSU_HTML::Source::Seg.new.seg_name_html_tracker || []) @tocband_scroll,@tocband_segtoc=nil,nil @@ -164,7 +164,7 @@ module SiSU_HTML_Format %{ -
+ #{wgt.manifest(page)} #{wgt.search}
} @@ -172,14 +172,6 @@ module SiSU_HTML_Format def rdf SiSU_XML_Tags::RDF.new(md) end - def doc_type - %{ -\n} - end - def table_close - %{
-#{@vz.table_close}} - end def button_home(page=:seg) button=%{ \n } end def scroll(text) if @md.fns =~ /\.(?:-|ssm\.)?sst$/ - %{} else - %{} end @@ -291,7 +283,7 @@ module SiSU_HTML_Format #{make_scroll_search_form_and_manifest_link} WOK - %{
\n} if @md.make.home_button_image.is_a?(Hash) @@ -206,6 +198,7 @@ module SiSU_HTML_Format end end class Widget < HeadInformation + include SiSU_Parts_HTML def initialize(md) super(md) @md=md @@ -216,15 +209,15 @@ module SiSU_HTML_Format @make=SiSU_Env::ProcessingSettings.new(md) end def home - %{ + %{ - #{@vz.nav_txt_homepage} + #{the_nav.txt_homepage} + %{ #{text} @@ -257,16 +250,15 @@ module SiSU_HTML_Format end if page==:manifest manifest_lnk="#{@md.file.output_path.manifest.url}/#{@file.base_filename.manifest}" - brace_url=SiSU_Viz::Defaults.new.url_decoration - %{ - - #{brace_url.xml_open}#{@md.file.output_path.manifest.url}/#{@file.base_filename.manifest}#{brace_url.xml_close} + %{ + + #{the_url_decoration.xml_open}#{@md.file.output_path.manifest.url}/#{@file.base_filename.manifest}#{the_url_decoration.xml_close} + %{ - #{@vz.nav_txt_manifest} + #{the_nav.txt_manifest}
+ %{
@@ -300,7 +292,7 @@ WOK
#{button_home(:scroll)}   -#{@vz.table_close} +#{the_table_close}

} else '' end @@ -316,14 +308,14 @@ WOK else '' end if @make.build.html_top_band? - %{ + %{
#{button_home} #{doc_types} #{up_button} -#{@vz.table_close} +#{the_table_close}

} else '' end @@ -344,7 +336,7 @@ WOK else '' end if @make.build.html_top_band? - %{ + %{
@@ -353,7 +345,7 @@ WOK } %{
#{button_home(page)}  #{firstseg}  -#{@vz.table_close} +#{the_table_close}

} else '' end @@ -376,8 +368,8 @@ WOK end def make_scroll_search_form_and_manifest_link wgt=SiSU_HTML_Format::Widget.new(@md) - %{

- #{@vz.nav_txt_doc_link} + %{ + #{the_nav.txt_doc_link}
@@ -389,13 +381,13 @@ WOK def make_scroll_seg_pdf seg='' wgt=SiSU_HTML_Format::Widget.new(@md) - seg=%{ } %{
- #{@vz.nav_txt_toc_link} + seg=%{ + #{the_nav.txt_toc_link}
-
+ #{wgt.manifest} #{wgt.search}
} @@ -404,14 +396,15 @@ WOK wgt=SiSU_HTML_Format::Widget.new(@md) %{ -
+ #{wgt.manifest} #{wgt.search}
} end def head rdf=SiSU_XML_Tags::RDF.new(@md) - %{#{doc_type} + %{ + @@ -426,27 +419,26 @@ WOK end def concordance if @md.concord_make - %{#{@vz.margin_css} + %{#{the_margin.css} <h4 class="toc"> <a href="./#{@md.file.base_filename.html_concordance}"> <i>Concordance</i> </a> </h4> -#{@vz.table_close}} +#{table_close}} else - %{#{@vz.margin_css} -#{@vz.table_close}} + %{#{the_margin.css} +#{table_close}} end end def links_guide_vertical_open # @file=SiSU_Env::FileOp.new(@md) if @md - url=((defined? @vz.url_hp) && @vz.url_hp =~/^https?:\/\/\S+$/ ? @vz.url_hp : @vz.url_home) %{ <div id="vertical_links"> <ul id="vertical"> <li class="refbold"> - <a href="#{url}"> - #{@vz.txt_hp} + <a href="#{the_url.home}"> + #{the_text.txt_hp} </a> </li> <li class="ref"> @@ -461,13 +453,12 @@ WOK end def links_guide_horizontal_open # @file=SiSU_Env::FileOp.new(@md) if @md - url=((defined? @vz.url_hp) && @vz.url_hp =~/^https?:\/\/\S+$/ ? @vz.url_hp : @vz.url_home) %{ <div id="horizontal_links"> <ul id="horizontal"> <li class="refbold"> - <a href="#{url}"> - #{@vz.txt_hp} + <a href="#{the_url.home}"> + #{the_text.txt_hp} </a> </li> <li class="ref"> @@ -521,69 +512,69 @@ WOK def scroll_head_title_banner_open icon=@md.icon ? %{<center>\n#{@md.icon}\n</center>} : '' %{#{icon} -#{@vz.banner_instrument_cover_band_scr}} +#{the_banner.instrument_cover_band_scr}} end def seg_head_title_banner_open icon=@md.icon ? %{<center>\n#{@md.icon}\n</center>} : '' %{#{icon} -#{@vz.banner_instrument_cover_band_seg}} +#{the_banner.instrument_cover_band_seg}} end def make_scroll - concord=concordance_link(@vz.nav_txt_concordance) + concord=concordance_link(the_nav.txt_concordance) %{<table summary="toc scroll" border="0" cellpadding="3" cellspacing="0"> <tr><td align="center" bgcolor="white" border="0"> - #{@vz.nav_txt_doc_link} + #{the_nav.txt_doc_link} </td> <td align="center" bgcolor="white"> #{concord} -#{@vz.table_close}} +#{the_table_close}} end def make_seg - concord=concordance_link(@vz.nav_txt_concordance) + concord=concordance_link(the_nav.txt_concordance) %{<table summary="toc segment" border="0" cellpadding="3" cellspacing="0"> <tr><td align="center" bgcolor="white"> - #{@vz.nav_txt_toc_link} + #{the_nav.txt_toc_link} </td> <td align="center" bgcolor="white"> <font size=2> #{concord} -#{@vz.table_close}} +#{the_table_close}} end def manifest #check structure if not @o_str.dump_or_redirect? - manifest=manifest_link(@vz.nav_txt_manifest) - %{#{@vz.margin_txt_3} - #{@vz.paragraph_font_small} + manifest=manifest_link(the_nav.txt_manifest) + %{#{the_margin.txt_3} + #{the_font.paragraph_font_small} #{manifest} </font> -#{@vz.table_close}} +#{the_table_close}} else '' end end def concordance #check structure - concord=concordance_link(@vz.nav_txt_concordance) - %{#{@vz.margin_txt_3} - #{@vz.paragraph_font_small} + concord=concordance_link(the_nav.txt_concordance) + %{#{the_margin.txt_3} + #{the_font.paragraph_font_small} #{concord} </font> -#{@vz.table_close}} +#{the_table_close}} end def metadata - %{#{@vz.margin_css} + %{#{the_margin.css} <h4 class="toc"> <a href="#{@metalink}"> <i>MetaData</i> </a> </h4> -#{@vz.table_close}} +#{the_table_close}} end def seg_tail %{ <div class="main_column"> <p> <p> -<table summary="toc segment tail" bgcolor=#{@vz.color_band1}> +<table summary="toc segment tail" bgcolor=#{the_color.band1}> <tr><td width="20%"> - #{@vz.banner_band} + #{the_banner.banner_band} </td> <td width="60%"> <center> @@ -592,8 +583,7 @@ WOK </td></tr> </table> <p> </p> -#{@vz.credits_splash} -#{@vz.credits_sisu} +#{@bits.credits_sisu} <a name="bottom" id="bottom"></a> <a name="end" id="end"></a> </div> @@ -606,8 +596,7 @@ WOK %{ <div class="main_column"> #{nav} -#{@vz.credits_splash} -#{@vz.credits_sisu} +#{@bits.credits_sisu} <a name="bottom" id="bottom"></a> <a name="end" id="end"></a> </div> @@ -617,8 +606,7 @@ WOK %{ <div class="main_column"> <p> </p> -#{@vz.credits_splash} -#{@vz.credits_sisu} +#{@bits.credits_sisu} <a name="bottom" id="bottom"></a> <a name="end" id="end"></a> </div> @@ -642,7 +630,7 @@ WOK nxt=nxt.gsub(/sisu_manifest\.html/,"../../manifest/#{@file.base_filename.manifest}") end end - %{<table summary="segment hidden control pre and next" width="100%" border="0" cellpadding="0" bgcolor=#{@vz.color_grey_pale} align="center"> + %{<table summary="segment hidden control pre and next" width="100%" border="0" cellpadding="0" bgcolor=#{the_color.grey_pale} align="center"> <tr><td align="left"> <a href="#{pre}" target="_top"> #{png_nav.dot_pre} @@ -657,13 +645,13 @@ WOK <a href="#{nxt}" target="_top"> #{png_nav.dot_nxt} </a> -#{@vz.table_close}} +#{the_table_close}} end def dot_control_pre pre="#{@seg_name_html[@seg_name_html_tracker-2]}#{@md.lang_code_insert}#{Sfx[:html]}" up=@toc nxt="#{@md.file.base_filename.html_segtoc}" - %{<table summary="segment hidden control pre" width="100%" border="0" cellpadding="0" bgcolor=#{@vz.color_grey_pale} align="center"> + %{<table summary="segment hidden control pre" width="100%" border="0" cellpadding="0" bgcolor=#{the_color.grey_pale} align="center"> <tr><td align="left"> <a href="#{pre}" target="_top"> #{png_nav.dot_pre} @@ -678,21 +666,21 @@ WOK <a href="#{nxt}" target="_top"> #{png_nav.dot_nxt} </a> -#{@vz.table_close}} +#{the_table_close}} end def toc_nav(f_pre=false,f_nxt=false,use=1) pre=nxt='' - toc=%{<td align="center" bgcolor=#{@vz.color_band1}> + toc=%{<td align="center" bgcolor=#{the_color.band1}> <a href="#{@toc}" target="_top"> #{png_nav.toc} </a> </td>} - pre=%{<td align="center" bgcolor=#{@vz.color_band1}> + pre=%{<td align="center" bgcolor=#{the_color.band1}> <a href="#{@seg_name_html[@seg_name_html_tracker-use]}#{@md.lang_code_insert}#{Sfx[:html]}" target="_top"> #{png_nav.pre} </a> </td>} if f_pre==true - nxt=%{<td align="center" bgcolor=#{@vz.color_band1}> + nxt=%{<td align="center" bgcolor=#{the_color.band1}> <a href="#{@seg_name_html[@seg_name_html_tracker+1]}#{@md.lang_code_insert}#{Sfx[:html]}" target="_top"> #{png_nav.nxt} </a> @@ -710,7 +698,7 @@ WOK #{toc} #{nxt} <td> -#{@vz.table_close}} +#{the_table_close}} end def toc_next2 toc_nav(false,true).dup @@ -739,34 +727,33 @@ WOK end end def navigation_table - %{<table summary="navigation segment table" width=#{@vz.table_width_1} border="0" bgcolor="white" cellpadding="0"> + %{<table summary="navigation segment table" width=#{the_width.table1} border="0" bgcolor="white" cellpadding="0"> <tr><th width="#{@@indent['leve_1']}" align="right"> </td> <td valign="top"> <font size=2>} end def navigation_table1 - %{<table summary="navigation segment table1" width=#{@vz.table_width_1} border="0" cellpadding=#{@vz.table_cellpad_box} bgcolor=#{@vz.color_table1} align="left"> + %{<table summary="navigation segment table1" width=#{the_width.table1} border="0" cellpadding=#{the_table_cellpad_box} bgcolor=#{the_color.table1} align="left"> <tr><td valign="top"> <font size="2">} end def navigation_table2 - %{<table summary="navigation segment table2" width=#{@vz.table_width_2} border="0" cellpadding=#{@vz.table_cellpad_box} bgcolor=#{@vz.color_table2} align="left"> + %{<table summary="navigation segment table2" width=#{the_width.table2} border="0" cellpadding=#{the_table_cellpad_box} bgcolor=#{the_color.table2} align="left"> <tr><td valign="top"> <font size="2">} end def credit %{ <div class="main_column"> -#{@vz.credits_splash} -#{@vz.credits_sisu} +#{@bits.credits_sisu} <a name="bottom" id="bottom"></a> <a name="end" id="end"></a> </div></div> } end def navigation_band(segtocband,seg_table_top_control) #change name to navigation_band_banner - %{<table summary="segment navigation band with banner" bgcolor=#{@vz.color_band1} width="100%"><tr> + %{<table summary="segment navigation band with banner" bgcolor=#{the_color.band1} width="100%"><tr> <td width="20%" align="left"> #{button_home} </td> @@ -782,7 +769,7 @@ WOK def navigation_band_bottom(segtocband,seg_table_top_control) #change name to navigation_band_bannerless %{ <div class="main_column"> - <table summary="segment navigation band" bgcolor=#{@vz.color_band1} width="100%"><tr> + <table summary="segment navigation band" bgcolor=#{the_color.band1} width="100%"><tr> <td width="70%" align="center"> #{doc_types} </td> @@ -812,7 +799,8 @@ WOK end def head_seg rdf=SiSU_XML_Tags::RDF.new(@md) - %{#{doc_type} + %{<!DOCTYPE html> +<html> <head> <meta charset="utf-8"> <title> @@ -840,8 +828,8 @@ WOK </p> <p class="tiny"> copy @ - <a href="#{@vz.url_home}"> - #{@vz.txt_home} + <a href="#{the_url.home}"> + #{the_text.txt_home} </a> </p> </div> @@ -853,8 +841,8 @@ WOK super(md) end def toc_owner_details - %{#{@vz.margin_txt_3} -#{@vz.paragraph_font_small} + %{#{the_margin.txt_3} +#{the_font.paragraph_font_small} <a href="#owner.details"> Owner Details <font size="1" color="#777777"> @@ -862,11 +850,11 @@ WOK </font> </a> </font> -#{@vz.table_close}} +#{the_table_close}} end end class FormatTextObject - @vz=SiSU_Viz::Defaults.new + include SiSU_Parts_HTML attr_accessor :md,:t_o,:txt,:ocn,:format,:table,:link,:linkname,:paranum,:p_num,:headname,:banner,:url def initialize(md,t_o) @md,@t_o=md,t_o @@ -899,7 +887,6 @@ WOK @txt=@txt.gsub(/#{Mx[:mk_o]}[-~]##{Mx[:mk_c]}/,'') end @p_num=ParagraphNumber.new(@md,@ocn) - @vz=SiSU_Viz::Defaults.new end def nametags_scroll(dob) tags='' @@ -1127,21 +1114,21 @@ WOK end end def bold_para - %{#{@vz.margin_txt_0} + %{#{the_margin.txt_0} <p class="bold"> #{@txt} </p> -#{@vz.margin_num_css} +#{the_margin.num_css}     -#{@vz.table_close}} +#{the_table_close}} end def bold_heading %{<p class="bold"> #{@txt} </p> -#{@vz.margin_num_css} +#{the_margin.num_css}     -#{@vz.table_close}} +#{the_table_close}} end def toc_head_copy_at %{<p class="center">#{@txt}</p>\n} @@ -1159,63 +1146,12 @@ WOK class FormatScroll < FormatTextObject def initialize(md,txt) super(md,txt) - @vz=SiSU_Viz::Defaults.new end end class FormatSeg < FormatTextObject def initialize(md,txt) super(md,txt) end - def navigation_toc_lev1_advert - %{#{@banner.home_button}\n -<center> -#{@txt} -#{@two} -</a></center><p>} - end - def navigation_toc_lev1 - %{#{@banner.nav_toc}} - end - def navigation_toc_lev2 #change bold use css - %{<p> -<table summary="navigation segment level 2"> -<tr><td width ="20"> -</td> -<td> - <font size="3" #{@vz.font_face}> - <b>#{@txt}</b> - </font> - </p> -#{@vz.table_close}} - end - def navigation_toc_lev3 #change bold use css - %{<p> -<table summary="navigation segment level 3"> -<tr><td width ="20"> -</td> -<td> - <font size="3" #{@vz.font_face}> - <b>#{@txt}</b> - </font> - </p> -#{@vz.table_close}} - end - def navigation_toc_lev4 - %{<table summary="navigation segment level 4"> -<tr><td width ="80"> -</td> -<td> -<p> - #{@txt} -</p> -#{@vz.table_close}} - end - def navigation_toc_lev5 - end - def navigation_toc_lev6 - end - def navigation_toc_lev7 - end def endnote_seg_body(fn='') #FIX #url construction keep within single line... BUG WATCH 200408 fn='doc' if fn.to_s.empty? #you may wish to reconsider, sends to 'doc' where no segment info %{ @@ -1290,7 +1226,7 @@ WOK <p class="bold"> #{@txt} </p> -#{@vz.table_close}} +#{the_table_close}} end def navigation_heading5 %{<p class="bold"> diff --git a/lib/sisu/v5/html_harvest_authors.rb b/lib/sisu/v5/html_harvest_authors.rb index 427ef4d3..0fa079d6 100644 --- a/lib/sisu/v5/html_harvest_authors.rb +++ b/lib/sisu/v5/html_harvest_authors.rb @@ -60,6 +60,7 @@ =end module SiSU_HarvestAuthors require_relative 'html_harvest_author_format' # html_harvest_author_format.rb + require_relative 'html_parts' # html_parts.rb class Songsheet @@the_idx_authors={} def initialize(opt,env) @@ -211,7 +212,6 @@ module SiSU_HarvestAuthors @alphabet_list=%W[9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z] @alph=@alphabet_list.dup @letter=@alph.shift - @vz=SiSU_Viz::Defaults.new end def html_file_open @the_idx.keys.each do |lng| @@ -376,7 +376,7 @@ WOK <a name="finish" id="finish"></a> <a name="stop" id="stop"></a> <a name="credits"></a> -#{@vz.credits_sisu} +#{SiSU_Proj_HTML::Bits.new.credits_sisu} </body> </html> WOK diff --git a/lib/sisu/v5/html_harvest_topics.rb b/lib/sisu/v5/html_harvest_topics.rb index 59812c68..ab74968c 100644 --- a/lib/sisu/v5/html_harvest_topics.rb +++ b/lib/sisu/v5/html_harvest_topics.rb @@ -60,8 +60,8 @@ =end module SiSU_HarvestTopics - require_relative 'html_harvest_author_format' # html_harvest_author_format.rb - include SiSU_Viz + require_relative 'html_harvest_author_format' # html_harvest_author_format.rb + require_relative 'html_parts' # html_parts.rb class Songsheet @@the_idx_topics={} def initialize(opt,env) @@ -501,7 +501,6 @@ module SiSU_HarvestTopics @alphabet_list=%W[9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z] @alph=@alphabet_list.dup @letter=@alph.shift - @vz=SiSU_Viz::Defaults.new end def html_file_open @the_idx.keys.each do |lng| @@ -745,7 +744,7 @@ WOK <a name="finish" id="finish"></a> <a name="stop" id="stop"></a> <a name="credits"></a> -#{@vz.credits_sisu} +#{SiSU_Proj_HTML::Bits.new.credits_sisu} </body> </html> WOK diff --git a/lib/sisu/v5/html_lite_shared.rb b/lib/sisu/v5/html_lite_shared.rb index 35eb130e..fa1cc481 100644 --- a/lib/sisu/v5/html_lite_shared.rb +++ b/lib/sisu/v5/html_lite_shared.rb @@ -59,11 +59,10 @@ =end module SiSU_FormatShared - require_relative 'defaults' # defaults.rb - include SiSU_Viz + require_relative 'html_parts' # html_parts.rb class CSS_Format - require_relative 'defaults' # defaults.rb require_relative 'se_hub_particulars' # se_hub_particulars.rb + include SiSU_Parts_HTML @@fns=nil def initialize(md,t_o) @md,@t_o=md,t_o @@ -79,10 +78,8 @@ module SiSU_FormatShared else @@hname end @tab="\t" - @brace_url=SiSU_Viz::Defaults.new.url_decoration @ocn_html_identifier=SiSU_Env::ProcessingSettings.new(@md).ocn_html_identifier @@tablehead,@@tablefoot=[],[] - @vz=SiSU_Viz::Defaults.new @env=SiSU_Env::InfoEnv.new(@md.fns) @base_url="#{@env.url.root}/#{@md.fnb}/#{@hname}.html" end @@ -172,7 +169,7 @@ module SiSU_FormatShared gsub(/#{Mx[:gl_o]}#([a-z]{2,4})#{Mx[:gl_c]}/u,'&\1;'). gsub(/#{Mx[:url_o]}[_\\](\S+?)#{Mx[:url_c]}/,'<a href="\1" target="_top">\1</a>'). #http ftp matches escaped, no decoration gsub(/(#{Mx[:lnk_c]})#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,'\1<a href="\2" target="_top">\2</a>'). #special case \{ e.g. \}http://url - gsub(/(^|#{Mx[:gl_c]}|\s)#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,%{\\1#{@brace_url.xml_open}<a href="\\2" target="_top">\\2</a>#{@brace_url.xml_close}\\3}) #http ftp matches with decoration + gsub(/(^|#{Mx[:gl_c]}|\s)#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,%{\\1#{the_url_decoration.xml_open}<a href="\\2" target="_top">\\2</a>#{the_url_decoration.xml_close}\\3}) #http ftp matches with decoration else s.gsub(/</m,'<'). gsub(/>/m,'>') @@ -190,7 +187,7 @@ module SiSU_FormatShared gsub(/#{Mx[:gl_o]}#([a-z]{2,4})#{Mx[:gl_c]}/u,'&\1;'). gsub(/#{Mx[:url_o]}_(\S+?)#{Mx[:url_c]}/,'<a href="\1" target="_top">\1</a>\2'). #http ftp matches escaped, no decoration gsub(/(#{Mx[:lnk_c]})#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,'\1<a href="\2" target="_top">\2</a>'). #special case \{ e.g. \}http://url - gsub(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,%{#{@brace_url.xml_open}<a href="\\1" target="_top">\\1</a>#{@brace_url.xml_close}}) #http ftp matches with decoration + gsub(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,%{#{the_url_decoration.xml_open}<a href="\\1" target="_top">\\1</a>#{the_url_decoration.xml_close}}) #http ftp matches with decoration end def paragraph %{<p class="h#{@lv}" type="substantive" header="#{@hname}">#{@txt}</p>\n} # << "\n" @@ -252,7 +249,7 @@ GSUB tag_para(h) end def para_table - %{<p class="norm" align="left"><font #{@vz.font_small} #{@vz.font_color} #{@vz.font_face}>} + %{<p class="norm" align="left"><font #{the_font.set_small} #{the_font.set_color} #{the_font.set_face}>} end def ocn %{<label class="ocn">#{@ocn}</label>} << "\n" @@ -271,7 +268,7 @@ GSUB @@tablefoot.each {|x| tablefoot << %{<p align="center"><font size=2><i>#{x}</i></font></p>\n}} @@tablefoot=[] parablock=parablock.gsub(/#{Mx[:gr_o]}TZ#{Mx[:gr_c]}/, - %{#{@vz.table_close}\n}) # + + %{#{the_table_close}\n}) # + end if @@tablehead==1 if parablock =~/#{Mx[:tc_p]}#{Mx[:tc_p]}/u diff --git a/lib/sisu/v5/html_manifest.rb b/lib/sisu/v5/html_manifest.rb index de629d61..02368111 100644 --- a/lib/sisu/v5/html_manifest.rb +++ b/lib/sisu/v5/html_manifest.rb @@ -63,13 +63,13 @@ module SiSU_Manifest require_relative 'prog_text_translation' # prog_text_translation.rb require_relative 'se_hub_particulars' # se_hub_particulars.rb include SiSU_Particulars + require_relative 'html_parts' # html_parts.rb require_relative 'html_minitoc' # html_minitoc.rb require_relative 'html' # html.rb include SiSU_HTML_Format require_relative 'dp' # dp.rb include SiSU_Param require_relative 'i18n' # i18n.rb - include SiSU_Viz class Source def initialize(opt) @opt=opt @@ -123,6 +123,7 @@ module SiSU_Manifest end private class Output <Source + include SiSU_Parts_HTML def initialize(md) @manifest={ txt: [], html: [] } @md,@fns=md,md.fns @@ -140,7 +141,6 @@ module SiSU_Manifest l=SiSU_Env::StandardiseLanguage.new(md.opt.lng).language @language=l[:n] @translate=SiSU_Translate::Source.new(md,@language) - @brace_url=SiSU_Viz::Defaults.new.url_decoration @stylesheet=SiSU_Style::CSS_HeadInfo.new(md).stylesheet @fn_lng=(@f.output_dir_structure.by_language_code?) \ ? '' @@ -158,9 +158,9 @@ module SiSU_Manifest if @o_str.dump_or_redirect? '' elsif src==:src #check - %{<br>#{@brace_url.xml_open}<a href="#{url}/#{file}">#{url}/#{file}</a>#{@brace_url.xml_close}} + %{<br>#{the_url_decoration.xml_open}<a href="#{url}/#{file}">#{url}/#{file}</a>#{the_url_decoration.xml_close}} else - %{<p class="tiny">#{@brace_url.xml_open}<a href="#{url}/#{file}">#{url}/#{file}</a>#{@brace_url.xml_close}</p>} + %{<p class="tiny">#{the_url_decoration.xml_open}<a href="#{url}/#{file}">#{url}/#{file}</a>#{the_url_decoration.xml_close}</p>} end end def summarize(id,file,pth='',rel='',url='',img='● ') @@ -261,7 +261,7 @@ module SiSU_Manifest def published_languages(id) published_manifests?.each do |l| @manifest[:txt] << "#{l[:mu]} #{l[:l]}\n" - @manifest[:html] << %{<tr><th class="left"><p class="bold"><a href="#{l[:mu]}">#{l[:l]}</a></p></th><td><p class="norm">#{l[:l]}</p><p class="tiny">#{@brace_url.xml_open}<a href="#{l[:mu]}">#{l[:mu]}</a>#{@brace_url.xml_close}</p></td><td class="right"><p class="right"> </p></td></tr>\n} + @manifest[:html] << %{<tr><th class="left"><p class="bold"><a href="#{l[:mu]}">#{l[:l]}</a></p></th><td><p class="norm">#{l[:l]}</p><p class="tiny">#{the_url_decoration.xml_open}<a href="#{l[:mu]}">#{l[:mu]}</a>#{the_url_decoration.xml_close}</p></td><td class="right"><p class="right"> </p></td></tr>\n} end end def metadata(id,info) @@ -273,7 +273,7 @@ module SiSU_Manifest elsif url =~/^\.\.\// then url.gsub(/^\.(\.)?/,@env.url.root) else url end - @manifest[:html] << %{<tr><th class="right" width=5%><p class="norm">●</p></th><td class="left"><p class="norm"><a href="#{url}">#{lnk}</a></p><p class="tiny">  #{@brace_url.xml_open}<a href="#{static}">#{static}</a>#{@brace_url.xml_close}</p></td></tr>\n} + @manifest[:html] << %{<tr><th class="right" width=5%><p class="norm">●</p></th><td class="left"><p class="norm"><a href="#{url}">#{lnk}</a></p><p class="tiny">  #{the_url_decoration.xml_open}<a href="#{static}">#{static}</a>#{the_url_decoration.xml_close}</p></td></tr>\n} end def output_tests if FileTest.file?(@f.place_file.html_segtoc.dir)==true @@ -885,7 +885,6 @@ WOK begin make=SiSU_Env::ProcessingSettings.new(@md) minitoc=SiSU_HTML_MiniToc::TocMini.new(@md,data).songsheet.join("\n") - vz=SiSU_Viz::Defaults.new format_head_toc=SiSU_HTML_Format::HeadToc.new(@md) @manifest[:html] <<<<WOK <!DOCTYPE html> @@ -1010,7 +1009,7 @@ WOK </div> <div> <br> -#{vz.credits_sisu_manifest} +#{SiSU_Proj_HTML::Bits.new.credits_sisu_manifest} </div> </body> </html> diff --git a/lib/sisu/v5/html_parts.rb b/lib/sisu/v5/html_parts.rb new file mode 100644 index 00000000..6f3468d0 --- /dev/null +++ b/lib/sisu/v5/html_parts.rb @@ -0,0 +1,440 @@ +# encoding: utf-8 +=begin + + * Name: SiSU + + * Description: a framework for document structuring, publishing and search + + * Author: Ralph Amissah + + * Copyright: (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, + 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 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 + + * 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/v5/html_parts.rb;hb=HEAD> + + * Ralph Amissah + <ralph@amissah.com> + <ralph.amissah@gmail.com> + + ** Description: shared html parts + +=end +module SiSU_Parts_HTML + require_relative 'generic_parts' # generic_parts.rb + include SiSU_Parts_Generic + def the_line_break + '<br>' + end + def the_table_close + '</td></tr> +</table>' + 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 + %{ <link rel="shortcut icon" href="../_sisu/image/#{the_icon.i_ico}" />} + end + def png_home + %{<img border="0" src="#{_url_path_image_base}/#{the_icon.home_button}" alt="#{the_text.home} -->" />} + end + def png_home_button + rel=@dir.path_rel_links.html_scroll_2 + %{<img border="0" src="#{rel}/#{the_icon.home_button}" alt="#{the_text.home} -->" />} + 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 + %{<font #{set_tiny} #{set_face}>} + end + def paragraph_font_small + %{<font #{set_small} #{set_face}>} + end + self + end + def the_nav + def txt_homepage + %{ <font face="#{the_font.set_fonts}" size="2"> +  home  + </font> } + end + def txt_toc_link + %{ <font face="#{the_font.set_fonts}" size="2"> +   toc  + </font> } + end + def txt_doc_link + %{ <font face="#{the_font.set_fonts}" size="2"> +  scroll  + </font> } + end + def txt_manifest + #{png_manifest} document manifest + %{ <font face="#{the_font.set_fonts}" size="2"> + [ document manifest ] + </font> } + end + def txt_concordance + %{ <font face="#{the_font.set_fonts}" size="2"> +   A-Z  + </font> } + end + self + end + def the_banner + def home_button_only + %{<a href="#{url.site}/"> + #{the_png.png_home_button} + </a>} + end + def banner_band + %{<table summary="home button" width="100%" border="0" cellpadding="3" align="center"> +<tr><td align="left" valign="middle"> + <a href="#{url.site}/" target="_top"> + #{the_png.png_home} + </a> +</td> +<td width="90%"> +#{the_table_close}} + end + def instrument_cover_band_scr + '<table summary="scroll instrument cover band" width="100%" border="0" cellpadding="8" align="center"> +<tr><td align="center">' + end + def instrument_cover_band_seg + '<table summary="segment instrument cover band, title, author, location" width="100%" border="0" cellpadding="8" align="center"> +<tr><td align="center">' + end + self + end + def the_margin + def txt_0 + %{<table summary="" width=#{the_width.table_txt} border="0" cellpadding="2" align="center"> +<tr><td width=#{indent_level_0} align="right"> +</td><td valign="top" align="justify">} + end + def txt_1 + %{<table summary="" width=#{the_width.table_txt} border="0" cellpadding="2" align="center"> +<tr><td width=#{indent_level_1} align="right"></td><td valign="top" align="justify">} + end + def txt_2 + %{<table summary="" width=#{the_width.table_txt} border="0" cellpadding="2" align="center"> +<tr><td width=#{indent_level_2} align="right"> +</td> +<td valign="top" align="justify">} + end + def txt_3 + %{<table summary="" width=#{the_width.table_txt} border="0" cellpadding="2" align="center"> +<tr><td width=#{indent_level_3} align="right"> +</td> +<td valign="top" align="justify">} + end + def css + '<table summary="normal text css" width="100%" border="0" cellpadding="2" align="center"> +<tr><td valign="top" align="justify"> ' + end + def num + '</p> </td><td width="4%" align="right" valign="top">' + end + def numless + '</td><td width="4%" align="right" valign="top">' + end + def num_css + '</td> +<td width="2%" align="right" valign="top"> ' + 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 + %{ <meta name="generator" content="#{@v[:project]} #{@v[:version]} of #{@v[:date_stamp]} (#{@v[:date]}) (n*x and Ruby!)" /> + <link rel="generator" href="http://www.sisudoc.org/" />} + end + def widget_sisu_text +<<WOK + <p class="tiny"><font color="#666666" size="2"> + Output generated by + <a href="#{the_url.sisu}"> + #{@v[:project]} + </a> + #{@v[:version]} #{@v[:date]} (#{@v[:date_stamp]}) + </font></p> +WOK + end + def credits_sisu_manifest + widget_sisu_text + end + def widget_sisu +<<WOK +<!-- widget sisu --> +<tr><td valign="top" width="100%"> +<!-- SiSU Rights --> +#{widget_sisu_text} +</td></tr> +WOK + end + def credits_sisu + %{<div class="substance"> +<table summary="SiSU summary" cellpadding="4" border="0"> +<tr><td> + #{widget_sisu} +</table></div>} + '' + 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 + <<WOK +<html><head> +<title>SiSU + + + +SiSU informtion provided at www.sisudoc.org/sisu/SiSU

+If your browser supports redirection, you will be escorted there shortly. + + +WOK + end + def homepage + < + + +SiSU information Structuring Universe - Structured information, Serialized Units - software for electronic texts, documents, books, digital libraries in plaintext, HTML, EPUB, XHTML, XML, ODF (OpenDocument), LaTeX, PDF, SQL (PostgreSQL and SQLite), and for search + + + + + + + + + + + + + + + + + +

SiSU

+

+[Manual] +

+

+[Source] +[List Info (sisu@lists.sisudoc.org)] +

+ +

SiSU Markup Samples

+

+[Source] +[Output] +

+ +
+ +

+ Structured information, Serialized Units +    + + <www.sisudoc.org> + +   or   + + <www.jus.uio.no/sisu/> + +software for electronic texts, document collections, books, digital libraries & search, with "atomic search" & text locating system (shared object citation numbering: "ocn"). +Outputs include: plaintext, HTML, EPUB, ODT (OpenDocumentText), (XHTML, XML,) LaTeX, PDF, SQL (PostgreSQL and SQLite). +

+

+ +<sisu@lists.sisudoc.org> + + +<http://lists.sisudoc.org/listinfo/sisu> + +

+

+ +<ralph@amissah.com> + + +<ralph.amissah@gmail.com> + +

+

+#{@v[:project]} #{@v[:version]} of #{@v[:date_stamp]} (#{@v[:date]}) (n*x and Ruby!), #{@date.year_static}. +

+

+w3 since October 3 1993. +

+ + +WOK + end + def home_toc + ' ' + end + end +end +__END__ diff --git a/lib/sisu/v5/html_promo.rb b/lib/sisu/v5/html_promo.rb index 1f2b0388..a2d3ecf3 100644 --- a/lib/sisu/v5/html_promo.rb +++ b/lib/sisu/v5/html_promo.rb @@ -66,7 +66,6 @@ module SiSU_HTML_Promo @env=SiSU_Env::InfoEnv.new(@md.fns,@md) @rc=SiSU_Env::GetInit.new.sisu_yaml.rc @ad=SiSU_Env::GetInit.new.ads - @vz=SiSU_Viz::Defaults.new @flag=@env.widget.promo? @make=SiSU_Env::ProcessingSettings.new(@md) end @@ -97,8 +96,6 @@ module SiSU_HTML_Promo && @flag[:ad] ads=if @md.promo && @md.promo.length > 0 #promo set in document promo_array=@md.promo - elsif @flag[:sk] #promo set - promo_array=@vz.widget_promo elsif @flag[:rc] #promo set in rc file promo_array=if @rc['html']['promo'].is_a?(String) @rc['html']['promo'].split(/[,;]\s*/) diff --git a/lib/sisu/v5/html_scroll.rb b/lib/sisu/v5/html_scroll.rb index 1b632f56..94dac502 100644 --- a/lib/sisu/v5/html_scroll.rb +++ b/lib/sisu/v5/html_scroll.rb @@ -65,7 +65,6 @@ module SiSU_HTML_Scroll class Scroll def initialize(md='',data='',endnotes='') @md,@data,@endnotes=md,data,endnotes - @vz=SiSU_Viz::Defaults.new end def songsheet begin diff --git a/lib/sisu/v5/html_segments.rb b/lib/sisu/v5/html_segments.rb index 4054e6fc..60cd51f1 100644 --- a/lib/sisu/v5/html_segments.rb +++ b/lib/sisu/v5/html_segments.rb @@ -200,7 +200,6 @@ module SiSU_HTML_Seg attr_reader :seg_name_html,:seg_name_html_tracker def initialize(md=nil,data='') @md,@data=md,data - @vz=SiSU_Viz::Defaults.new @seg_name_html=@@seg_name_html || nil @seg_name_html_tracker=@@tracker || nil @env=SiSU_Env::InfoEnv.new(@md.fns) if @md @@ -575,19 +574,17 @@ module SiSU_HTML_Seg if @md.flag_separate_endnotes dob.obj=dob.obj.gsub(/"\s+href="#(#{Mx[:note]}\d+)">/,%{" href=\"endnotes#{Sfx[:html]}#\\1">}) #endnote- twice #removed file type end - if dob.obj !~/#{@vz.margin_txt_w1}|#{@vz.margin_txt_w2}/ - if (dob.is==:heading \ - || dob.is==:heading_insert \ - || dob.is==:para) \ - && (not dob.ocn \ - || (dob.ocn.to_s.empty?)) - format_seg=SiSU_HTML_Format::FormatSeg.new(@md,dob) - end - dob.obj=dob.obj.gsub(/\s*(-\{{2}~\d+|<:e[:_]\d+>).*/,'') #potentially dagerous - removes all paragraphs with #?? workpoint - if dob.obj =~/ / #endnote- note- - format_seg=SiSU_HTML_Format::FormatSeg.new(@md,dob) - dob=format_seg.no_paranum - end + if (dob.is==:heading \ + || dob.is==:heading_insert \ + || dob.is==:para) \ + && (not dob.ocn \ + || (dob.ocn.to_s.empty?)) + format_seg=SiSU_HTML_Format::FormatSeg.new(@md,dob) + end + dob.obj=dob.obj.gsub(/\s*(-\{{2}~\d+|<:e[:_]\d+>).*/,'') #potentially dagerous - removes all paragraphs with #?? workpoint + if dob.obj =~/ / #endnote- note- + format_seg=SiSU_HTML_Format::FormatSeg.new(@md,dob) + dob=format_seg.no_paranum end if (dob.is==:heading \ || dob.is==:heading_insert) \ diff --git a/lib/sisu/v5/html_shared.rb b/lib/sisu/v5/html_shared.rb index 3b6b9dfd..04617e74 100644 --- a/lib/sisu/v5/html_shared.rb +++ b/lib/sisu/v5/html_shared.rb @@ -58,7 +58,6 @@ =end module SiSU_HTML_Shared - require_relative 'defaults' # defaults.rb require_relative 'html_table' # html_table.rb class TableHTML < SiSU_HTML_Table::TableHTML end diff --git a/lib/sisu/v5/html_table.rb b/lib/sisu/v5/html_table.rb index 497f7c4e..f29256a7 100644 --- a/lib/sisu/v5/html_table.rb +++ b/lib/sisu/v5/html_table.rb @@ -58,9 +58,10 @@ =end module SiSU_HTML_Table - require_relative 'defaults' # defaults.rb - require_relative 'xhtml_table.rb' # xhtml_table.rb - class TableHTML /, %{\n
\\3
\n}) end - dob.obj=dob.obj.gsub(/!pick/,%{stellar}). - gsub(/!new/,%{ new}). + dob.obj=dob.obj.gsub(/!pick/,%{stellar}). + gsub(/!new/,%{ new}). gsub(/<:h(.{1,7}?)>/,'\1'). gsub(/<:to(\d{1,7}?)>/,'to { \1 } '). gsub(/#{Mx[:url_o]}_(\S+?)#{Mx[:url_c]}/,'\1'). #http ftp matches escaped, no decoration - gsub(/#{Mx[:url_o]}([a-zA-Z0-9._-]+\@\S+?\.[a-zA-Z0-9._-]+)#{Mx[:url_c]}/,%{#{@brace_url.xml_open}\\1#{@brace_url.xml_close}}). - gsub(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,%{#{@brace_url.xml_open}\\1#{@brace_url.xml_close}}) #http ftp matches with decoration + gsub(/#{Mx[:url_o]}([a-zA-Z0-9._-]+\@\S+?\.[a-zA-Z0-9._-]+)#{Mx[:url_c]}/,%{#{the_url_decoration.xml_open}\\1#{the_url_decoration.xml_close}}). + gsub(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,%{#{the_url_decoration.xml_open}\\1#{the_url_decoration.xml_close}}) #http ftp matches with decoration if dob.obj =~/#{Xx[:html_relative2]}\/\S+/ \ and dob.obj !~/(\"#{Xx[:html_relative2]}\/\S+?\"|>\s*#{Xx[:html_relative2]}\/\S+<)/ dob.obj=dob.obj.gsub(/(#{Xx[:html_relative2]}\/\S+)/,'\1') @@ -245,9 +245,9 @@ module SiSU_HTML_Tune and dob.obj !~/(\"..\/\S+?\"|>\s*..\/\S+<)/ dob.obj=dob.obj.gsub(/\.\.(\/\S+)/,%{\1}) end - dob.obj=dob.obj.gsub(//m,'>') end diff --git a/lib/sisu/v5/hub.rb b/lib/sisu/v5/hub.rb index 70a4e360..a4751e40 100644 --- a/lib/sisu/v5/hub.rb +++ b/lib/sisu/v5/hub.rb @@ -68,8 +68,6 @@ module SiSU require_relative 'hub_options' # hub_options.rb require_relative 'dp' # dp.rb include SiSU_Param - require_relative 'defaults' # defaults.rb - include SiSU_Viz require_relative 'utils' # utils.rb begin require 'uri' diff --git a/lib/sisu/v5/hub_loop_markup_files.rb b/lib/sisu/v5/hub_loop_markup_files.rb index 70127915..165fdc93 100644 --- a/lib/sisu/v5/hub_loop_markup_files.rb +++ b/lib/sisu/v5/hub_loop_markup_files.rb @@ -67,8 +67,6 @@ module SiSU_Hub_Loops require_relative 'hub_options' # hub_options.rb require_relative 'dp' # dp.rb include SiSU_Param - require_relative 'defaults' # defaults.rb - include SiSU_Viz require_relative 'utils' # utils.rb begin require 'uri' diff --git a/lib/sisu/v5/manpage.rb b/lib/sisu/v5/manpage.rb index a42c7dfe..1dff0bde 100644 --- a/lib/sisu/v5/manpage.rb +++ b/lib/sisu/v5/manpage.rb @@ -63,10 +63,10 @@ module SiSU_Manpage require_relative 'se' # se.rb include SiSU_Env include SiSU_Param - include SiSU_Viz require_relative 'manpage_format' # manpage_format.rb include SiSU_ManpageFormat require_relative 'shared_metadata' # shared_metadata.rb + require_relative 'generic_parts' # generic_parts.rb require_relative 'txt_shared' # txt_shared.rb @@alt_id_count,@@alt_id_count,@@tablehead,@@number_of_cols=0,0,0,0 @@tablefoot='' @@ -122,14 +122,11 @@ module SiSU_Manpage end private class Scroll #{@dob.obj} " diff --git a/lib/sisu/v5/po4a.rb b/lib/sisu/v5/po4a.rb index 7b7e2665..03cf14f7 100644 --- a/lib/sisu/v5/po4a.rb +++ b/lib/sisu/v5/po4a.rb @@ -66,7 +66,6 @@ module SiSU_Po4a require_relative 'shared_metadata' # shared_metadata.rb require_relative 'po4a_set' # po4a_set.rb include SiSU_Param - include SiSU_Viz class Source @@opt_src,@@opt_trn,@@opt_src_,@@opt_trn_,@@md_src,@@md_trn=nil,nil,nil,nil,nil,nil def initialize(opt,fn=nil) @@ -172,8 +171,6 @@ module SiSU_Po4a end private class Scroll ]'). gsub(/#{Mx[:lnk_o]}(.+?)#{Mx[:lnk_c]}image/,'\1 [link: local image]'). gsub(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,'\1') - #dob.obj.gsub!(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,"#{@brace_url.txt_open}\\1#{@brace_url.txt_close}") notes=extract_endnotes(dob) #% ### footnotes current state - extracted dob.obj=dob.obj.gsub(/#{Mx[:en_a_o]}([\d]+)\s+(?:.+?)#{Mx[:en_a_c]}/,'~^'). # endnote marker marked up diff --git a/lib/sisu/v5/qrcode.rb b/lib/sisu/v5/qrcode.rb index 04d91a5e..483f4deb 100644 --- a/lib/sisu/v5/qrcode.rb +++ b/lib/sisu/v5/qrcode.rb @@ -66,8 +66,8 @@ module SiSU_QRcode require_relative 'html' # html.rb require_relative 'dp' # dp.rb include SiSU_Param + require_relative 'generic_parts' # generic_parts.rb require_relative 'i18n' # i18n.rb - include SiSU_Viz class Source def initialize(opt) @opt=opt @@ -116,6 +116,7 @@ module SiSU_QRcode end private class OutputInfo 0 + elsif defined? @html_bits.widget_promo \ + and not @html_bits.widget_promo.nil? \ + and @html_bits.widget_promo.is_a?(Array) \ + and @html_bits.widget_promo.length > 0 @flag[:sk]=true true elsif defined? @rc['html']['promo'] \ @@ -610,8 +612,8 @@ module SiSU_Info_Env and @rc['search'][type]['action'] =~/https?:\/\// flag=if promo?[:ad] false - elsif defined? @vz.widget_search \ - and @vz.widget_search==true + elsif defined? @html_bits.widget_search \ + and @html_bits.widget_search==true true elsif defined? @rc['search'][type]['flag'] \ and @rc['search'][type]['flag']==true @@ -636,8 +638,8 @@ module SiSU_Info_Env and @rc['search'][type]['db'] =~/\S+/ flag=if promo?[:ad] false - elsif defined? @vz.widget_search \ - and @vz.widget_search==true + elsif defined? @html_bits.widget_search \ + and @html_bits.widget_search==true true elsif defined? @rc['search'][type]['flag'] \ and @rc['search'][type]['flag']==true @@ -756,7 +758,7 @@ WOK end def widget_static @rc=SiSU_Env::GetInit.new.sisu_yaml.rc - @vz=SiSU_Viz::Defaults.new + @html_bits=SiSU_Proj_HTML::Bits.new @flag={ ad: false, md: false, sk: false, rc: false } def search? flag=if defined? @rc['search'] \ @@ -765,8 +767,8 @@ WOK and @rc['search']['sisu']['action'] =~/https?:\/\// \ and defined? @rc['search']['sisu']['db'] \ and @rc['search']['sisu']['db'] =~/\S+/ - flag=if defined? @vz.widget_search \ - and @vz.widget_search==true + flag=if defined? @html_bits.widget_search \ + and @html_bits.widget_search==true true elsif defined? @rc['search']['sisu']['flag'] \ and @rc['search']['sisu']['flag']==true @@ -787,8 +789,8 @@ WOK and @rc['search']['sisu']['db'] =~/\S+/ \ and defined? @rc['search']['sisu']['db'] \ and @rc['search']['sisu']['db'] =~/\S+/ - flag=if defined? @vz.widget_search \ - and @vz.widget_search==true + flag=if defined? @html_bits.widget_search \ + and @html_bits.widget_search==true true elsif defined? @rc['search']['sisu']['flag'] \ and @rc['search']['sisu']['flag']==true diff --git a/lib/sisu/v5/shared_metadata.rb b/lib/sisu/v5/shared_metadata.rb index 9f4f4362..17e0a4c4 100644 --- a/lib/sisu/v5/shared_metadata.rb +++ b/lib/sisu/v5/shared_metadata.rb @@ -58,8 +58,10 @@ =end module SiSU_Metadata + require_relative 'xml_parts' # xml_parts.rb require_relative 'xml_shared' # xml_shared.rb class Summary + include SiSU_Parts_XML attr_accessor :tag,:inf,:class,:attrib def initialize(md,display_heading=false) @md,@display_heading=md,display_heading @@ -916,7 +918,6 @@ WOK end def odf def meta_para - url_brace=SiSU_Viz::Defaults.new.url_decoration if @inf.is_a?(String) @inf=@inf.gsub(//,'>'). gsub(/<br(?: \/)?>/,'
') @@ -938,13 +939,13 @@ WOK '\1\2') #special case \{ e.g. \}http://url @inf=if @inf =~/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/ @inf.gsub(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/, - %{#{url_brace.xml_open}\\1#{url_brace.xml_close}}) #http ftp matches with decoration + %{#{the_url_decoration.xml_open}\\1#{the_url_decoration.xml_close}}) #http ftp matches with decoration else @inf.gsub(/(https?:\/\/[^<>()'"\s]+)/, - %{#{url_brace.xml_open}\\1#{url_brace.xml_close}}) #http ftp matches with decoration + %{#{the_url_decoration.xml_open}\\1#{the_url_decoration.xml_close}}) #http ftp matches with decoration end @inf=@inf.gsub(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+)/, - %{#{url_brace.xml_open}\\1#{url_brace.xml_close}}) if @inf !~/http:\/\// # improve upon, document crash where url contains '@' symbol + %{#{the_url_decoration.xml_open}\\1#{the_url_decoration.xml_close}}) if @inf !~/http:\/\// # improve upon, document crash where url contains '@' symbol end <#{@tag.capitalize}: #{@inf} diff --git a/lib/sisu/v5/sst_do_inline_footnotes.rb b/lib/sisu/v5/sst_do_inline_footnotes.rb index 41bc30f2..fab94edf 100644 --- a/lib/sisu/v5/sst_do_inline_footnotes.rb +++ b/lib/sisu/v5/sst_do_inline_footnotes.rb @@ -59,8 +59,6 @@ =end module SiSU_ConvertFootnotes - require_relative 'defaults' # defaults.rb - include SiSU_Viz require_relative 'se' # se.rb include SiSU_Env require_relative 'dp' # dp.rb @@ -211,7 +209,6 @@ module SiSU_ConvertFootnotes : x end data=data_new.flatten - data=SiSU_ConvertFootnotes::Make.new(@md,data).substitutions_and_insertions? data=SiSU_ConvertFootnotes::Make.new(@md,data).character_check data=SiSU_ConvertFootnotes::Make.new(@md,data).endnotes SiSU_ConvertFootnotes::Output.new(@md,data).hard_output @@ -270,57 +267,6 @@ module SiSU_ConvertFootnotes end @tuned_file end - def substitutions_and_insertions? - data=@data - tuned_file=[] - data.each do |para| - if @md.markup =~/0\.16|0\.37/ #parameters not extracted/available - para.gsub!(/^0~\S+\s+/,'@\1: ') - para.gsub!(/^1~/,':A~') - para.gsub!(/^2~/,':B~') - para.gsub!(/^3~/,':C~') - para.gsub!(/^4~/,'1~') - para.gsub!(/^5~/,'2~') - para.gsub!(/^6~/,'3~') - para.gsub!(/^7~/,'4~') - para.gsub!(/^8~/,'5~') - para.gsub!(/^9~/,'6~') - end - if para =~/<:insert\d+!?>/ \ - and para !~/^%\s+/ - ins=SiSU_Viz::Inserts.new - case para - when /^\s*<:insert1>\s*$/ - para=[] - ins.insert1.split(/\n\n/).each {|x| para << x } - when /^\s*<:insert2>\s*$/ - para=[] - ins.insert2.split(/\n\n/).each {|x| para << x } - when /^\s*<:insert3>\s*$/ - para=[] - ins.insert3.split(/\n\n/).each {|x| para << x << "\n"} - para=ins.insert3 - when /^\s*<:insert4>\s*$/ - para=[] - ins.insert4.split(/\n\n/).each {|x| para << x << "\n"} - para=ins.insert4 - when /^\s*<:insert5>\s*$/ - para=[] - ins.insert5.split(/\n\n/).each {|x| para << x << "\n"} - when /^\s*<:insert6>\s*$/ - para=[] - ins.insert6.split(/\n\n/).each {|x| para << x << "\n"} - when /^\s*<:insert7>\s*$/ - para=[] - ins.insert7.split(/\n\n/).each {|x| para << x << "\n"} - end - para.each {|x| tuned_file << x } - else tuned_file << para - end - tuned_file.compact! - end - tuned_file - end def name_endnote_seg data=@data @tuned_file=[] diff --git a/lib/sisu/v5/sst_to_s_xml_sax.rb b/lib/sisu/v5/sst_to_s_xml_sax.rb index 5c026c05..80d6269b 100644 --- a/lib/sisu/v5/sst_to_s_xml_sax.rb +++ b/lib/sisu/v5/sst_to_s_xml_sax.rb @@ -60,8 +60,6 @@ module SiSU_SimpleXML_ModelSax require_relative 'se_hub_particulars' # se_hub_particulars.rb include SiSU_Particulars - require_relative 'defaults' # defaults.rb - include SiSU_Viz require_relative 'dp' # dp.rb include SiSU_Param require_relative 'se' # se.rb @@ -151,7 +149,6 @@ module SiSU_SimpleXML_ModelSax @@xml={ body: [], open: [], close: [], head: [] } def initialize(data='',particulars='') @data,@env,@md=data,particulars.env,particulars.md - @vz=SiSU_Viz::Defaults.new @regx=/^(?:#{Mx[:mk_o]}:p[bn]#{Mx[:mk_c]}\s*)?(?:#{Mx[:lv_o]}[1-9]:(\S*)#{Mx[:lv_c]})?(.+)/ @tab="\t" if @md diff --git a/lib/sisu/v5/texinfo.rb b/lib/sisu/v5/texinfo.rb index 43ab5118..92b7241c 100644 --- a/lib/sisu/v5/texinfo.rb +++ b/lib/sisu/v5/texinfo.rb @@ -61,7 +61,6 @@ module SiSU_TexInfo require_relative 'html' # html.rb require_relative 'dp' # dp.rb include SiSU_Param - include SiSU_Viz #include Stamp ... needed removed arbitrarily 2005w05/1 (warnings about undefined flags) require_relative 'texinfo_format' # texinfo_format.rb include SiSU_TexInfoFormat @@ -74,13 +73,11 @@ module SiSU_TexInfo @@tex_pattern_margin_number="\\\\marginpar.+?\s+" class Source include SiSU_Param - include SiSU_Viz include SiSU_TexInfo def initialize(opt) @opt=opt @md=SiSU_Param::Parameters.new(@opt).get @env=SiSU_Env::InfoEnv.new(@opt.fns) - @vz=SiSU_Viz::Defaults.new end def directories begin @@ -151,7 +148,6 @@ module SiSU_TexInfo def initialize(md,data) @md,@data=md,data @env=SiSU_Env::InfoEnv.new(@md.fns) - @vz=SiSU_Viz::Defaults.new @f=SiSU_Env::FileOp.new(@md) end def songsheet diff --git a/lib/sisu/v5/texinfo_format.rb b/lib/sisu/v5/texinfo_format.rb index 00ee77b3..46a5ed69 100644 --- a/lib/sisu/v5/texinfo_format.rb +++ b/lib/sisu/v5/texinfo_format.rb @@ -61,7 +61,6 @@ module SiSU_TexInfoFormat @@table_pg_break_counter=1 require_relative 'dp' # dp.rb include SiSU_Param - include SiSU_Viz class Texinfo @@tex_1='\\\\~' #?? debug @@tabular="{tabular}" @@ -75,7 +74,6 @@ module SiSU_TexInfoFormat p dob.class p caller end - @vz=SiSU_Viz::Defaults.new end def head t=Time.now diff --git a/lib/sisu/v5/texpdf.rb b/lib/sisu/v5/texpdf.rb index 6579d338..e61595e0 100644 --- a/lib/sisu/v5/texpdf.rb +++ b/lib/sisu/v5/texpdf.rb @@ -64,8 +64,7 @@ module SiSU_TeX SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia). error('pstore NOT FOUND (LoadError)') end - require_relative 'defaults' # defaults.rb - include SiSU_Viz + require_relative 'texpdf_parts' # texpdf_parts.rb require_relative 'se_hub_particulars' # se_hub_particulars.rb include SiSU_Particulars require_relative 'texpdf_format' # texpdf_format.rb @@ -88,7 +87,6 @@ module SiSU_TeX end require_relative 'se' # se.rb include SiSU_Env - include SiSU_Viz require_relative 'ao' # ao.rb include SiSU_AO include SiSU_TeX @@ -395,6 +393,7 @@ module SiSU_TeX end end class LaTeXcreate + include SiSU_Parts_TeXpdf @@tex_head={ 'a4'=> { p: nil, l: nil }, 'a5'=> { p: nil, l: nil }, @@ -411,9 +410,7 @@ module SiSU_TeX @data=@particulars.ao_array # ao file drawn here @st={ tex: {} } @tex_ml=SiSU_TeX_Pdf::UseTeX.new(@md) - @vz=SiSU_Viz::Defaults.new @dp=@@dp ||=SiSU_Env::InfoEnv.new.digest.pattern - @brace_url=SiSU_Viz::Defaults.new.url_decoration l=SiSU_Env::StandardiseLanguage.new(@md.opt.lng).language @language=l[:n] @translate=SiSU_Translate::Source.new(@md,@language) @@ -810,7 +807,7 @@ module SiSU_TeX end def markup(data) @tex_file=[] - home=@vz.txt_home.gsub(/#{Mx[:br_line]}|#{Mx[:br_nl]}|#{Mx[:br_paragraph]}|\\\\/,' - ') #no line splitting in heading neither html nor latex + home=the_text.txt_home.gsub(/#{Mx[:br_line]}|#{Mx[:br_nl]}|#{Mx[:br_paragraph]}|\\\\/,' - ') #no line splitting in heading neither html nor latex title=@md.title.full.gsub(/#{Mx[:br_line]}|#{Mx[:br_nl]}|#{Mx[:br_paragraph]}|\\\\/,' - ') #no line splitting in heading neither html nor latex @md.papersize_array.each do |ps| if @md.opt.act[:pdf_p][:set]==:on diff --git a/lib/sisu/v5/texpdf_format.rb b/lib/sisu/v5/texpdf_format.rb index d5defb39..96b5dc91 100644 --- a/lib/sisu/v5/texpdf_format.rb +++ b/lib/sisu/v5/texpdf_format.rb @@ -58,19 +58,19 @@ =end module SiSU_TeX_Pdf + require_relative 'texpdf_parts' # texpdf_parts.rb @@table_pg_break_counter=1 - include SiSU_Viz class BareUrls + include SiSU_Parts_TeXpdf def initialize(md,dob=nil) @md,@dob=md,dob - @brace_url=SiSU_Viz::Defaults.new.url_decoration end def bare_urls @dob.obj=@dob.obj.gsub(/#{Mx[:url_o]}([a-zA-Z0-9._-]+\@[a-zA-Z0-9_-]+?\.[a-zA-Z0-9._-]+)#{Mx[:url_c]}/, - "#{@brace_url.tex_open}\\begin{scriptsize}\\email{\\1}#{@brace_url.tex_close}") + "#{url_decoration.tex_open}\\begin{scriptsize}\\email{\\1}#{url_decoration.tex_close}") @dob.tmp=@dob.tmp.gsub(/(^|[^\\])_/m,'\1\_'). #watch may not work gsub(/(^|[^#{Mx[:lnk_c]}])#{Mx[:url_o]}_?(?:\\?_)?(\S+?)#{Mx[:url_c]}/m, - "\\1#{@brace_url.tex_open}\\begin{scriptsize}\\url{\\2}\\end{scriptsize}#{@brace_url.tex_close}") + "\\1#{url_decoration.tex_open}\\begin{scriptsize}\\url{\\2}\\end{scriptsize}#{url_decoration.tex_close}") @dob end def bare_urls_in_code @@ -81,7 +81,7 @@ module SiSU_TeX_Pdf end end class FormatTextObject - require_relative 'defaults' # defaults.rb + include SiSU_Parts_TeXpdf attr_accessor :string,:string1,:orientation,:url,:dir,:tex @@sys=SiSU_Env::SystemCall.new @@tex_pattern_margin_number=/\\begin\{tiny\}\\hspace\{0mm\}\\end\{tiny\}\{\\marginpar.+?\}\}\}/ @@ -102,7 +102,6 @@ module SiSU_TeX_Pdf end @start_table='' @tx=SiSU_Env::GetInit.new.tex - @brace_rel=SiSU_Viz::Defaults.new.rel_decoration @env ||=SiSU_Env::InfoEnv.new(@md.fns) @tex2pdf=@@tex3pdf ||=SiSU_Env::SystemCall.new.tex2pdf_engine @make ||=SiSU_Env::ProcessingSettings.new(@md) @@ -517,7 +516,7 @@ module SiSU_TeX_Pdf link.gsub!(/&/,"#{Xx[:protect]}&") url="#{@env.url.root}/" + url str.sub!(/#{Mx[:lnk_o]}[^#{Mx[:lnk_o]}#{Mx[:lnk_c]}]+#{Mx[:lnk_c]}#{Mx[:rel_o]}:\S+?#{Mx[:rel_c]}/m, - "#{@brace_rel.tex_open}\\href{#{url}}{#{link}}#{@brace_rel.tex_close}") + "#{url_decoration.tex_open}\\href{#{url}}{#{link}}#{url_decoration.tex_close}") end while str =~/#{Mx[:lnk_o]}([^#{Mx[:lnk_o]}#{Mx[:lnk_c]}]+)#{Mx[:lnk_c]}#{Mx[:rel_o]}#?(\S+?)#{Mx[:rel_c]}/m link,url=$1,$2 @@ -533,7 +532,7 @@ module SiSU_TeX_Pdf if ocn_lnk and not ocn_lnk.empty? idx \ ? (str.sub!(rgx_url_internal,"\\hyperlink{#{ocn_lnk}}{#{link}}")) - : (str.sub!(rgx_url_internal,"#{@brace_rel.tex_open}\\hyperlink{#{ocn_lnk}}{#{link}}#{@brace_rel.tex_close}")) + : (str.sub!(rgx_url_internal,"#{url_decoration.tex_open}\\hyperlink{#{ocn_lnk}}{#{link}}#{url_decoration.tex_close}")) else puts %{name tag: "#{url}" not found} str.sub!(rgx_url_internal,"#{link}") @@ -541,7 +540,7 @@ module SiSU_TeX_Pdf #[keep] code that follows uses nametags directly, currently nametags converted to their ocn, related code: |texpdf.rb|@|hypertargets| #idx \ #? (str.sub!(rgx_url_internal,"\\hyperlink{#{url}}{#{link}}")) \ - #: (str.sub!(rgx_url_internal,"#{@brace_rel.tex_open}\\hyperlink{#{url}}{#{link}}#{@brace_rel.tex_close}")) + #: (str.sub!(rgx_url_internal,"#{url_decoration.tex_open}\\hyperlink{#{url}}{#{link}}#{url_decoration.tex_close}")) end str=str.gsub(/#{Xx[:protect]}/,'') end @@ -554,7 +553,7 @@ module SiSU_TeX_Pdf url=url.strip link=z.strip link.gsub!(/&/,"#{Xx[:protect]}&") - str.sub!(rgx_url_generic,"#{@brace_rel.tex_open}\\href{#{url}}{#{link}}#{@brace_rel.tex_close}") + str.sub!(rgx_url_generic,"#{url_decoration.tex_open}\\href{#{url}}{#{link}}#{url_decoration.tex_close}") str=str.gsub(/#{Xx[:protect]}/,'') str else str @@ -578,9 +577,9 @@ module SiSU_TeX_Pdf url=url.strip link=z.strip link.gsub!(/&/,"#{Xx[:protect]}&") - dob.tmp.sub!(rgx_url_generic,"#{@brace_rel.tex_open}\\href{#{url}}{#{link}}#{@brace_rel.tex_close}#{punctuate}") + dob.tmp.sub!(rgx_url_generic,"#{url_decoration.tex_open}\\href{#{url}}{#{link}}#{url_decoration.tex_close}#{punctuate}") dob.tmp.gsub!(/#{Xx[:protect]}/,'') - #dob.tmp=dob.tmp.sub(rgx_url_generic,"#{@brace_rel.tex_open}\\href{#{url}}{#{link}}#{@brace_rel.tex_close}#{punctuate}"). + #dob.tmp=dob.tmp.sub(rgx_url_generic,"#{url_decoration.tex_open}\\href{#{url}}{#{link}}#{url_decoration.tex_close}#{punctuate}"). # gsub(/#{Xx[:protect]}/,'') dob else dob @@ -760,7 +759,6 @@ module SiSU_TeX_Pdf p caller end @tx=SiSU_Env::GetInit.new.tex - @brace_url=SiSU_Viz::Defaults.new.url_decoration @tex2pdf=@@tex3pdf ||=SiSU_Env::SystemCall.new.tex2pdf_engine @ps=@txt if @txt=~/(?:a4|letter|legal|book|a5|b5)/i @lang ||=SiSU_i18n::Languages.new #.list[@md.opt.lng][:xlp] @@ -1236,9 +1234,9 @@ module SiSU_TeX_Pdf end end class SpecialCharacters + include SiSU_Parts_TeXpdf def initialize(md,str,is=:default) @md,@txt,@is=md,str,is - @brace_url=SiSU_Viz::Defaults.new.url_decoration @tex2pdf=@@tex3pdf ||=SiSU_Env::SystemCall.new.tex2pdf_engine end def xetex_code_listings(str,is=:default) # ~ ^ $ & % _ { } #LaTeX special characters - KEEP list @@ -1380,7 +1378,7 @@ module SiSU_TeX_Pdf if is !=:code \ and is !=:no_urls str=str.gsub(/(^|#{Mx[:gl_c]}|\s)((?:https?|file|ftp):\/\/\S+?\.[^'"\s]+?)([;.,]?(?=\s|$))/, - "\\1#{@brace_url.tex_open}\\begin{scriptsize}\\url{\\2}\\end{scriptsize}#{@brace_url.tex_close}\\3") #url matching with decoration positive lookahead, sequence issue with { linked }http://url cannot use \b at start + "\\1#{url_decoration.tex_open}\\begin{scriptsize}\\url{\\2}\\end{scriptsize}#{url_decoration.tex_close}\\3") #url matching with decoration positive lookahead, sequence issue with { linked }http://url cannot use \b at start end str=str.gsub(/<:ee>/,''). gsub(//,' '). #proposed change, insert, but may be redundant @@ -1487,13 +1485,12 @@ module SiSU_TeX_Pdf end end class UseTeX + include SiSU_Parts_TeXpdf attr_accessor :url,:txt,:date def initialize(md) @md=md - @vz=SiSU_Viz::Defaults.new @date=SiSU_Env::InfoDate.new # #{@date.year} @copymark='{\\begin{footnotesize}\\raisebox{1ex}{\\copyright}\\end{footnotesize}}' - @brace_url=SiSU_Viz::Defaults.new.url_decoration end def skip "\n\\vspace*{\\smallskipamount} \n" @@ -1532,15 +1529,12 @@ module SiSU_TeX_Pdf "\\rfoot[\\tiny \\href{}{}]{\\textrm{\\thepage}}\n" end def site - if not @vz.url_home.empty? \ - and not @vz.url_txt.empty? + if not the_url.home.empty? \ + and not the_url.home_txt.empty? "\n\\date{\\begin{tiny} \\end{tiny}}" else '' end end - def sitename # owners site, eg freeculture, free.for.all, gutenberg etc. - "\\href{#{@vz.url_home}}{#{@vz.txt_home}}" - end def owner_chapter "Contact Details for Original Promulgating Authority" end @@ -1572,7 +1566,7 @@ module SiSU_TeX_Pdf \\\\ Generated by \\href{http://www.jus.uio.no/sisu}{SiSU} \\begin{tiny}[ #{v[:project]} #{v[:version]} of #{v[:date_stamp]} ]\\end{tiny} \\href{http://www.jus.uio.no/sisu}{www.jus.uio.no/sisu} \\\\ Copyright #{@copymark} 1997, current #{@date.year_static} Ralph Amissah, All Rights Reserved. \\\\ SiSU is software for document structuring, publishing and search (with object citation numbering), \\href{http://www.sisudoc.org}{www.sisudoc.org} -\\\\ SiSU is released under \\href{http://www.fsf.org/licenses/gpl.html}{GPL 3 } or later, #{@brace_url.tex_open}\\href{http://www.fsf.org/licenses/gpl.html}{http://www.fsf.org/licenses/gpl.html}#{@brace_url.tex_close}. +\\\\ SiSU is released under \\href{http://www.fsf.org/licenses/gpl.html}{GPL 3 } or later, #{url_brace.tex_open}\\href{http://www.fsf.org/licenses/gpl.html}{http://www.fsf.org/licenses/gpl.html}#{url_brace.tex_close}. {\\end{footnotesize} \\\\ WOK @@ -1618,64 +1612,6 @@ Generated by \\href{http://www.jus.uio.no/sisu}{SiSU www.jus.uio.no/sisu } \\\\ \\listofendnotes WOK end - def doc_tail - dir=SiSU_Env::InfoEnv.new(@md.fns) - v=SiSU_Env::InfoVersion.instance.get_version - sisu_ico=if FileTest.file?("#{dir.path.image_source_include}/sisu.png") - "\\includegraphics*[width=60pt]{#{dir.path.image_source_include}/sisu.png}" - else - SiSU_Screen::Ansi.new( - @md.opt.act[:color_state][:set], - 'WARNING - image directory or image(s) missing:', - %{"#{dir.path.image_source_include}"} - ).warn unless @md.opt.act[:quiet][:set]==:on - " SiSU " - end - url=@md.fnb.gsub(/(?:\\)*([$&~%_#}{^])/,'\\\\\1') - <<-WOK -\\begin{english}[variant=british] -\\subsection*{Information on this document copy and an unofficial List of Some web related information and sources} -\\addcontentsline{toc}{section}{Information on this document copy and an unofficial List of Some web related information and sources} -\\\\ -\"Support Open Standards and Software Libré for the Information Technology Infrastructure\" RA\\subsubsection*{Information on this document copy #{site}} -\\addcontentsline{toc}{subsection}{Information on this document copy} -{\\begin{footnotesize} -\\\\ Generated by \\href{http://www.jus.uio.no/sisu/}{SiSU} found at \\href{http://www.jus.uio.no/sisu/}{www.jus.uio.no/sisu} \\begin{tiny}[ #{v[:project]} #{v[:version]} #{v[:date_stamp]} ]\\end{tiny} \\href{http://www.sisudoc.org}{www.sisudoc.org}. SiSU is software for document structuring, publishing and search (using SiSU: object citation numbering, markup, meta-markup, and system) Copyright #{@copymark} 1997, current #{@date.year_static} Ralph Amissah, All Rights Reserved. -\\\\ SiSU is released under \\href{http://www.fsf.org/licenses/gpl.html}{GPL 3 } or later (\\href{http://www.fsf.org/licenses/gpl.html}{www.fsf.org/licenses/gpl.html}). {\\end{footnotesize} -{\\begin{small} -\\\\ W3 since October 3 1993 \\href{http://www.jus.uio.no/sisu/}{#{sisu_ico}}SiSU 1997, current #{@date.year_static}. \\\\ #{sitename} presentations at \\begin{scriptsize}#{site}\\end{scriptsize} \\\\ \\\\ #{@md.title.full} \\textbf{pdf} versions can be found at: \\\\ -{\\end{small} -\\\\ #{@brace_url.tex_open}\\begin{scriptsize}\\url{#{@vz.url_root_http}/#{url}/#{@md.fn[:pdf_p]}}\\end{scriptsize}#{@brace_url.tex_close} \\\\ -#{@brace_url.tex_open}\\begin{scriptsize}\\url{#{@vz.url_root_http}/#{url}/#{@md.fn[:pdf_l]}}\\end{scriptsize}#{@brace_url.tex_close} \\\\ -\\\\\n#{@md.title.full} \\textbf{html} versions may be found at: \\\\ -#{@brace_url.tex_open}\\begin{scriptsize}\\url{#{@vz.url_root_http}/#{url}/#{@md.fn[:toc]}}\\end{scriptsize}#{@brace_url.tex_close} or \\\\ -#{@brace_url.tex_open}\\begin{scriptsize}\\url{#{@vz.url_root_http}/#{url}/#{@md.fn[:doc]}}\\end{scriptsize}#{@brace_url.tex_close} -\\\\ -\\\\ -\\href{#{@vz.url_root_http}/#{url}/#{@md.fn[:manifest]}}{SiSU Manifest} of document output and metadata may be found at: \\\\ -#{@brace_url.tex_open}\\begin{scriptsize}\\url{#{@vz.url_root_http}/#{url}/#{@md.fn[:manifest]}}\\end{scriptsize}#{@brace_url.tex_close} -\\\\ -\\\\ - #{sitename} found at: \\begin{scriptsize}#{site}\\end{scriptsize}\\subsubsection*{Links that may be of interest at #{@vz.txt_home} and elsewhere:} -\\addcontentsline{toc}{subsection}{Links that may be of interest} -\\end{english} - WOK - end - def mail_tail #not retested, the old mail_tail is commented out and appended to this program - dir=SiSU_Env::InfoEnv.new(@md.fns) - <<-WOK -\\subsection*{Mail sender details} -\\addcontentsline{toc}{subsection}{Mail sender details} -\\\\ -Mail from: ralph@amissah.com\\\\ -44 20 8789 3452\\\\ -44 77 9669 4448 -\\\\ - \"Support Open Standards and Open Sources for the Information Technology Infrastructure\" RA -\\subsubsection*{Information on this document copy #{site}\\copyright} -Presentations' look and feel generated by \\href{http://www.jus.uio.no/sisu/}{SiSU Scribe} \\href{http://www.jus.uio.no/sisu/}{http://www.jus.uio.no/sisu/} programmed in Ruby on Debian/Gnu/Linux by Copyright \\copyright Ralph Amissah, W3 since October 3 1993 \\href{http://www.jus.uio.no/sisu/}{\\includegraphics*[width=35pt]{#{dir.path.image_source_include}/sisu.png}}for #{sitename}. SiSU Scribe (sisu information structuring unit) produces Electronic Documents, i.e. it generates structured output for use in a number of file formats, including the pdf file produced here. - WOK - end end end __END__ diff --git a/lib/sisu/v5/texpdf_parts.rb b/lib/sisu/v5/texpdf_parts.rb new file mode 100644 index 00000000..d5daf004 --- /dev/null +++ b/lib/sisu/v5/texpdf_parts.rb @@ -0,0 +1,238 @@ +# encoding: utf-8 +=begin + + * Name: SiSU + + * Description: a framework for document structuring, publishing and search + + * Author: Ralph Amissah + + * Copyright: (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, + 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 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: + + + + * Git + + + + * Ralph Amissah + + + + ** Description: shared html parts + +=end +module SiSU_Parts_TeXpdf + require_relative 'generic_parts' # generic_parts.rb + include SiSU_Parts_Generic + def the_line_break + ' \\ ' + end + def url_decoration + def tex_open #'{\UseTextSymbol{OML}{<}}' + Dx[:url_o] + end + def tex_close #'{\UseTextSymbol{OML}{>}}' + Dx[:url_c] + end + def txt_open + '<' + end + def txt_close + '>' + end + self + end + def the_font + def set_fonts + 'verdana, arial, georgia, tahoma, sans-serif, helvetica, times, roman' + end + self + end + class TeX + def initialize(papersize='') + @papersize=papersize + end + def a4 + def portrait + def w + 160 + end + def h + 228 + end + def img_px + 450 + end + self + end + def landscape + def w + 238 + end + def h + 160 + end + def img_px + 300 + end + self + end + self + end + def letter + def portrait + def w + 166 + end + def h + 212 + end + def img_px + 468 + end + self + end + def landscape + def w + 226 + end + def h + 166 + end + def img_px + 290 + end + self + end + self + end + def legal + def portrait + def w + 168 + end + def h + 286 + end + def img_px + 474 + end + self + end + def landscape + def w + 296 + end + def h + 166 + end + def img_px + 420 + end + self + end + self + end + def b5 + def portrait + def w + 140 + end + def h + 204 + end + def img_px + 356 + end + self + end + def landscape + def w + 200 + end + def h + 130 + end + def img_px + 260 + end + self + end + self + end + def a5 + def portrait + def w + 112 + end + def h + 162 + end + def img_px + 280 + end + self + end + def landscape + def w + 152 + end + def h + 100 + end + def img_px + 190 + end + self + end + self + end + def dimensions + case @papersize + when /a4/ then a4 + when /letter/ then letter + when /legal/ then legal + when /b5/ then b5 + when /a5/ then a5 + else a4 + end + end + end +end +__END__ diff --git a/lib/sisu/v5/txt_asciidoc.rb b/lib/sisu/v5/txt_asciidoc.rb index 89deca87..3545fcb0 100644 --- a/lib/sisu/v5/txt_asciidoc.rb +++ b/lib/sisu/v5/txt_asciidoc.rb @@ -62,9 +62,9 @@ module SiSU_Txt_AsciiDoc require_relative 'se' # se.rb include SiSU_Env require_relative 'shared_metadata' # shared_metadata.rb + require_relative 'generic_parts' # generic_parts.rb require_relative 'txt_shared' # txt_shared.rb include SiSU_Param - include SiSU_Viz @@alt_id_count,@@alt_id_count,@@tablehead,@@number_of_cols=0,0,0,0 @@tablefoot='' class Source @@ -126,14 +126,12 @@ module SiSU_Txt_AsciiDoc end private class Scroll ]'). gsub(/#{Mx[:lnk_o]}(.+?)#{Mx[:lnk_c]}image/,'\1 [link: local image]'). - gsub(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,"#{@brace_url.txt_open}\\1#{@brace_url.txt_close}") + gsub(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,"#{the_text.url_open}\\1#{the_text.url_close}") dob.obj=dob.obj.gsub(/\s*#{Mx[:en_a_o]}([\d*+]+)\s+(.+?)#{Mx[:en_a_c]}/,' footnote:[note\1,\2]'). gsub(/\s*#{Mx[:en_b_o]}([\d*+]+\s+.+?)#{Mx[:en_b_c]}/,' footnote:[\1]') dob.obj=dob.obj.gsub(/#{Mx[:en_a_o]}([\d*+]+)\s+(?:.+?)#{Mx[:en_a_c]}/,'[^\1]'). # endnote marker marked up diff --git a/lib/sisu/v5/txt_markdown.rb b/lib/sisu/v5/txt_markdown.rb index 440956be..9bbd85e4 100644 --- a/lib/sisu/v5/txt_markdown.rb +++ b/lib/sisu/v5/txt_markdown.rb @@ -62,9 +62,9 @@ module SiSU_Txt_Markdown require_relative 'se' # se.rb include SiSU_Env require_relative 'shared_metadata' # shared_metadata.rb + require_relative 'generic_parts' # generic_parts.rb require_relative 'txt_shared' # txt_shared.rb include SiSU_Param - include SiSU_Viz @@alt_id_count,@@alt_id_count,@@tablehead,@@number_of_cols=0,0,0,0 @@tablefoot='' class Source @@ -125,14 +125,12 @@ module SiSU_Txt_Markdown end private class Scroll ]'). gsub(/#{Mx[:lnk_o]}(.+?)#{Mx[:lnk_c]}image/,'\1 [link: local image]'). - gsub(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,"#{@brace_url.txt_open}\\1#{@brace_url.txt_close}") + gsub(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,"#{the_text.url_open}\\1#{the_text.url_close}") extract_endnotes(dob) dob.obj=dob.obj.gsub(/#{Mx[:en_a_o]}([\d*+]+)\s+(?:.+?)#{Mx[:en_a_c]}/,'[^\1]'). # endnote marker marked up gsub(/#{Mx[:en_b_o]}([\d*+]+)\s+(?:.+?)#{Mx[:en_b_c]}/,'[^\1]'). # endnote marker marked up diff --git a/lib/sisu/v5/txt_plain.rb b/lib/sisu/v5/txt_plain.rb index 6233038f..08f32b2f 100644 --- a/lib/sisu/v5/txt_plain.rb +++ b/lib/sisu/v5/txt_plain.rb @@ -63,9 +63,9 @@ module SiSU_Txt_Plain require_relative 'se' # se.rb include SiSU_Env require_relative 'shared_metadata' # shared_metadata.rb + require_relative 'generic_parts' # generic_parts.rb require_relative 'txt_shared' # txt_shared.rb include SiSU_Param - include SiSU_Viz @@alt_id_count,@@alt_id_count,@@tablehead,@@number_of_cols=0,0,0,0 @@tablefoot='' class Source @@ -127,14 +127,12 @@ module SiSU_Txt_Plain end private class Scroll ]'). gsub(/#{Mx[:lnk_o]}(.+?)#{Mx[:lnk_c]}image/,'\1 [link: local image]'). - gsub(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,"#{@brace_url.txt_open}\\1#{@brace_url.txt_close}") + gsub(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,"#{the_text.url_open}\\1#{the_text.url_close}") extract_endnotes(dob) dob.obj=dob.obj.gsub(/#{Mx[:en_a_o]}([\d*+]+)\s+(?:.+?)#{Mx[:en_a_c]}/,'[^\1]'). # endnote marker marked up gsub(/#{Mx[:en_b_o]}([\d*+]+)\s+(?:.+?)#{Mx[:en_b_c]}/,'[^\1]'). # endnote marker marked up diff --git a/lib/sisu/v5/txt_rst.rb b/lib/sisu/v5/txt_rst.rb index 1426f4b3..297a2457 100644 --- a/lib/sisu/v5/txt_rst.rb +++ b/lib/sisu/v5/txt_rst.rb @@ -62,9 +62,9 @@ module SiSU_Txt_rST require_relative 'se' # se.rb include SiSU_Env require_relative 'shared_metadata' # shared_metadata.rb + require_relative 'generic_parts' # generic_parts.rb require_relative 'txt_shared' # txt_shared.rb include SiSU_Param - include SiSU_Viz @@alt_id_count,@@alt_id_count,@@tablehead,@@number_of_cols=0,0,0,0 @@tablefoot='' class Source @@ -126,14 +126,12 @@ module SiSU_Txt_rST end private class Scroll ]'). gsub(/#{Mx[:lnk_o]}(.+?)#{Mx[:lnk_c]}image/,'\1 [link: local image]'). - gsub(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,"#{@brace_url.txt_open}\\1#{@brace_url.txt_close}") + gsub(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,"#{the_text.url_open}\\1#{the_text.url_close}") extract_endnotes(dob) dob.obj=dob.obj.gsub(/#{Mx[:en_a_o]}([\d*+]+)\s+(?:.+?)#{Mx[:en_a_c]}/,'[^\1]'). # endnote marker marked up gsub(/#{Mx[:en_b_o]}([\d*+]+)\s+(?:.+?)#{Mx[:en_b_c]}/,'[^\1]'). # endnote marker marked up diff --git a/lib/sisu/v5/txt_shared.rb b/lib/sisu/v5/txt_shared.rb index faf4c9c6..30f54f5a 100644 --- a/lib/sisu/v5/txt_shared.rb +++ b/lib/sisu/v5/txt_shared.rb @@ -58,6 +58,7 @@ =end module SiSU_TextUtils + require_relative 'generic_parts' # generic_parts.rb class Wrap def initialize(para='',n_char_max=76,n_indent=0,n_hang=nil,post='') @para,@n_char_max,@n_indent,@post,=para,n_char_max,n_indent,post diff --git a/lib/sisu/v5/txt_textile.rb b/lib/sisu/v5/txt_textile.rb index cc4bf167..71268d96 100644 --- a/lib/sisu/v5/txt_textile.rb +++ b/lib/sisu/v5/txt_textile.rb @@ -62,12 +62,13 @@ module SiSU_Txt_Textile require_relative 'se' # se.rb include SiSU_Env require_relative 'shared_metadata' # shared_metadata.rb + require_relative 'generic_parts' # generic_parts.rb require_relative 'txt_shared' # txt_shared.rb include SiSU_Param - include SiSU_Viz @@alt_id_count,@@alt_id_count,@@tablehead,@@number_of_cols=0,0,0,0 @@tablefoot='' class Source + include SiSU_Parts_Generic def initialize(opt) @opt=opt unless @opt.fns =~/(.+?)\.(?:-|ssm\.)?sst$/ @@ -126,14 +127,12 @@ module SiSU_Txt_Textile end private class Scroll ]'). gsub(/#{Mx[:lnk_o]}(.+?)#{Mx[:lnk_c]}image/,'\1 [link: local image]'). - gsub(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,"#{@brace_url.txt_open}\\1#{@brace_url.txt_close}") + gsub(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,"#{the_text.url_open}\\1#{the_text.url_close}") extract_endnotes(dob) dob.obj=dob.obj.gsub(/#{Mx[:en_a_o]}([\d*+]+)\s+(?:.+?)#{Mx[:en_a_c]}/,'[^\1]'). # endnote marker marked up gsub(/#{Mx[:en_b_o]}([\d*+]+)\s+(?:.+?)#{Mx[:en_b_c]}/,'[^\1]'). # endnote marker marked up diff --git a/lib/sisu/v5/wikispeak.rb b/lib/sisu/v5/wikispeak.rb index 192e1cb7..c8bf1d53 100644 --- a/lib/sisu/v5/wikispeak.rb +++ b/lib/sisu/v5/wikispeak.rb @@ -62,9 +62,9 @@ module SiSU_Wikispeak require_relative 'se' # se.rb include SiSU_Env include SiSU_Param - include SiSU_Viz require_relative 'plaintext_format' # plaintext_format.rb include Format + require_relative 'html_parts' # html_parts.rb require_relative 'txt_shared' @@alt_id_count,@@alt_id_count,@@tablehead,@@number_of_cols=0,0,0,0 @@tablefoot='' @@ -109,7 +109,6 @@ module SiSU_Wikispeak class SplitTextObject / diff --git a/lib/sisu/v5/xhtml.rb b/lib/sisu/v5/xhtml.rb index 914648d9..2327ba30 100644 --- a/lib/sisu/v5/xhtml.rb +++ b/lib/sisu/v5/xhtml.rb @@ -58,8 +58,6 @@ ** Notes: tidy -xml scroll.xhtml >> index.tidy =end module SiSU_XHTML - require_relative 'defaults' # defaults.rb - include SiSU_Viz require_relative 'se_hub_particulars' # se_hub_particulars.rb include SiSU_Particulars require_relative 'se' # se.rb @@ -152,7 +150,6 @@ module SiSU_XHTML @@xml={ body: [], sisu: [], open: [], close: [], head: [] } def initialize(particulars) @env,@md,@ao_array=particulars.env,particulars.md,particulars.ao_array - @vz=SiSU_Viz::Defaults.new @tab="\t" @trans=SiSU_XML_Munge::Trans.new(@md) @sys=SiSU_Env::SystemCall.new @@ -369,8 +366,6 @@ WOK format_text.scr_inden_ocn_e_no_paranum end end - if dob.obj !~/#{@vz.margin_txt_0}|#{@vz.margin_txt_1}|#{@vz.margin_txt_2}/ - end else # end dob.obj=dob.obj.gsub(/#{Mx[:pa_o]}:\S+#{Mx[:pa_c]}/,'') if dob.obj diff --git a/lib/sisu/v5/xhtml_epub2.rb b/lib/sisu/v5/xhtml_epub2.rb index 794c9024..ceed3239 100644 --- a/lib/sisu/v5/xhtml_epub2.rb +++ b/lib/sisu/v5/xhtml_epub2.rb @@ -66,8 +66,6 @@ module SiSU_XHTML_EPUB2 end require_relative 'se_hub_particulars' # se_hub_particulars.rb include SiSU_Particulars - require_relative 'defaults' # defaults.rb - include SiSU_Viz require_relative 'xml_shared' # xml_shared.rb include SiSU_XML_Munge require_relative 'xhtml_table' # xhtml_table.rb @@ -161,7 +159,6 @@ module SiSU_XHTML_EPUB2 def initialize(particulars) @particulars=particulars @md,@env=particulars.md,particulars.env - @vz=SiSU_Viz::Defaults.new @env,@css=particulars.env,SiSU_Style::CSS.new end def directories @@ -213,7 +210,6 @@ module SiSU_XHTML_EPUB2 @@firstseg=nil def initialize(md=nil,data='') @md,@data=md,data - @vz=SiSU_Viz::Defaults.new @epub=SiSU_XHTML_EPUB2_Format::HeadInformation.new(@md) @tell=SiSU_Screen::Ansi.new(@md.opt.act[:color_state][:set]) if @md @make=SiSU_Env::ProcessingSettings.new(@md) @@ -645,7 +641,6 @@ module SiSU_XHTML_EPUB2 class ScrollHeadAndSegToc < Toc def initialize(md='',toc='',links_guide_toc='') @md,@toc,@links_guide_toc=md,toc,links_guide_toc - @vz=SiSU_Viz::Defaults.new end def in_common toc_shared=[] diff --git a/lib/sisu/v5/xhtml_epub2_concordance.rb b/lib/sisu/v5/xhtml_epub2_concordance.rb index 3484b1d8..02f47d5a 100644 --- a/lib/sisu/v5/xhtml_epub2_concordance.rb +++ b/lib/sisu/v5/xhtml_epub2_concordance.rb @@ -63,8 +63,7 @@ module SiSU_XHTML_EPUB2_Concordance include SiSU_Particulars require_relative 'se' # se.rb include SiSU_Env - require_relative 'defaults' # defaults.rb - include SiSU_Viz + require_relative 'xhtml_parts' # xhtml_parts.rb require_relative 'xhtml_epub2_format' # xhtml_epub2_format.rb include SiSU_XHTML_EPUB2_Format class Source @@ -101,13 +100,11 @@ module SiSU_XHTML_EPUB2_Concordance end private class DocTitle - include SiSU_Viz #revisit, both requires (html & xml_shared) needed for stand alone operation (sisu -w [filename]) require_relative 'xhtml_epub2' # xhtml_epub2.rb def initialize(particulars) @particulars,@md=particulars,particulars.md @data=SiSU_XHTML_EPUB2::Source::XHTML_Environment.new(particulars).tuned_file_instructions - @vz=SiSU_Viz::Defaults.new @fnb=@md.fnb @lex_button=%{
SiSU home} @doc_details =<>#{credits}\n} # footer end end diff --git a/lib/sisu/v5/xhtml_epub2_format.rb b/lib/sisu/v5/xhtml_epub2_format.rb index 4004a446..bbd02a6d 100644 --- a/lib/sisu/v5/xhtml_epub2_format.rb +++ b/lib/sisu/v5/xhtml_epub2_format.rb @@ -58,7 +58,6 @@ =end module SiSU_XHTML_EPUB2_Format - include SiSU_Viz class ParagraphNumber def initialize(md,ocn) @md,@ocn=md,ocn.to_s @@ -1235,6 +1234,7 @@ module SiSU_XHTML_EPUB2_Format end end module SanitizeXML + require_relative 'xhtml_parts' # xhtml_parts.rb def self.xml(x) if x.is_a?(String) x=x.gsub(/ /,' ') if Ep[:alt]==:on @@ -1249,12 +1249,10 @@ module SiSU_XHTML_EPUB2_Format end end class HeadInformation - include SiSU_Viz - attr_reader :md,:rdf,:vz + attr_reader :md,:rdf def initialize(md) @md=md # DublinCore 1 - title - @vz=SiSU_Viz::Defaults.new @css=SiSU_Env::CSS_Stylesheet.new(md) @seg_name_xhtml=(SiSU_XHTML_EPUB2::Source::Seg.new.seg_name_xhtml || []) @seg_name_xhtml_tracker=(SiSU_XHTML_EPUB2::Source::Seg.new.seg_name_xhtml_tracker || []) @@ -1722,15 +1720,16 @@ output_epub_cont_seg.close end def table_close %{ -#{@vz.table_close}} +#{the_table_close}} end def xhtml_close - %{#{@vz.credits_sisu_epub} + %{#{SiSU_Proj_XHTML::Bits.new.credits_sisu_epub} } end end class HeadToc < HeadInformation + include SiSU_Parts_XHTML def initialize(md) super(md) @md=md @@ -1757,16 +1756,16 @@ output_epub_cont_seg.close end def concordance if @md.concord_make - %{#{@vz.margin_css} + %{#{the_margin.css}

Concordance

-#{@vz.table_close}} +#{the_table_close}} else - %{#{@vz.margin_css} -#{@vz.table_close}} + %{#{the_margin.css} +#{the_table_close}} end end def links_guide_open(type='horizontal') @@ -1787,40 +1786,40 @@ output_epub_cont_seg.close %{

Prefix: #{@md.prefix_b}} end def make_seg - concord=concordance_link(@vz.nav_txt_concordance) + concord=concordance_link(the_nav.txt_concordance) %{ +
- #{@vz.nav_txt_toc_link} + #{the_nav.txt_toc_link} #{concord} -#{@vz.table_close}} +#{the_table_close}} end def manifest #check structure - manifest=manifest_link(@vz.nav_txt_manifest) - %{#{@vz.margin_txt_3} - #{@vz.paragraph_font_small} + manifest=manifest_link(the_nav.txt_manifest) + %{#{the_margin.txt_3} + #{the_font.paragraph_font_small} #{manifest} -#{@vz.table_close}} +#{the_table_close}} end def concordance #check structure - concord=concordance_link(@vz.nav_txt_concordance) - %{#{@vz.margin_txt_3} - #{@vz.paragraph_font_small} + concord=concordance_link(the_nav.txt_concordance) + %{#{the_margin.txt_3} + #{the_font.paragraph_font_small} #{concord} -#{@vz.table_close}} +#{the_table_close}} end def metadata - %{#{@vz.margin_css} + %{#{the_margin.css}

MetaData

-#{@vz.table_close}} +#{the_table_close}} end end class HeadSeg < HeadInformation @@ -1850,8 +1849,8 @@ output_epub_cont_seg.close super(md) end def toc_owner_details - %{#{@vz.margin_txt_3} -#{@vz.paragraph_font_small} + %{#{the_margin.txt_3} +#{the_font.paragraph_font_small} Owner Details @@ -1859,11 +1858,11 @@ output_epub_cont_seg.close -#{@vz.table_close}} +#{the_table_close}} end end class FormatTextObject - @vz=SiSU_Viz::Defaults.new + include SiSU_Parts_XHTML attr_accessor :md,:t_o,:txt,:ocn,:format,:table,:link,:linkname,:paranum,:p_num,:headname,:banner,:url def initialize(md,t_o) @md,@t_o=md,t_o @@ -1907,7 +1906,6 @@ output_epub_cont_seg.close @txt=@txt.gsub(/#{Mx[:mk_o]}[-~]##{Mx[:mk_c]}/,'') end @p_num=ParagraphNumber.new(@md,@ocn) - @vz=SiSU_Viz::Defaults.new end def nametags_seg(dob) #FIX tags='' @@ -2084,13 +2082,13 @@ output_epub_cont_seg.close end end def bold_para - %{#{@vz.margin_txt_0} + %{#{the_margin.txt_0}

#{@txt}

-#{@vz.margin_num_css} +#{the_margin.num_css} #{$ep[:hsp]*3} -#{@vz.table_close}} +#{the_table_close}} end def bold_heading #unused @txt=@txt.gsub(/[1-9]~\S+/,''). @@ -2098,9 +2096,9 @@ output_epub_cont_seg.close %{

#{@txt}

-#{@vz.margin_num_css} +#{the_margin.num_css} #{$ep[:hsp]*3} -#{@vz.table_close}} +#{the_table_close}} end def toc_head_copy_at @txt=SanitizeXML.xml(@txt) @@ -2122,7 +2120,6 @@ output_epub_cont_seg.close class FormatScroll < FormatTextObject def initialize(md,txt) super(md,txt) - @vz=SiSU_Viz::Defaults.new end end class FormatSeg < FormatTextObject @@ -2206,7 +2203,7 @@ output_epub_cont_seg.close

#{@txt}

-#{@vz.table_close}} +#{the_table_close}} end def navigation_heading5 %{

diff --git a/lib/sisu/v5/xhtml_epub2_segments.rb b/lib/sisu/v5/xhtml_epub2_segments.rb index 1abc2d1b..ea3e27fa 100644 --- a/lib/sisu/v5/xhtml_epub2_segments.rb +++ b/lib/sisu/v5/xhtml_epub2_segments.rb @@ -131,7 +131,6 @@ WOK attr_reader :seg_name_xhtml,:seg_name_xhtml_tracker def initialize(md='',data='') @md,@data=md,data - @vz=SiSU_Viz::Defaults.new @seg_name_xhtml=@@seg_name_xhtml || nil @seg_name_xhtml_tracker=@@tracker || nil @make=SiSU_Env::ProcessingSettings.new(@md) if @md diff --git a/lib/sisu/v5/xhtml_epub2_tune.rb b/lib/sisu/v5/xhtml_epub2_tune.rb index 7376212a..b4142e2e 100644 --- a/lib/sisu/v5/xhtml_epub2_tune.rb +++ b/lib/sisu/v5/xhtml_epub2_tune.rb @@ -61,6 +61,7 @@ require_relative 'dp' # dp.rb module SiSU_XHTML_EPUB2_Tune require_relative 'se' # se.rb include SiSU_Env; include SiSU_Screen + require_relative 'xhtml_parts' # xhtml_parts.rb require_relative 'xhtml_epub2_format' # xhtml_epub2_format.rb #watch @@line_mode='' @@endnote_array=[] @@ -109,12 +110,11 @@ module SiSU_XHTML_EPUB2_Tune end end class Tune + include SiSU_Parts_XHTML def initialize(data,md) @data,@md=data,md - @vz=SiSU_Viz::Defaults.new @sys=SiSU_Env::SystemCall.new @env=SiSU_Env::InfoEnv.new(@md.fns) - @brace_url=SiSU_Viz::Defaults.new.url_decoration end def songsheet begin @@ -261,18 +261,18 @@ module SiSU_XHTML_EPUB2_Tune dob.obj.gsub(/\<:ad\s+(\S+)?\s+(\S+\.png)\s+(.+)?\;\s+(.+)?\;\s*\>/, %{\n

\\3
\n}) end - dob.obj=dob.obj.gsub(/!pick/,%{stellar}). - gsub(/!new/,%{#{$ep[:hsp]}new}). + dob.obj=dob.obj.gsub(/!pick/,%{stellar}). + gsub(/!new/,%{#{$ep[:hsp]}new}). gsub(/<:h(.{1,7}?)>/,'\1'). gsub(/<:to(\d{1,7}?)>/,%{to#{$ep[:hsp]}\{#{$ep[:hsp]}\\1#{$ep[:hsp]}\} }). gsub(/#{Mx[:url_o]}_(\S+?)#{Mx[:url_c]}/,'\1'). #http ftp matches escaped, no decoration - gsub(/#{Mx[:url_o]}([a-zA-Z0-9._-]+\@\S+?\.[a-zA-Z0-9._-]+)#{Mx[:url_c]}/,%{#{@brace_url.xml_open}\\1#{@brace_url.xml_close}}). - gsub(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,%{#{@brace_url.xml_open}\\1#{@brace_url.xml_close}}) #http ftp matches with decoration + gsub(/#{Mx[:url_o]}([a-zA-Z0-9._-]+\@\S+?\.[a-zA-Z0-9._-]+)#{Mx[:url_c]}/,%{#{the_url_decoration.xml_open}\\1#{the_url_decoration.xml_close}}). + gsub(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,%{#{the_url_decoration.xml_open}\\1#{the_url_decoration.xml_close}}) #http ftp matches with decoration if dob.obj =~/..\/\S+/ \ and dob.obj !~/(\"..\/\S+?\"|>\s*..\/\S+<)/ dob.obj=dob.obj.gsub(/(\.\.\/\S+)/,'\1') end - dob.obj=dob.obj.gsub(//m,'>') end diff --git a/lib/sisu/v5/xhtml_parts.rb b/lib/sisu/v5/xhtml_parts.rb new file mode 100644 index 00000000..7ae6cfc1 --- /dev/null +++ b/lib/sisu/v5/xhtml_parts.rb @@ -0,0 +1,186 @@ +# encoding: utf-8 +=begin + + * Name: SiSU + + * Description: a framework for document structuring, publishing and search + + * Author: Ralph Amissah + + * Copyright: (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, + 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 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: + + + + * Git + + + + * Ralph Amissah + + + + ** Description: shared html parts + +=end +module SiSU_Parts_XHTML + require_relative 'generic_parts' # generic_parts.rb + include SiSU_Parts_Generic + def the_line_break + '
' + end + def the_table_close + '
' + end + def the_url + def home + 'http://www.sisudoc.org/' # used in pdf header + end + def site #used as stub... where there are subdirectories and is different from home + home + end + self + end + def the_url_decoration + 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_margin + def txt_0 + %{ +
+} + end + def txt_1 + %{ +
} + end + def txt_2 + %{ + +
+} + end + def txt_3 + %{ + +
+} + end + def css + ' + +} else %{} end diff --git a/lib/sisu/v5/xml_dom.rb b/lib/sisu/v5/xml_dom.rb index 215b6d61..58fd4b64 100644 --- a/lib/sisu/v5/xml_dom.rb +++ b/lib/sisu/v5/xml_dom.rb @@ -58,8 +58,6 @@ ** Notes: tidy -xml dom.xml >> index.tidy =end module SiSU_XML_DOM - require_relative 'defaults' # defaults.rb - include SiSU_Viz require_relative 'se_hub_particulars' # se_hub_particulars.rb include SiSU_Particulars require_relative 'se' # se.rb @@ -167,7 +165,6 @@ module SiSU_XML_DOM def initialize(particulars) @env, @md, @ao_arr= particulars.env,particulars.md,particulars.ao_array - @vz=SiSU_Viz::Defaults.new @trans=SiSU_XML_Munge::Trans.new(@md) @sys=SiSU_Env::SystemCall.new end @@ -519,8 +516,6 @@ WOK format_text.scr_inden_ocn_e_no_paranum end end - if dob.obj !~/#{@vz.margin_txt_0}|#{@vz.margin_txt_1}|#{@vz.margin_txt_2}/ - end else # end dob.obj=dob.obj.gsub(/#{Mx[:pa_o]}:\S+#{Mx[:pa_c]}/,'') if dob.obj diff --git a/lib/sisu/v5/xml_format.rb b/lib/sisu/v5/xml_format.rb index 7959696c..0b319683 100644 --- a/lib/sisu/v5/xml_format.rb +++ b/lib/sisu/v5/xml_format.rb @@ -60,8 +60,8 @@ =end module SiSU_XML_Format require_relative 'dp' # dp.rb - include SiSU_Param - include SiSU_Viz + require_relative 'xml_parts' # xml_parts.rb + include SiSU_Param class ParagraphNumber def initialize(md,paranum) @md=md @@ -86,6 +86,7 @@ module SiSU_XML_Format end end class HeadInformation + include SiSU_Parts_XML def initialize #dc rdf @full_title=@subtitle=@author=@subject=@description=@publisher=@contributor=@date=@type=@format=@identifier=@source=@language=@relation=@coverage=@rights=@copyright=@owner=@keywords='' @md=@@md @@ -197,7 +198,6 @@ module SiSU_XML_Format if @md.rights.copyright.all # possibly redundant see dc.rights @owner=%{\n} if @md.owner @keywords=%{\n} if @md.keywords - @vz=SiSU_Viz::Defaults.new #margin,paragraph,table,banner,url,png,txt,color,font,nav_txt,nav_png,credits,js,php @index='index' end def meta_content_clean(content='') @@ -279,6 +279,7 @@ WOK end end class FormatTextObject + include SiSU_Parts_XML attr_accessor :md,:txt,:format,:paranum,:p_num,:para_id,:headname,:font def initialize(md,dob) @md,@dob=md,dob @@ -292,7 +293,6 @@ WOK @lnk_url=@lnk_url.gsub(rgx,'') if @lnk_url =~rgx rgx=/~\{\d+\s+(.+?)\}~/ @lnk_url=@lnk_url.gsub(rgx,'\1') if @lnk_url =~rgx - @vz=SiSU_Viz::Defaults.new end def scr_endnote_body "#{@txt} " @@ -368,13 +368,12 @@ WOK end end class HeadInformation - include SiSU_Viz + include SiSU_Parts_XML attr_reader :md,:sfx,:pdf,:rdf,:vz def initialize(md) @md=md @rdf=SiSU_XML_Tags::RDF.new(md) # DublinCore 1 - title - @vz=SiSU_Viz::Defaults.new @stylesheet=SiSU_Style::CSS_HeadInfo.new(md).stylesheet @seg_name_html=(SiSU_HTML::Source::Seg.new.seg_name_html || []) @seg_name_html_tracker=(SiSU_HTML::Source::Seg.new.seg_name_html_tracker || []) @@ -389,7 +388,7 @@ WOK end def table_close %{ -#{@vz.table_close}} +#{the_table_close}} end def html_close #moved %{ @@ -398,597 +397,8 @@ WOK end class XML end - class HeadToc < HeadInformation - def initialize(md) - super(md) - @md=md - @tocband_scroll,@tocband_segtoc=make_scroll,make_seg - end - def scroll_head_navigation_band - pdf=if @md.programs[:pdf] - < - #{make_seg_scroll_pdf} - -WOK - else '' - end - %{
' + end + def num_css + ' ' + 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_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_concordance + %{ +   A-Z  + } + end + def txt_toc_link + %{ +   toc  + } + end + def txt_manifest + #{png_manifest} document manifest + %{ + [ document manifest ] + } + end + def txt_concordance + %{ +   A-Z  + } + end + self + end +end +module SiSU_Proj_XHTML + require_relative 'se' # se.rb + include SiSU_Env + class Bits + include SiSU_Parts_HTML + def initialize + @v=SiSU_Env::InfoVersion.instance.get_version + end + def credits_sisu_epub + %{
+

EPUB generated by #{@v[:project]} v#{@v[:version]}, GPL3

+
} + '' + end + end +end +__END__ diff --git a/lib/sisu/v5/xhtml_shared.rb b/lib/sisu/v5/xhtml_shared.rb index 677d7a47..0e7fcf3c 100644 --- a/lib/sisu/v5/xhtml_shared.rb +++ b/lib/sisu/v5/xhtml_shared.rb @@ -58,7 +58,6 @@ =end module SiSU_XHTML_Shared - require_relative 'defaults' # defaults.rb require_relative 'xhtml_table' # xhtml_table.rb class TableXHTML < SiSU_XHTML_Table::TableXHTML end diff --git a/lib/sisu/v5/xhtml_table.rb b/lib/sisu/v5/xhtml_table.rb index 33e4f48e..5e6b2c57 100644 --- a/lib/sisu/v5/xhtml_table.rb +++ b/lib/sisu/v5/xhtml_table.rb @@ -58,12 +58,13 @@ =end module SiSU_XHTML_Table - require_relative 'defaults' # defaults.rb + require_relative 'xhtml_parts' # xhtml_parts.rb class TableXHTML + include SiSU_Parts_XHTML @@tablehead=0 @@tablefoot=[] #watch def initialize(table) - @table_obj,@vz=table,SiSU_Viz::Defaults.new + @table_obj=table end def table table_obj=@table_obj @@ -80,7 +81,7 @@ module SiSU_XHTML_Table trc,nc=[],0 table_row_with_columns.each do |c| c=c.gsub(/^~$/,''). # tilde / empty cell - gsub(/<:br>/,'
') + gsub(/<:br>/,the_line_break) trc <<= if table_obj.head_ and nr==0; %{
#{c}#{c}
-#{pdf} -
- #{@vz.banner_band} - -   -#{@vz.table_close} -

} - end - def concordance_navigation_band(type='') - if type=~/pdf/ - @tocband_concordance=make_concordance - end - %{ - - -
- #{@vz.banner_band} - - #{@tocband_concordance} - -   - #{@vz.png_nav_toc} -   -#{@vz.table_close} -

} - end - def seg_head_navigation_band(type='') - if type=~/pdf/ - @tocband_segtoc=make_scroll_seg_pdf - end - firstseg=%{ - #{@vz.png_nav_nxt} - } if @md.firstseg =~/\S+/ - %{ - - - -} - %{
- #{@vz.banner_band} - - #{@tocband_segtoc} - -  #{firstseg}  -#{@vz.table_close} -

} - end - def seg_head_navigation_band_bottom(type='') - if type=~/pdf/ - @tocband_segtoc=make_scroll_seg_pdf - end - firstseg=%{ - #{@vz.png_nav_nxt} - } if @md.firstseg =~/\S+/ - %{ - - - -} - %{
-   - - #{@tocband_segtoc} - -  #{firstseg}  -#{@vz.table_close} -

} - end - def make_seg_scroll_pdf - wgt=Widget.new(@md) - scroll=%{

- #{@vz.nav_txt_doc_link} -
- - #{scroll} - #{wgt.seg(@vz.nav_txt_toc_link)}#{wgt.pdf}#{wgt.odf} - #{wgt.concordance(@vz.nav_txt_concordance)} - #{wgt.manifest} - #{wgt.search} - #{wgt.home} -
} - end - def make_scroll_seg_pdf - seg='' - wgt=Widget.new(@md) - seg=%{

- #{@vz.nav_txt_toc_link} -
- - #{seg} - #{wgt.scroll(@vz.nav_txt_doc_link)}#{wgt.pdf}#{wgt.odf} -
- #{wgt.concordance(@vz.nav_txt_concordance)} - #{wgt.manifest} - #{wgt.search} - #{wgt.home} -
} - end - def make_concordance - wgt=Widget.new(@md) - %{ - - #{wgt.seg(@vz.nav_txt_toc_link)}#{wgt.scroll(@vz.nav_txt_doc_link)}#{wgt.pdf}#{wgt.odf} -
- #{wgt.concordance(@vz.nav_txt_concordance)} - #{wgt.manifest} - #{wgt.search} - #{wgt.home} -
} - end - def head - %{#{doc_type} - - - #{@md.html_title} - - -#{@rdf.rdftoc} -#{@rdf.metatag_html} -#{@stylesheet.css_head} - -#{@vz.color_body} - - -} - end - def links_guide_open(type='horizontal') - if type=='vertical'; links_guide_vertical_open - else links_guide_horizontal_open - end - end - def links_guide_close #(type='horizontal') - insert='' - insert=if @md.sfx_src =~/s?/ - link='http://sisudoc.org' #get from defaults - url='sisudoc.org' - insert= %{ -

  • - - #{url} - -
  • - - -} - end - %{ #{insert} -} - end - def prefix_a - end - def rights - copyright=meta_content_clean(@md.rights.copyright.all) - rights=copyright(/^\s*Copyright\s+\(C\)/,'Copyright © ') - %{

    Rights: #{rights}

    -

    } - end - def prefix_b - %{

    Prefix: #{@md.prefix_b}

    } - end - def scroll_head_title_banner_open - %{

    -#{@md.icon} -
    -#{@vz.banner_instrument_cover_band_scr}} - end - def seg_head_title_banner_open - %{
    - #{@md.icon} -
    -#{@vz.banner_instrument_cover_band_seg}} - end - def make_scroll - concord=concordance_link(@vz.nav_txt_concordance) - %{ - -
    - #{@vz.nav_txt_doc_link} - - #{concord} -#{@vz.table_close}} - end - def make_seg - concord=concordance_link(@vz.nav_txt_concordance) - %{ - -
    - #{@vz.nav_txt_toc_link} - - - #{concord} -#{@vz.table_close}} - end - def manifest #check structure - manifest=manifest_link(@vz.nav_txt_manifest) - %{#{@vz.margin_txt_3} - #{@vz.paragraph_font_small} - #{manifest} - -#{@vz.table_close}} - end - def concordance #check structure - concord=concordance_link(@vz.nav_txt_concordance) - %{#{@vz.margin_txt_3} - #{@vz.paragraph_font_small} - #{concord} - -#{@vz.table_close}} - end - def metadata - %{#{@vz.margin_css} -

    - - MetaData - -

    -#{@vz.table_close}} - end - def seg_tail - %{ -
    -

     

    - - - -
    - #{@vz.banner_band} - -
    - #{@tocband_segtoc} -
    -
    -

     

    -#{@vz.credits_splash} -#{@vz.credits_sisu} - - - - - - -
    - - -} - end - def scroll_tail #debug - nav=scroll_head_navigation_band - %{ -
    -#{nav} -#{@vz.credits_splash} -#{@vz.credits_sisu} - - - - - - -
    - - -} - end - def seg_navigation_tail #this is a bug area, look up and "tidy" - #nav=scroll_head_navigation_band - %{ -
    -

     

    -#{@vz.credits_splash} -#{@vz.credits_sisu} - - - - - - -
    - - -} - end - end - class HeadSeg < HeadInformation - def initialize(md) #(md='') - super(md) - end - def head - %{#{doc_type} - - - #{@seg_name_html[@seg_name_html_tracker]} - - #{@md.html_title} - - -#{@rdf.rdfseg} -#{@rdf.metatag_html} -#{@vz.font_css_table_file} - -#{@vz.color_body} - - -} - end - def title_banner(title,subtitle,creator) - end - def dot_control_pre_next - %{ - - -} - pre=%{} if f_pre==true - nxt=%{} if f_nxt==true - %{
    - - #{@vz.png_nav_dot_pre} - - - - #{@vz.png_nav_dot_toc} - - - - #{@vz.png_nav_dot_nxt} - -#{@vz.table_close}} - end - def toc_nav(f_pre=false,f_nxt=false,use=1) - pre=nxt='' - toc=%{ - - #{@vz.png_nav_toc} - - - - #{@vz.png_nav_pre} - - - - #{@vz.png_nav_nxt} - -
    - -#{pre} -#{toc} -#{nxt} -
    -#{@vz.table_close}} - end - def toc_next2 - toc_nav(false,true).dup - end - def toc_pre_next2 - toc_nav(true,true).dup - end - def toc_pre2 - toc_nav(true,false,2).dup - end - def doc_types #used in seg_nav_band ### - wgt=Widget.new(@md) - #dir=SiSU_Env::InfoEnv.new(@md.fns) - if @md.concord_make - %{ - - - #{wgt.seg(@vz.nav_txt_toc_link)} - #{wgt.scroll(@vz.nav_txt_doc_link)} - #{wgt.pdf}#{wgt.odf} -
    - #{wgt.concordance(@vz.nav_txt_concordance)} - #{wgt.manifest} - #{wgt.search} - #{wgt.home} -
    } - else - %{ - - - #{wgt.seg(@vz.nav_txt_toc_link)} - #{wgt.scroll(@vz.nav_txt_doc_link)} - #{wgt.pdf}#{wgt.odf} -
    - #{wgt.manifest} - #{wgt.search} - #{wgt.home} -
    } - end - end - def navigation_table - %{ -
    - - - } - end - def navigation_table1 - %{ -
    - } - end - def navigation_table2 - %{ -
    - } - end - def header_advert_local_1 - dir=SiSU_Env::InfoEnv.new(@fns) - %{
    - -
    - - #{@md.ad_alt} - -

    -#{@vz.table_close} -} - end - def header_advert_local_2 - dir=SiSU_Env::InfoEnv.new(@fns) - %{

    - -
    - - #{@md.ad_alt} - -

    -#{@vz.table_close} -} - end - def header_advert_external - dir=SiSU_Env::InfoEnv.new(@fns) - %{

    - -
    - - #{@md.ad_alt} - -

    -#{@vz.table_close} -} - end - def credit - %{ -

    -#{@vz.credits_splash} -#{@vz.credits_sisu} - - - - - - -
    -} - end - def navigation_band(segtocband,seg_table_top_control) #change name to navigaion_band_banner - %{ - - - -
    -#{@vz.banner_band} - - #{doc_types} - - #{segtocband} -
    -#{seg_table_top_control}} - end - def navigation_band_bottom(segtocband,seg_table_top_control) #change name to navigaion_band_bannerless - %{ -
    - - - -
    - #{doc_types} - - #{segtocband} -
    - #{seg_table_top_control} -
    -} - end - def endnote_mark -%{ -

    -


    -

    } - end - def endnote_section_open -%{ -
    -} - end - def endnote_section_close -%{ -
    -} #revisit - end - def head - %{#{doc_type} - - - #{@seg_name_html[@seg_name_html_tracker]} - - #{@md.html_title} - - -#{@rdf.rdfseg} -#{@rdf.metatag_html} -#{@stylesheet.css_head} - -#{@vz.color_body} - - -} - end - def title_banner(title,subtitle,creator) - %{ -
    -

    - #{title} -

    -

    - #{subtitle} -

    -

    - #{creator} -

    -

    - copy @ - - #{@vz.txt_home} - -

    -
    -} - end - end - class HeadScroll < HeadToc - def initialize(md) #(md='') - super(md) - end - def toc_owner_details - %{#{@vz.margin_txt_3} -#{@vz.paragraph_font_small} - - Owner Details - -     - - - -#{@vz.table_close}} - end - def table - %{ - -
    - -#{@vz.paragraph_txt}} - end - def table1 - %{ -
    -#{@vz.paragraph_txt}} - end - def table2 - %{ -
    -#{@vz.paragraph_txt}} - end - end class FormatTextObject - @vz=SiSU_Viz::Defaults.new + include SiSU_Parts_XML attr_accessor :md,:dob,:txt,:ocn,:format,:table,:link,:linkname,:paranum,:p_num,:headname,:banner,:url def initialize(md,t_o) @md,@t_o=md,t_o @@ -1034,7 +444,6 @@ WOK end end @dob=t_o if defined? t_o.is - @vz=SiSU_Viz::Defaults.new end def endnote_body %{ @@ -1183,13 +592,13 @@ WOK end end def bold_para - %{#{@vz.margin_txt_0} + %{#{the_margin.txt_0}

    #{@txt}

    -#{@vz.margin_num_css} +#{the_margin.num_css}     -#{@vz.table_close}} +#{the_table_close}} end def bold_header @txt=@txt.gsub(/[1-9]~(\S+)/,''). @@ -1197,9 +606,9 @@ WOK %{

    #{@txt}

    -#{@vz.margin_num_css} +#{the_margin.num_css}     -#{@vz.table_close}} +#{the_table_close}} end def toc_head_copy_at %{

    #{@txt}

    \n} @@ -1215,9 +624,9 @@ WOK end end class FormatScroll < FormatTextObject + include SiSU_Parts_XML def initialize(md,txt) super(md,txt) - @vz=SiSU_Viz::Defaults.new end end class FormatSeg < FormatTextObject @@ -1240,11 +649,11 @@ WOK
    - + #{@txt}

    -#{@vz.table_close}} +#{the_table_close}} end def navigation_toc_lev3 #change bold use css %{

    @@ -1252,11 +661,11 @@ WOK

    - + #{@txt}

    -#{@vz.table_close}} +#{the_table_close}} end def navigation_toc_lev4 %{ @@ -1266,7 +675,7 @@ WOK

    #{@txt}

    -#{@vz.table_close}} +#{the_table_close}} end def navigation_toc_lev5 end @@ -1344,7 +753,7 @@ WOK

    #{@txt}

    -#{@vz.table_close}} +#{the_table_close}} end def navigation_header5 %{

    diff --git a/lib/sisu/v5/xml_odf_odt.rb b/lib/sisu/v5/xml_odf_odt.rb index e120d7b9..b2957e54 100644 --- a/lib/sisu/v5/xml_odf_odt.rb +++ b/lib/sisu/v5/xml_odf_odt.rb @@ -63,7 +63,7 @@ module SiSU_XML_ODF_ODT require_relative 'ao' # ao.rb require_relative 'se' # se.rb include SiSU_Env - include SiSU_Viz + require_relative 'xml_parts' # xml_parts.rb require_relative 'xml_odf_odt_format' # xml_odf_odt_format.rb include SiSU_XML_ODF_ODT_Format require_relative 'shared_metadata' # shared_metadata.rb @@ -128,8 +128,8 @@ module SiSU_XML_ODF_ODT end private class Scroll \1'). #http ftp matches escaped, no decoration gsub(/#{Mx[:url_o]}([a-zA-Z0-9._-]+\@\S+?\.[a-zA-Z0-9._-]+)#{Mx[:url_c]}/, - %{#{@brace_url.xml_open}\\1#{@brace_url.xml_close}}). + %{#{the_url_decoration.xml_open}\\1#{the_url_decoration.xml_close}}). gsub(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/, - %{#{@brace_url.xml_open}\\1#{@brace_url.xml_close}}) #http ftp matches with decoration + %{#{the_url_decoration.xml_open}\\1#{the_url_decoration.xml_close}}) #http ftp matches with decoration dob.obj= if dob.is==:para \ and dob.indent.to_s =~/[0-9]/ \ and dob.indent == dob.hang @@ -441,7 +439,7 @@ module SiSU_XML_ODF_ODT end def footnote_urls(str) str=str.gsub(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/, - %{#{@brace_url.xml_open}\\1#{@brace_url.xml_close}}) + %{#{the_url_decoration.xml_open}\\1#{the_url_decoration.xml_close}}) str=text_link(str) if str =~/#{Mx[:lnk_o]}.+?#{Mx[:lnk_c]}#{Mx[:url_o]}\S+?#{Mx[:url_c]}/ str=text_link_relative(str) if str =~/#{Mx[:lnk_o]}.+?#{Mx[:lnk_c]}#{Mx[:rel_o]}\S+?#{Mx[:rel_c]}/ str @@ -516,9 +514,9 @@ module SiSU_XML_ODF_ODT dob.obj=dob.obj.gsub(/#{Mx[:url_o]}_(\S+?)#{Mx[:url_c]}/, '\1'). #http ftp matches escaped, no decoration gsub(/#{Mx[:url_o]}([a-zA-Z0-9._-]+\@\S+?\.[a-zA-Z0-9._-]+)#{Mx[:url_c]}/, - %{#{@brace_url.xml_open}\\1#{@brace_url.xml_close}}). + %{#{the_url_decoration.xml_open}\\1#{the_url_decoration.xml_close}}). gsub(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/, - %{#{@brace_url.xml_open}\\1#{@brace_url.xml_close}}) #http ftp matches with decoration + %{#{the_url_decoration.xml_open}\\1#{the_url_decoration.xml_close}}) #http ftp matches with decoration dob.obj.split(/#{Mx[:br_line]}|#{Mx[:br_nl]}/).each_with_index do |parablock,i| set_ref=(i==0) ? "#{p_num[:set_ref]}#{set_bookmark_tag(dob)}" : '' parablock=group_clean(parablock) @@ -541,9 +539,9 @@ module SiSU_XML_ODF_ODT dob.obj=dob.obj.gsub(/#{Mx[:url_o]}_(\S+?)#{Mx[:url_c]}/, '\1'). #http ftp matches escaped, no decoration gsub(/#{Mx[:url_o]}([a-zA-Z0-9._-]+\@\S+?\.[a-zA-Z0-9._-]+)#{Mx[:url_c]}/, - %{#{@brace_url.xml_open}\\1#{@brace_url.xml_close}}). + %{#{the_url_decoration.xml_open}\\1#{the_url_decoration.xml_close}}). gsub(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/, - %{#{@brace_url.xml_open}\\1#{@brace_url.xml_close}}) #http ftp matches with decoration + %{#{the_url_decoration.xml_open}\\1#{the_url_decoration.xml_close}}) #http ftp matches with decoration dob.obj.split(/#{Mx[:br_line]}|#{Mx[:br_nl]}/).each_with_index do |parablock,i| set_ref=(i==0) ? "#{p_num[:set_ref]}#{set_bookmark_tag(dob)}" : '' parablock=group_clean(parablock) diff --git a/lib/sisu/v5/xml_odf_odt_format.rb b/lib/sisu/v5/xml_odf_odt_format.rb index 03db3f9d..64bf1315 100644 --- a/lib/sisu/v5/xml_odf_odt_format.rb +++ b/lib/sisu/v5/xml_odf_odt_format.rb @@ -60,7 +60,6 @@ module SiSU_XML_ODF_ODT_Format require_relative 'dp' # dp.rb include SiSU_Param - include SiSU_Viz class ParagraphNumber def initialize(make,paranum) @make=make @@ -146,7 +145,6 @@ module SiSU_XML_ODF_ODT_Format end rgx=/#{Mx[:en_a_o]}\d+\s+(.+?)#{Mx[:en_a_c]}/ @txt=@txt.gsub(rgx,'\1') if @txt =~rgx - @vz=SiSU_Viz::Defaults.new end def scr_endnote_body "#{@txt} " @@ -173,7 +171,6 @@ module SiSU_XML_ODF_ODT_Format def initialize(md,dob,p_num) @md,@dob,@p_num=md,dob,p_num @txt=dob.obj - @vz=SiSU_Viz::Defaults.new if @md.fns != @@fns @@table_counter=0 @@fns=@md.fns diff --git a/lib/sisu/v5/xml_parts.rb b/lib/sisu/v5/xml_parts.rb new file mode 100644 index 00000000..c08fc05c --- /dev/null +++ b/lib/sisu/v5/xml_parts.rb @@ -0,0 +1,194 @@ +# encoding: utf-8 +=begin + + * Name: SiSU + + * Description: a framework for document structuring, publishing and search + + * Author: Ralph Amissah + + * Copyright: (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, + 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 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: + + + + * Git + + + + * Ralph Amissah + + + + ** Description: shared html parts + +=end +module SiSU_Parts_XML + require_relative 'generic_parts' # generic_parts.rb + include SiSU_Parts_Generic + def the_line_break + '
    ' + end + def the_table_close + ' +

    ' + end + def the_url_decoration + 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_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_png + def _url_path_image_base #used for html image display + "#{Xx[:html_relative2]}_sisu/image" + end + def ico + %{ } + end + def png_home + %{#{the_text.home} -->} + end + def png_home_button + rel=@dir.path_rel_links.html_scroll_2 + %{#{the_text.home} -->} + 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_banner + def home_button_only + %{ + #{the_png.png_home_button} + } + end + def banner_band + %{ + + +
    + + #{the_png.png_home} + + +#{the_table_close}} + end + self + end +end +module SiSU_Proj_XML + require_relative 'html_parts' # html_parts.rb + require_relative 'se' # se.rb + include SiSU_Env + class Bits < SiSU_Proj_HTML::Bits + end +end +__END__ diff --git a/lib/sisu/v5/xml_sax.rb b/lib/sisu/v5/xml_sax.rb index 17ff4327..87205488 100644 --- a/lib/sisu/v5/xml_sax.rb +++ b/lib/sisu/v5/xml_sax.rb @@ -58,8 +58,6 @@ =end module SiSU_XML_SAX - require_relative 'defaults' # defaults.rb - include SiSU_Viz require_relative 'se_hub_particulars' # se_hub_particulars.rb include SiSU_Particulars require_relative 'se' # se.rb @@ -168,7 +166,6 @@ module SiSU_XML_SAX def initialize(particulars) @env, @md, @ao_arr= particulars.env,particulars.md,particulars.ao_array - @vz=SiSU_Viz::Defaults.new @trans=SiSU_XML_Munge::Trans.new(@md) @sys=SiSU_Env::SystemCall.new end diff --git a/lib/sisu/v5/xml_shared.rb b/lib/sisu/v5/xml_shared.rb index 2a8ac27e..a5f5e114 100644 --- a/lib/sisu/v5/xml_shared.rb +++ b/lib/sisu/v5/xml_shared.rb @@ -57,13 +57,13 @@ ** Description: common file for xml generation =end module SiSU_XML_Munge + require_relative 'xml_parts' # xml_parts.rb class Trans - require_relative 'defaults' # defaults.rb + include SiSU_Parts_XML def initialize(md) @md=md @sys=SiSU_Env::SystemCall.new @dir=SiSU_Env::InfoEnv.new(@md.fns) - @brace_url=SiSU_Viz::Defaults.new.url_decoration if @md.sem_tag @ab ||=semantic_tags.default end @@ -297,7 +297,7 @@ module SiSU_XML_Munge gsub(/#{Mx[:lnk_o]}(.+?)#{Mx[:lnk_c]}#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/, '\1'). #watch, compare html_tune gsub(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/, - %{#{@brace_url.xml_open}\\1#{@brace_url.xml_close}}). + %{#{the_url_decoration.xml_open}\\1#{the_url_decoration.xml_close}}). gsub(/#{Mx[:url_o]}_(\S+?)#{Mx[:url_c]}/, '\1') #escaped urls not linked, deal with later else @@ -307,7 +307,7 @@ module SiSU_XML_Munge dob.obj=dob.obj.gsub(/#{Mx[:gl_bullet]}/,'● ') end dob.obj=dob.obj.gsub(/#{Mx[:url_o]}([a-zA-Z0-9._-]+\@\S+?\.[a-zA-Z0-9._-]+)#{Mx[:url_c]}/, - %{#{@brace_url.xml_open}\\1#{@brace_url.xml_close}}). + %{#{the_url_decoration.xml_open}\\1#{the_url_decoration.xml_close}}). gsub(/#{Dx[:url_o]}/,"#{Dx[:url_o_xml]}"). gsub(/#{Dx[:url_c]}/,"#{Dx[:url_c_xml]}"). gsub(/ |#{Mx[:nbsp]}/m,' '). @@ -470,8 +470,8 @@ end module SiSU_XML_Tags #Format require_relative 'dp' # dp.rb include SiSU_Param - include SiSU_Viz class RDF + include SiSU_Parts_XML def initialize(md='',seg_name=[],tracker=0) @full_title=@subtitle=@author=@subject=@description=@publisher=@contributor=@date=@date_created=@date_issued=@date_available=@date_valid=@date_modified=@type=@format=@identifier=@source=@language=@relation=@coverage=@rights=@copyright=@owner=@keywords='' @md=md @@ -595,7 +595,6 @@ module SiSU_XML_Tags #Format end content=meta_content_clean(@md.keywords) @keywords=%{ \n} if @md.keywords - @vz=SiSU_Viz::Defaults.new end def meta_content_clean(content='') content=if not content.nil? @@ -654,8 +653,8 @@ WOK def metatag_html #values strung together, because some empty, and resulting output (line breaks) is much better </,1] @@ -124,7 +122,6 @@ module SiSU_Tables @@tablefoot=[] #watch def initialize(table,id='') @table_obj,@id=table,id - @vz=SiSU_Viz::Defaults.new end def spaces Ax[:spaces] @@ -181,7 +178,14 @@ module SiSU_Tables @@tablehead=0 @@tablefoot=[] def initialize(one) - @one,@parablock,@vz=one,one,SiSU_Viz::Defaults.new + @one,@parablock=one,one + end + def table_close + '
    ' + end + def margin_numless + '
    ' end def table_head(inf) %{ @@ -193,7 +197,7 @@ module SiSU_Tables
    } end def table_end(tablefoot='') - %{
    #{@vz.margin_numless}#{@vz.margin_numless} #{@vz.table_close} + %{
    #{the_margin_numless}#{the_margin_numless} #{the_table_close} #{tablefoot}} end def table_row(inf,h=false) @@ -216,13 +220,15 @@ module SiSU_Tables @@tablefoot << m if m @parablock=@parablock.gsub(//,'') @@tablehead=1 if @parablock =~/#{Mx[:gr_o]}Th#{Mx[:tc_p]}/u - if @parablock =~/#{Mx[:gr_o]}Th?#{Mx[:tc_p]}.+?#{Mx[:tc_p]}~(\d+);\w\d+;\w\d+#{Mx[:gr_c]}/u; @parablock=table_head($1) + if @parablock =~/#{Mx[:gr_o]}Th?#{Mx[:tc_p]}.+?#{Mx[:tc_p]}~(\d+);\w\d+;\w\d+#{Mx[:gr_c]}/u + @parablock=table_head($1) end if @parablock =~/#{Mx[:gr_o]}TZ#{Mx[:gr_c]}/ tablefoot=[] @@tablefoot.each {|x| tablefoot << ''} @@tablefoot=[] - if @parablock =~/#{Mx[:gr_o]}TZ#{Mx[:gr_c]}/; @parablock=table_end + if @parablock =~/#{Mx[:gr_o]}TZ#{Mx[:gr_c]}/ + @parablock=table_end end end if @@tablehead==1 -- cgit v1.2.3