From 341e92ed99e198e009751a0619fda9ce4d16a009 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 24 Sep 2007 13:46:15 +0100 Subject: manpage, special character fixes --- lib/sisu/v0/manpage.rb | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v0/manpage.rb b/lib/sisu/v0/manpage.rb index 05586dec..5b2cef6f 100644 --- a/lib/sisu/v0/manpage.rb +++ b/lib/sisu/v0/manpage.rb @@ -187,6 +187,8 @@ module SiSU_manpage end wrap=util.line_wrap if wrap =~ /^\s*[\d*+]+\s+.+?\s*\Z/m + wrap.gsub!(/(^| |\s|\*)\\\*/,'\1\\\\\*') #man page requires + wrap.gsub!(/\s\.(\S+)/,' \\.\1') wrap.gsub!(/(["''])/,"\\\\\\1") # quotation marks need escape wrap.gsub!(/^\s*([\d*+]+)\s+(.+?)\s*\Z/m, <(?:\s+<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>)?/ @@ -370,10 +364,9 @@ WOK para.gsub!(/^\s*<~\d+;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/,'') # remove empty lines - check para.gsub!(/(^|\s)[_\\]((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([.,]?(?:\s|$))/,'\1\2\3') para.gsub!(/(.+?)<\/a>/m,'\1') - para.gsub!(/<:name#\S+?>/,'') # remove name links - para.gsub!(/ /,' ') # decide on - para.gsub!(/(["''])/,"\\\\\\1") # quotation marks need escape - #para.gsub!(/(["''])/,"\\\\\\1") # decide on + para.gsub!(/<:name#\S+?>/,'') # remove name links + para.gsub!(/ /,' ') # decide on + para.gsub!(/(["''])/,"\\\\\\1") # quotation marks need escape para.gsub!(/\{(\S+?\.(?:png|jpg|gif)) .+?\}(?:(?:https?|file|ftp):\/\/\S+|image)/,' [ \1 ]') #"[ #{dir.url.images_local}\/\\1 ]") para.gsub!(/^\{\S+?\.(?:png|jpg|gif)\s+.+?"(.*?)"\s*\}\S+/,'[image: "\1"]') wordlist=para.scan(/\S+/) @@ -508,7 +501,7 @@ WOK line.gsub!(/\s+$/m,'') filename_manpage.puts line #unix manpage end - else filename_manpage.puts para #unix manpage # /^([*=-]|\.){5}/ + else filename_manpage.puts para #unix manpage # /^([*=-]|\.){5}/ end end filename_manpage.close -- cgit v1.2.3 From 9ce8e0c78b5fc090be43ce0b2adb9a4a53e37d9a Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 24 Sep 2007 13:47:59 +0100 Subject: plaintext, space between endnotes where --endnote option selected --- lib/sisu/v0/plaintext.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/sisu/v0/plaintext.rb b/lib/sisu/v0/plaintext.rb index aa2d747a..c308dfb2 100644 --- a/lib/sisu/v0/plaintext.rb +++ b/lib/sisu/v0/plaintext.rb @@ -217,7 +217,7 @@ GSUB ) end @@endnotes[:para] << "-#{wrap}" - @@endnotes[:end] << wrap + @@endnotes[:end] << '' << wrap end @@endnotes end -- cgit v1.2.3 From d345aacb4860d28135938a8181a08d551d0b5a9c Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 24 Sep 2007 14:13:54 +0100 Subject: html table of contents, cosmetic fix for rights and prefix appearing with toc --- lib/sisu/v0/html_format.rb | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v0/html_format.rb b/lib/sisu/v0/html_format.rb index d9fa95c2..618799a7 100644 --- a/lib/sisu/v0/html_format.rb +++ b/lib/sisu/v0/html_format.rb @@ -468,17 +468,11 @@ WOK end def rights rights=@md.dc_rights.gsub(/^\s*Copyright\s+\(C\)/,'Copyright © ') - %{

#{rights}

