From fd20f4a7a44586a07a1c0cb0125a0e77dbd0d872 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 7 Jul 2010 20:05:43 -0400 Subject: some cleaning of default outputs, ongoing --- lib/sisu/v2/concordance.rb | 2 +- lib/sisu/v2/defaults.rb | 14 +++++++++++-- lib/sisu/v2/html_promo.rb | 2 +- lib/sisu/v2/manifest.rb | 2 +- lib/sisu/v2/sysenv.rb | 2 +- lib/sisu/v2/texpdf.rb | 47 ++++++++------------------------------------ lib/sisu/v2/texpdf_format.rb | 3 ++- 7 files changed, 26 insertions(+), 46 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v2/concordance.rb b/lib/sisu/v2/concordance.rb index 03635cd0..20ab8efa 100644 --- a/lib/sisu/v2/concordance.rb +++ b/lib/sisu/v2/concordance.rb @@ -331,7 +331,7 @@ WOK # special cases endnotes and header levels 1 - 3 end credits=@vz.credits_sisu - @file_concordance << %{
#{credits}
\n} # footer + @file_concordance << %{
\n} # footer SiSU_Screen::Ansi.new(@md.cmd,@md.fns,"#{@env.path.output_tell}/#{@md.fn[:concordance]}").flow if @md.cmd =~/[MV]/ end end diff --git a/lib/sisu/v2/defaults.rb b/lib/sisu/v2/defaults.rb index 849c430c..09a9808b 100644 --- a/lib/sisu/v2/defaults.rb +++ b/lib/sisu/v2/defaults.rb @@ -1649,7 +1649,7 @@ WOK #{table_close*4}} end - def credits_sisu + def credits_sisu_manifest %{
@@ -1657,12 +1657,22 @@ WOK #{widget_way_better}
} end + def credits_sisu + x=%{
+ +
+ #{widget_sisu} + #{widget_way_better} +
} + '' + end def credits_splash end def credits_sisu_epub - %{
+ x=%{

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

} + '' end #% bottom def bottom_surround diff --git a/lib/sisu/v2/html_promo.rb b/lib/sisu/v2/html_promo.rb index 0b3e500a..290e74f2 100644 --- a/lib/sisu/v2/html_promo.rb +++ b/lib/sisu/v2/html_promo.rb @@ -163,7 +163,7 @@ module SiSU_HTML_promo end form=if action \ and db - 'SiSU search:
' + @env.widget.search_form('sisusearch',action,db,table) + @env.widget.search_form('sisusearch',action,db,table) else '' end end diff --git a/lib/sisu/v2/manifest.rb b/lib/sisu/v2/manifest.rb index c8dd3753..7be18b19 100644 --- a/lib/sisu/v2/manifest.rb +++ b/lib/sisu/v2/manifest.rb @@ -677,7 +677,7 @@ WOK
-#{vz.credits_sisu} +#{vz.credits_sisu_manifest}
diff --git a/lib/sisu/v2/sysenv.rb b/lib/sisu/v2/sysenv.rb index 6c579a9c..3a532d65 100644 --- a/lib/sisu/v2/sysenv.rb +++ b/lib/sisu/v2/sysenv.rb @@ -1981,7 +1981,7 @@ WOK elsif defined? @rc['program_select']['epub_viewer'] \ and @rc['program_select']['epub_viewer'] =~/\S\S+/ @rc['program_select']['epub_viewer'] - else 'calibre' #'calibre' 'fbreader' + else 'ebook-viewer' #'calibre' 'fbreader' end end def xml_viewer diff --git a/lib/sisu/v2/texpdf.rb b/lib/sisu/v2/texpdf.rb index 8d3b338a..9aa82927 100644 --- a/lib/sisu/v2/texpdf.rb +++ b/lib/sisu/v2/texpdf.rb @@ -502,7 +502,7 @@ module SiSU_TeX and dob.obj=~/Metadata\b/ h=tst.level4 metadata=Metadata::TeX_metadata.new(@md).metadata_tex - dob.tmp=h.tmp + ' ' + metadata.join(br) + dob.tmp=h.tmp + ' ' + '\begin{scriptsize}' + metadata.join(br) + '\end{scriptsize}' else dob.tmp='' # dob.tmp={:l =>'',:p =>''} end when 'para' @@ -593,19 +593,19 @@ WOK else "\n\\author{#{@copymark} \\textnormal{#{author}}}" end end - @tex_file << unless @md.fnb =~/^mail\s*$/; "\n\\date{\\begin{footnotesize} copy @ #{@tex_ml.site} \\end{footnotesize} #{sisu_rc_footnote}}" + @tex_file << unless @md.fnb =~/^mail\s*$/; "\n\\date{\\begin{footnotesize} copy @ #{@tex_ml.site} \\end{footnotesize}}" else "\\date" end @tex_file <<< - url.gsub!(/(?:\\)*([$&~%_#}{^])/,"\\\\\\1") #latex special chars - s_lnk=l[:say] - s_lnk.gsub!(/\s*(#{Mx[:br_line]}|#{Mx[:br_nl]}|#{Mx[:br_paragraph]})\s*/,' \newline ') - s_lnk.gsub!(/(?:\\)*([$&~%_#}{^])/,"\\\\\\1") #latex special chars - if url !~/^\.(\.)?\// - s_lnk_url=%<#{@brace_url.tex_open}\\begin{scriptsize}\\url{#{url}}\\end{scriptsize}#{@brace_url.tex_close}> # note this bit of dereferencing magic - else - url.gsub!(/\.\.\//,'') - s_lnk_url="(#{@tex_ml.site}) \\\\\n" + ' ' + - '\begin{scriptsize}' + - %<\\url\{#{@vz.url_root_http}/#{url}\}> + # note this bit of dereferencing magic - "\\end{scriptsize}" - end - @tex_file << " #{s_lnk} \\\\\n #{s_lnk_url} \n" unless @md.doc_skin =~/skin_mail/ - s_lnk=s_lnk_url=nil - end - end - end - @tex_file << " #{@tex_ml.sitename} home: \\\\ -\\begin{bfseries}#{@tex_ml.site}\\end{bfseries} -" @st[:tex][:stmp]||=@md.stmpd stamp=@st[:tex][:stmp] if @st[:tex][:stmp] if stamp diff --git a/lib/sisu/v2/texpdf_format.rb b/lib/sisu/v2/texpdf_format.rb index c269af87..637271a0 100644 --- a/lib/sisu/v2/texpdf_format.rb +++ b/lib/sisu/v2/texpdf_format.rb @@ -213,12 +213,13 @@ module SiSU_TeX_Pdf dob.tmp.gsub!(/(?:\\begin\{bfseries\}|\\begin\{itshape\})(.+?)(?:\\end\{bfseries\}|\\end\{itshape\})/m,'\1') cont_ln=dob.tmp.dup cont_ln.gsub!(@@tex_pattern_margin_number,'') + clearp=(dob.lv =~/B/ && dob.obj =='Metadata') ? "\\clearpage\n" : '' if dob.tmp =~/\\[Ff]ootnote/ #and dob =~/^[1-6]#{Tex[:tilde]}/ # removing footnotes from headings! cont_ln.gsub!(/\s*\\footnote\[\d+\]\{%\n .+? \}\s*/,' ') cont_ln.gsub!(/\s*\\Footnote[A]\{[*+]+\d*\}\{%\n .+? \}\s*/,' ') end dob.tmp.gsub!(/^(.*)\n?$/m, - "\\part*{\\1} + "#{clearp}\\part*{\\1} \\addcontentsline{toc}{section}{#{cont_ln}} \\markboth{#{title}}\n") dob -- cgit v1.2.3