+ %{

Rights: #{rights}

} end def prefix_b - %{ - - -
  - #{@md.prefix_b} -#{@vz.table_close} -

} + %{

Prefix: #{@md.prefix_b}

} end def scroll_head_title_banner_open %{

-- cgit v1.2.3 From 7a77fb05afa24523a5c15d44a6f926923385764b Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 24 Sep 2007 15:06:12 +0100 Subject: html toc, css, cosmetic fix for rights and prefix in toc --- lib/sisu/v0/css.rb | 4 ++++ lib/sisu/v0/html_format.rb | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v0/css.rb b/lib/sisu/v0/css.rb index f4cf5228..13e5e026 100644 --- a/lib/sisu/v0/css.rb +++ b/lib/sisu/v0/css.rb @@ -414,6 +414,10 @@ WOK p.left, th.left, td.left { text-align: left; } + p.small_left, th.small_left, td.small_left { + text-align: left; + font-size: 80%; + } p.right, th.right, td.right { text-align: right; } diff --git a/lib/sisu/v0/html_format.rb b/lib/sisu/v0/html_format.rb index 618799a7..5a28c271 100644 --- a/lib/sisu/v0/html_format.rb +++ b/lib/sisu/v0/html_format.rb @@ -468,11 +468,11 @@ WOK end def rights rights=@md.dc_rights.gsub(/^\s*Copyright\s+\(C\)/,'Copyright © ') - %{

Rights: #{rights}

+ %{

Rights: #{rights}

} end def prefix_b - %{

Prefix: #{@md.prefix_b}

} + %{

Prefix: #{@md.prefix_b}

} end def scroll_head_title_banner_open %{

-- cgit v1.2.3 From 57486aeb726bb30056919ebd68c2aca702011ec1 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 24 Sep 2007 15:07:58 +0100 Subject: toc, css, distinguish "Document Information (metadata)" link from other links, made smaller --- lib/sisu/v0/css.rb | 5 ++++- lib/sisu/v0/html.rb | 9 ++++++--- lib/sisu/v0/html_format_css.rb | 3 +++ 3 files changed, 13 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v0/css.rb b/lib/sisu/v0/css.rb index 13e5e026..febf0cd1 100644 --- a/lib/sisu/v0/css.rb +++ b/lib/sisu/v0/css.rb @@ -422,7 +422,7 @@ WOK text-align: right; } - h1, h2, h3, h4, h5, h6 { + h0, h1, h2, h3, h4, h5, h6 { display: block; font-family: #{fonts}; font-weight: bold; @@ -642,6 +642,9 @@ WOK h6 { font-size: 100%; } + h0 { + font-size: 80%; + } h1.norm, h2.norm, h3.norm { font-size: 110%; margin-left: 10mm; diff --git a/lib/sisu/v0/html.rb b/lib/sisu/v0/html.rb index 2894fa27..89c6d463 100644 --- a/lib/sisu/v0/html.rb +++ b/lib/sisu/v0/html.rb @@ -390,12 +390,11 @@ WOK end toc={} format_toc=SiSU_HTML_Format_type::Format_toc.new(@md,title) - toc[:seg]=format_toc.lev1 title=if para =~/(<~0;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>)$/ m=/#{$1}/ para.gsub!(m,'') if para=~/^\d~\s+Document Information/ - %{#{linkname}} + %{#{linkname}} else linkname end else @@ -406,7 +405,11 @@ WOK %{#{linkname}} end format_toc=SiSU_HTML_Format_type::Format_toc.new(@md,title) - toc[:scr]=format_toc.lev1 + if para =~/^\d~\s+Document Information/ + toc[:seg]=toc[:scr]=format_toc.lev0 + else + toc[:seg]=toc[:scr]=format_toc.lev1 + end toc end def level_2 diff --git a/lib/sisu/v0/html_format_css.rb b/lib/sisu/v0/html_format_css.rb index 9ef61a02..497e883c 100644 --- a/lib/sisu/v0/html_format_css.rb +++ b/lib/sisu/v0/html_format_css.rb @@ -469,6 +469,9 @@ module SiSU_HTML_Format_type def lev6 lev('h6','toc') end + def lev0 #docinfo + lev('h0','toc') + end end end __END__ -- cgit v1.2.3