aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2010-07-07 20:09:04 -0400
committerRalph Amissah <ralph@amissah.com>2010-07-07 20:09:04 -0400
commit5a900258ae239b545d6c33e4643858a316f3c59b (patch)
tree044fdd13d3b9d16b6952a2aa3c98c3a80a9bb4df /lib
parentRenaming debian manpages to match name of the meta packages. (diff)
parentsome cleaning of default outputs, ongoing (diff)
Merge branch 'upstream' into debian/sid
Diffstat (limited to 'lib')
-rw-r--r--lib/sisu/v1/sysenv.rb4
-rw-r--r--lib/sisu/v2/concordance.rb2
-rw-r--r--lib/sisu/v2/constants.rb2
-rw-r--r--lib/sisu/v2/css.rb5
-rw-r--r--lib/sisu/v2/dal_syntax.rb4
-rw-r--r--lib/sisu/v2/db_import.rb3
-rw-r--r--lib/sisu/v2/defaults.rb14
-rw-r--r--lib/sisu/v2/epub_format.rb5
-rw-r--r--lib/sisu/v2/epub_tune.rb1
-rw-r--r--lib/sisu/v2/html_promo.rb2
-rw-r--r--lib/sisu/v2/html_tune.rb1
-rw-r--r--lib/sisu/v2/manifest.rb2
-rw-r--r--lib/sisu/v2/manpage.rb1
-rw-r--r--lib/sisu/v2/odf.rb27
-rw-r--r--lib/sisu/v2/plaintext.rb2
-rw-r--r--lib/sisu/v2/shared_html_lite.rb6
-rw-r--r--lib/sisu/v2/shared_xml.rb1
-rw-r--r--lib/sisu/v2/sysenv.rb12
-rw-r--r--lib/sisu/v2/texpdf.rb53
-rw-r--r--lib/sisu/v2/texpdf_format.rb9
-rw-r--r--lib/sisu/v2/urls.rb9
21 files changed, 98 insertions, 67 deletions
diff --git a/lib/sisu/v1/sysenv.rb b/lib/sisu/v1/sysenv.rb
index a55b03cc..519c0f9f 100644
--- a/lib/sisu/v1/sysenv.rb
+++ b/lib/sisu/v1/sysenv.rb
@@ -2648,10 +2648,10 @@ WOK
def get_version
@version={}
@pwd=ENV['PWD']
- yst_etc="#{defaults[:sisu_etc]}/#{SiSU_version_dir}/version.yml"
+ yst_ver="#{defaults[:sisu_share]}/#{SiSU_version_dir}/v/version.yml"
lib_path=@@lib_path ? @@lib_path : `echo $RUBYLIB`.split(':')
@@lib_path ||=lib_path
- if File.exist?(yst_etc); @version=YAML::load(File::open(yst_etc)) #unless @@noyaml
+ if File.exist?(yst_ver); @version=YAML::load(File::open(yst_ver)) #unless @@noyaml
end
@version
end
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 << %{</div><div class="content">#{credits}<div></body>\n</html>} # footer
+ @file_concordance << %{</div></body>\n</html>} # 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/constants.rb b/lib/sisu/v2/constants.rb
index 363bc65a..7fe795da 100644
--- a/lib/sisu/v2/constants.rb
+++ b/lib/sisu/v2/constants.rb
@@ -84,6 +84,7 @@ Mx[:fa_strike_o]= "#{Mx[:fa_o]}del#{Mx[:fa_o_c]}"; Mx[:fa_strike_c]= "
Mx[:fa_superscript_o]="#{Mx[:fa_o]}sup#{Mx[:fa_o_c]}"; Mx[:fa_superscript_c]="#{Mx[:fa_c_o]}sup#{Mx[:fa_c]}"
Mx[:fa_subscript_o]= "#{Mx[:fa_o]}sub#{Mx[:fa_o_c]}"; Mx[:fa_subscript_c]= "#{Mx[:fa_c_o]}sub#{Mx[:fa_c]}"
Mx[:fa_hilite_o]= "#{Mx[:fa_o]}hi#{Mx[:fa_o_c]}"; Mx[:fa_hilite_c]= "#{Mx[:fa_c_o]}hi#{Mx[:fa_c]}"
+Mx[:fa_monospace_o]= "#{Mx[:fa_o]}mono#{Mx[:fa_o_c]}"; Mx[:fa_monospace_c]= "#{Mx[:fa_c_o]}mono#{Mx[:fa_c]}"
Mx[:gl_bullet]= "#{Mx[:gl_o]}●#{Mx[:gl_c]}"
Mx[:pa_non_object_dummy_heading]="#{Mx[:pa_o]}-##{Mx[:pa_c]}" #unnumbered paragraph, delete when not required [used in dummy headings, eg. for segmented html] (place marker at end of paragraph)
Mx[:pa_non_object_no_heading]="#{Mx[:pa_o]}~##{Mx[:pa_c]}" #unnumbered paragraph (place marker at end of paragraph)
@@ -125,6 +126,7 @@ Px[:strike_o]= '-'; Px[:strike_c]= '-'
Px[:superscript_o]='^'; Px[:superscript_c]='^'
Px[:subscript_o]= '['; Px[:subscript_c]= ']'
Px[:hilite_o]= '*'; Px[:hilite_c]= '*'
+Px[:monospace_o]= ''; Px[:monospace_c]= ''
Px[:lv1]= '*'
Px[:lv2]= '='
Px[:lv3]= '='
diff --git a/lib/sisu/v2/css.rb b/lib/sisu/v2/css.rb
index f088c44e..38913431 100644
--- a/lib/sisu/v2/css.rb
+++ b/lib/sisu/v2/css.rb
@@ -605,6 +605,11 @@ WOK
background: #880000;
}
+ tt {
+ font-family: inconsolata, andale mono, courier new, courier, monospace;
+ background-color: #eeeeee;
+ }
+
label.ocn {
width: 2%;
float: right;
diff --git a/lib/sisu/v2/dal_syntax.rb b/lib/sisu/v2/dal_syntax.rb
index 5e04730f..713bc886 100644
--- a/lib/sisu/v2/dal_syntax.rb
+++ b/lib/sisu/v2/dal_syntax.rb
@@ -253,6 +253,8 @@ module SiSU_Syntax
"\\1#{Mx[:fa_subscript_o]}\\2#{Mx[:fa_subscript_c]}") #subscript
dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s+|['"]|#{Mx[:nbsp]}|#{Mx[:fa_o_c]}|#{Mx[:fa_c]}|\(|\>)6\{(.+?)\}6/,
"\\1#{Mx[:fa_subscript_o]}\\2#{Mx[:fa_subscript_c]}") #subscript
+ dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s+|['"]|#{Mx[:nbsp]}|#{Mx[:fa_o_c]}|#{Mx[:fa_c]}|\(|\>)#\{(.+?)\}#/,
+ "\\1#{Mx[:fa_monospace_o]}\\2#{Mx[:fa_monospace_c]}") #monospace text
dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s+|['"]|#{Mx[:nbsp]}|#{Mx[:fa_o_c]}|#{Mx[:fa_c]}|\(|\>)\+\{(.+?)\}\+/,
"\\1#{Mx[:fa_insert_o]}\\2#{Mx[:fa_insert_c]}") #inserted text
dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s+|['"]|#{Mx[:nbsp]}|#{Mx[:fa_o_c]}|#{Mx[:fa_c]}|\(|\>)v\{(.+?)\}v/,
@@ -288,6 +290,7 @@ module SiSU_Syntax
# ,{subscript}, <sub>subscript</sub>
# +{inserted text}+ <ins>inserted text</ins>
# -{deleted text}- <del>deleted text</del>
+ # #{monospace text}#
#
# {url address}:url
# {image.png}imageurl
@@ -447,6 +450,7 @@ module SiSU_Syntax
# ,{subscript}, <sub>subscript</sub>
# +{inserted text}+ <ins>inserted text</ins>
# -{deleted text}- <del>deleted text</del>
+ # #{monospace text}#
# {url address}:url
# {image.png}imageurl
# {image.png}png
diff --git a/lib/sisu/v2/db_import.rb b/lib/sisu/v2/db_import.rb
index 3b5c1cc9..4237757f 100644
--- a/lib/sisu/v2/db_import.rb
+++ b/lib/sisu/v2/db_import.rb
@@ -250,6 +250,7 @@ module SiSU_DB_import
data.obj.gsub!(/#{Mx[:fa_insert_o]}(.+?)#{Mx[:fa_insert_c]}/,'\1')
data.obj.gsub!(/#{Mx[:fa_cite_o]}(.+?)#{Mx[:fa_cite_c]}/,'\1')
data.obj.gsub!(/#{Mx[:fa_strike_o]}(.+?)#{Mx[:fa_strike_c]}/,'\1')
+ data.obj.gsub!(/#{Mx[:fa_monospace_o]}(.+?)#{Mx[:fa_monospace_c]}/,'\1')
data.obj.gsub!(/#{Mx[:gl_o]}(●)#{Mx[:gl_c]}\s*/,'\1 ')
data.obj.gsub!(/#{Mx[:tag_o]}\S+?#{Mx[:tag_c]}/,'') #check
@col[:seg]=@@seg
@@ -384,6 +385,8 @@ module SiSU_DB_import
@en_a_plus,@en_z_plus=@en_pls[0].first,@en_pls[0].last if @en_pls[0]
@col[:body]=if data.is=='table'
SiSU_Format_Shared::CSS_Format.new(@md,data).html_table
+ elsif data.is=='code'
+ SiSU_Format_Shared::CSS_Format.new(@md,data).code
elsif defined? data.indent and data.indent =~/[1-9]/
SiSU_Format_Shared::CSS_Format.new(@md,data).indent(data.indent)
else
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
</font>
#{table_close*4}}
end
- def credits_sisu
+ def credits_sisu_manifest
%{<div class="substance">
<table summary="SiSU summary" bgcolor="#ffffff" cellpadding="4" border="0">
<tr><td>
@@ -1657,12 +1657,22 @@ WOK
#{widget_way_better}
</table></div>}
end
+ def credits_sisu
+ x=%{<div class="substance">
+<table summary="SiSU summary" bgcolor="#ffffff" cellpadding="4" border="0">
+<tr><td>
+ #{widget_sisu}
+ #{widget_way_better}
+</table></div>}
+ ''
+ end
def credits_splash
end
def credits_sisu_epub
- %{<div class="substance">
+ x=%{<div class="substance">
<p class="center"><a href="http://www.openebook.org"><b>EPUB</b></a> generated by <a href="http://www.sisudoc.org"><b>#{@v[:project]}</b></a> v#{@v[:version]}, GPL3</p>
</div>}
+ ''
end
#% bottom
def bottom_surround
diff --git a/lib/sisu/v2/epub_format.rb b/lib/sisu/v2/epub_format.rb
index 498912a3..6bbbd668 100644
--- a/lib/sisu/v2/epub_format.rb
+++ b/lib/sisu/v2/epub_format.rb
@@ -398,6 +398,11 @@ module SiSU_EPUB_Format
background: #880000;
}
+ tt {
+ font-family: inconsolata, andale mono, courier new, courier, monospace;
+ background-color: #eeeeee;
+ }
+
label.ocn {
width: 2%;
float: right;
diff --git a/lib/sisu/v2/epub_tune.rb b/lib/sisu/v2/epub_tune.rb
index 035a453b..5da82392 100644
--- a/lib/sisu/v2/epub_tune.rb
+++ b/lib/sisu/v2/epub_tune.rb
@@ -244,6 +244,7 @@ module SiSU_EPUB_Tune
dob.obj.gsub!(/#{Mx[:fa_insert_o]}(.+?)#{Mx[:fa_insert_c]}/,'<ins>\1</ins>')
dob.obj.gsub!(/#{Mx[:fa_cite_o]}(.+?)#{Mx[:fa_cite_c]}/,'<cite>\1</cite>')
dob.obj.gsub!(/#{Mx[:fa_strike_o]}(.+?)#{Mx[:fa_strike_c]}/,'<del>\1</del>')
+ dob.obj.gsub!(/#{Mx[:fa_monospace_o]}(.+?)#{Mx[:fa_monospace_c]}/,'<tt>\1</tt>') # tt, kbd
dob.obj.gsub!(/#{Mx[:mk_o]}:name#(\S+?)#{Mx[:mk_c]}/,'')
dob.obj.gsub!(/^#{Mx[:gl_bullet]}/m,'●&nbsp;&nbsp;')
dob.obj.gsub!(/#{Mx[:nbsp]}/,'&nbsp;')
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:<br />' + @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/html_tune.rb b/lib/sisu/v2/html_tune.rb
index 11b1dbde..d5f3f35e 100644
--- a/lib/sisu/v2/html_tune.rb
+++ b/lib/sisu/v2/html_tune.rb
@@ -240,6 +240,7 @@ module SiSU_HTML_Tune
dob.obj.gsub!(/#{Mx[:fa_insert_o]}(.+?)#{Mx[:fa_insert_c]}/,'<ins>\1</ins>')
dob.obj.gsub!(/#{Mx[:fa_cite_o]}(.+?)#{Mx[:fa_cite_c]}/,'<cite>\1</cite>')
dob.obj.gsub!(/#{Mx[:fa_strike_o]}(.+?)#{Mx[:fa_strike_c]}/,'<del>\1</del>')
+ dob.obj.gsub!(/#{Mx[:fa_monospace_o]}(.+?)#{Mx[:fa_monospace_c]}/,'<tt>\1</tt>') # tt, kbd
dob.obj.gsub!(/#{Mx[:mk_o]}:name#(\S+?)#{Mx[:mk_c]}/,'<a name="\1"></a>')
dob.obj.gsub!(/^#{Mx[:gl_bullet]}/m,'●&nbsp;&nbsp;')
dob.obj.gsub!(/#{Mx[:nbsp]}/,'&nbsp;')
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
</table>
</div>
<div class="main_column">
-#{vz.credits_sisu}
+#{vz.credits_sisu_manifest}
</div>
</body>
</html>
diff --git a/lib/sisu/v2/manpage.rb b/lib/sisu/v2/manpage.rb
index 48b22fd3..2d13793b 100644
--- a/lib/sisu/v2/manpage.rb
+++ b/lib/sisu/v2/manpage.rb
@@ -274,6 +274,7 @@ WOK
dob.obj.gsub!(/#{Mx[:fa_insert_o]}(.+?)#{Mx[:fa_insert_c]}/,'++\1++')
dob.obj.gsub!(/#{Mx[:fa_strike_o]}(.+?)#{Mx[:fa_strike_c]}/,'--\1--')
dob.obj.gsub!(/#{Mx[:fa_cite_o]}(.+?)#{Mx[:fa_cite_c]}/,'"\1"')
+ dob.obj.gsub!(/#{Mx[:fa_monospace_o]}(.+?)#{Mx[:fa_monospace_c]}/,'\1')
dob.obj.gsub!(/\A\s*#{Mx[:fa_italics_o]}(.+?)#{Mx[:fa_italics_c]}#{Mx[:br_line]}/m,"#{Mx[:br_line]}.I \\1#{Mx[:br_line]}")
dob.obj.gsub!(/\s*#{Mx[:fa_italics_o]}(.+?)#{Mx[:fa_italics_c]}/m,"#{Mx[:br_line]}.I \\1#{Mx[:br_line]}")
dob.obj.gsub!(/\A\s*#{Mx[:fa_bold_o]}(.+?)#{Mx[:fa_bold_c]}#{Mx[:br_line]}/m,"#{Mx[:br_line]}.BI \\1#{Mx[:br_line]}")
diff --git a/lib/sisu/v2/odf.rb b/lib/sisu/v2/odf.rb
index 4eabbba5..2c0e206b 100644
--- a/lib/sisu/v2/odf.rb
+++ b/lib/sisu/v2/odf.rb
@@ -392,7 +392,7 @@ module SiSU_ODF
parablock.gsub!(/^\s*$/,'<br />')
parablock.gsub!(/#{Mx[:url_o]}_(\S+?)#{Mx[:url_c]}/,
'<text:a xlink:type="simple" xlink:href="\1">\1</text:a>') #http ftp matches escaped, no decoration
- parray << %{<text:p text:style-name="P5">#{parablock}</text:p>} if parablock =~/\S+/
+ parray << %{<text:p text:style-name="P20">#{parablock}</text:p>} if parablock =~/\S+/
end
dob.obj=parray.join + '<text:p text:style-name="Standard"/>'
end
@@ -485,14 +485,22 @@ module SiSU_ODF
dob.obj
end
dob.obj.gsub!(/#{Mx[:br_line]}/,'<br />')
- dob.obj.gsub!(/#{Mx[:br_page]}|#{Mx[:br_page_new]}/,'<text:p text:style-name="P8"> </text:p>')
+ dob.obj.gsub!(/#{Mx[:br_page]}|#{Mx[:br_page_new]}/,
+ '<text:p text:style-name="P8"> </text:p>')
dob.obj.gsub!(/&#169;/,'©') #too arbitrary
dob.obj.gsub!(/.+?<-#>/,'') # remove dummy headings (used by html) #check
- dob.obj.gsub!(/#{Mx[:fa_bold_o]}(.+?)#{Mx[:fa_bold_c]}/,'<text:span text:style-name="T1">\1</text:span>')
- dob.obj.gsub!(/#{Mx[:fa_italics_o]}(.+?)#{Mx[:fa_italics_c]}/,'<text:span text:style-name="T2">\1</text:span>')
- dob.obj.gsub!(/#{Mx[:fa_underscore_o]}(.+?)#{Mx[:fa_underscore_c]}/,'<text:span text:style-name="T3">\1</text:span>')
- dob.obj.gsub!(/#{Mx[:fa_superscript_o]}(.+?)#{Mx[:fa_superscript_c]}/,'<text:span text:style-name="T4">\1</text:span>')
- dob.obj.gsub!(/#{Mx[:fa_subscript_o]}(.+?)#{Mx[:fa_subscript_c]}/,'<text:span text:style-name="T5">\1</text:span>')
+ dob.obj.gsub!(/#{Mx[:fa_bold_o]}(.+?)#{Mx[:fa_bold_c]}/,
+ '<text:span text:style-name="T1">\1</text:span>')
+ dob.obj.gsub!(/#{Mx[:fa_italics_o]}(.+?)#{Mx[:fa_italics_c]}/,
+ '<text:span text:style-name="T2">\1</text:span>')
+ dob.obj.gsub!(/#{Mx[:fa_underscore_o]}(.+?)#{Mx[:fa_underscore_c]}/,
+ '<text:span text:style-name="T3">\1</text:span>')
+ dob.obj.gsub!(/#{Mx[:fa_superscript_o]}(.+?)#{Mx[:fa_superscript_c]}/,
+ '<text:span text:style-name="T4">\1</text:span>')
+ dob.obj.gsub!(/#{Mx[:fa_subscript_o]}(.+?)#{Mx[:fa_subscript_c]}/,
+ '<text:span text:style-name="T5">\1</text:span>')
+ dob.obj.gsub!(/#{Mx[:fa_monospace_o]}(.+?)#{Mx[:fa_monospace_c]}/,
+ '<text:span text:style-name="T7">\1</text:span>')
dob.obj.gsub!(/­/u,'-')
dob.obj.gsub!(/ /u, ' ') # space identify
dob.obj.gsub!(/ /u, ' ') # space identify
@@ -557,7 +565,7 @@ module SiSU_ODF
end
@@odf[:head]<<%{<?xml version="1.0" encoding="UTF-8"?>#{@br}} +
%{<office:document-content xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" office:version="1.0"><office:scripts/>#{@br}} +
- %{<office:font-face-decls><style:font-face style:name="HG Mincho Light J" svg:font-family="&apos;HG Mincho Light J&apos;, &apos;MS Mincho&apos;, &apos;HG Mincho J&apos;, &apos;HG Mincho L&apos;, &apos;HG Mincho&apos;, Mincho, &apos;MS PMincho&apos;, &apos;HG Mincho Light J&apos;, &apos;MS Gothic&apos;, &apos;HG Gothic J&apos;, &apos;HG Gothic B&apos;, &apos;HG Gothic&apos;, Gothic, &apos;MS PGothic&apos;, &apos;Andale Sans UI&apos;, &apos;Arial Unicode MS&apos;, &apos;Lucida Sans Unicode&apos;, Tahoma" style:font-pitch="variable"/><style:font-face style:name="Nimbus Sans L" svg:font-family="&apos;Nimbus Sans L&apos;" style:font-pitch="variable"/><style:font-face style:name="Tahoma" svg:font-family="Tahoma, Lucidasans, &apos;Lucida Sans&apos;, &apos;Arial Unicode MS&apos;" style:font-pitch="variable"/><style:font-face style:name="Nimbus Roman No9 L" svg:font-family="&apos;Nimbus Roman No9 L&apos;" style:font-family-generic="roman" style:font-pitch="variable"/><style:font-face style:name="Bitstream Vera Sans" svg:font-family="&apos;Bitstream Vera Sans&apos;" style:font-family-generic="swiss" style:font-pitch="variable"/></office:font-face-decls>#{@br}} +
+ %{<office:font-face-decls><style:font-face style:name="DejaVu Sans Mono" svg:font-family="'DejaVu Sans Mono'" style:font-adornments="Book" style:font-family-generic="modern" style:font-pitch="fixed"/><style:font-face style:name="Inconsolata" svg:font-family="Inconsolata" style:font-adornments="Regular" style:font-pitch="fixed"/><style:font-face style:name="Liberation Mono" svg:font-family="'Liberation Mono'" style:font-adornments="Regular" style:font-family-generic="modern" style:font-pitch="fixed"/><style:font-face style:name="DejaVu Sans" svg:font-family="'DejaVu Sans'" style:font-adornments="ExtraLight" style:font-family-generic="swiss" style:font-pitch="variable"/><style:font-face style:name="Nimbus Sans L" svg:font-family="&apos;Nimbus Sans L&apos;" style:font-pitch="variable"/><style:font-face style:name="Tahoma" svg:font-family="Tahoma, Lucidasans, &apos;Lucida Sans&apos;, &apos;Arial Unicode MS&apos;" style:font-pitch="variable"/><style:font-face style:name="DejaVu Serif" svg:font-family="'DejaVu Sans'" style:font-adornments="ExtraLight" style:font-family-generic="swiss" style:font-pitch="variable"/><style:font-face style:name="Nimbus Roman No9 L" svg:font-family="&apos;Nimbus Roman No9 L&apos;" style:font-family-generic="roman" style:font-pitch="variable"/><style:font-face style:name="Bitstream Vera Sans" svg:font-family="&apos;Bitstream Vera Sans&apos;" style:font-family-generic="swiss" style:font-pitch="variable"/></office:font-face-decls>#{@br}} +
%{<office:automatic-styles>#{@br}} +
%{#{table}#{@br}} +
%{<style:style style:name="P1" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:margin-top="0.199cm" fo:margin-bottom="0.199cm" fo:line-height="150%" fo:text-align="justify" style:justify-single-word="false"/></style:style>#{@br}} +
@@ -579,13 +587,14 @@ module SiSU_ODF
%{<style:style style:name="P17" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:margin-top="0.199cm" fo:margin-bottom="0.199cm" fo:line-height="150%" fo:margin-left="7cm" fo:margin-right="0cm" fo:text-align="justify" style:justify-single-word="false" fo:text-indent="0cm" style:auto-text-indent="false"/></style:style>#{@br}} +
%{<style:style style:name="P18" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:margin-top="0.199cm" fo:margin-bottom="0.199cm" fo:line-height="150%" fo:margin-left="8cm" fo:margin-right="0cm" fo:text-align="justify" style:justify-single-word="false" fo:text-indent="0cm" style:auto-text-indent="false"/></style:style>#{@br}} +
%{<style:style style:name="P19" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:margin-top="0.199cm" fo:margin-bottom="0.199cm" fo:line-height="150%" fo:margin-left="8cm" fo:margin-right="0cm" fo:text-align="justify" style:justify-single-word="false" fo:text-indent="0cm" style:auto-text-indent="false"/></style:style>#{@br}} +
-
+ %{<style:style style:name="P20" style:family="paragraph" style:parent-style-name="Standard"><style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0cm" fo:line-height="100%" fo:text-align="start" style:justify-single-word="false"/><style:text-properties style:font-name="DejaVu Sans Mono" fo:font-size="9pt" fo:font-weight="normal" fo:background-color="#e6e6e6"/></style:style>#{@br}} +
%{<style:style style:name="T1" style:family="text"><style:text-properties fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold"/></style:style>#{@br}} +
%{<style:style style:name="T2" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic"/></style:style>#{@br}} +
%{<style:style style:name="T3" style:family="text"><style:text-properties style:text-underline-style="solid" style:text-underline-width="auto" style:text-underline-color="font-color"/></style:style>#{@br}} +
%{<style:style style:name="T4" style:family="text"><style:text-properties style:text-position="super 58%"/></style:style>#{@br}} +
%{<style:style style:name="T5" style:family="text"><style:text-properties style:text-position="sub 58%"/></style:style>#{@br}} +
%{<style:style style:name="T6" style:family="text"><style:text-properties style:font-name="Courier 10 Pitch" fo:font-size="12pt"/></style:style>#{@br}} +
+ %{<style:style style:name="T7" style:family="text"><style:text-properties style:font-name="DejaVu Sans Mono" fo:font-size="10pt" fo:font-weight="normal" fo:background-color="#e6e6e6"/></style:style>#{@br}} +
%{<style:style style:name="fr1" style:family="graphic" style:parent-style-name="Graphics"><style:graphic-properties style:wrap="none" style:horizontal-pos="left" style:horizontal-rel="paragraph" style:mirror="none" fo:clip="rect(0cm 0cm 0cm 0cm)" draw:luminance="0%" draw:contrast="0%" draw:red="0%" draw:green="0%" draw:blue="0%" draw:gamma="100%" draw:color-inversion="false" draw:image-opacity="100%" draw:color-mode="standard"/></style:style>#{@br}} +
%{<style:style style:name="gr1" style:family="graphic"><style:graphic-properties draw:stroke="none" draw:fill="none" draw:textarea-horizontal-align="center" draw:textarea-vertical-align="middle" draw:color-mode="standard" draw:luminance="0%" draw:contrast="0%" draw:gamma="100%" draw:red="0%" draw:green="0%" draw:blue="0%" fo:clip="rect(0cm 0cm 0cm 0cm)" draw:image-opacity="100%" style:mirror="none" style:run-through="background" style:wrap="none" style:vertical-pos="top" style:vertical-rel="baseline" style:horizontal-pos="left" style:horizontal-rel="paragraph" draw:wrap-influence-on-position="once-concurrent" style:flow-with-text="false"/></style:style>#{@br}} +
%{<style:style style:name="gr2" style:family="graphic"><style:graphic-properties draw:stroke="none" draw:fill="none" draw:textarea-horizontal-align="center" draw:textarea-vertical-align="middle" draw:color-mode="standard" draw:luminance="0%" draw:contrast="0%" draw:gamma="100%" draw:red="0%" draw:green="0%" draw:blue="0%" fo:clip="rect(0cm 0cm 0cm 0cm)" draw:image-opacity="100%" style:mirror="none" style:run-through="background" style:wrap="none" style:vertical-pos="middle" style:vertical-rel="baseline" style:horizontal-pos="left" style:horizontal-rel="paragraph" draw:wrap-influence-on-position="once-concurrent" style:flow-with-text="false"/></style:style>#{@br}} +
diff --git a/lib/sisu/v2/plaintext.rb b/lib/sisu/v2/plaintext.rb
index 4acdec93..bc83702b 100644
--- a/lib/sisu/v2/plaintext.rb
+++ b/lib/sisu/v2/plaintext.rb
@@ -298,6 +298,8 @@ WOK
"#{Px[:cite_o]}\\1#{Px[:cite_c]}")
dob.obj.gsub!(/#{Mx[:fa_strike_o]}(.+?)#{Mx[:fa_strike_c]}/,
"#{Px[:strike_o]}\\1#{Px[:strike_c]}")
+ dob.obj.gsub!(/#{Mx[:fa_monospace_o]}(.+?)#{Mx[:fa_monospace_c]}/,
+ "#{Px[:monospace_o]}\\1#{Px[:monospace_c]}")
unless dob.is=='code'
dob.obj.gsub!(/#{Mx[:lnk_o]}(.+?)#{Mx[:lnk_c]}#{Mx[:rel_o]}\S+?#{Mx[:rel_c]}/,'\1')
dob.obj.gsub!(/#{Mx[:url_o]}_(\S+?)#{Mx[:url_c]}/,'\1')
diff --git a/lib/sisu/v2/shared_html_lite.rb b/lib/sisu/v2/shared_html_lite.rb
index bb27258c..02b4dcc2 100644
--- a/lib/sisu/v2/shared_html_lite.rb
+++ b/lib/sisu/v2/shared_html_lite.rb
@@ -147,6 +147,7 @@ module SiSU_Format_Shared
s=s.gsub(/#{Mx[:fa_strike_o]}(.+?)#{Mx[:fa_strke_c]}/,'-{\1}-')
s=s.gsub(/#{Mx[:fa_superscript_o]}(.+?)#{Mx[:fa_superscript_c]}/,'<sup>\1</sup>')
s=s.gsub(/#{Mx[:fa_subscript_o]}(.+?)#{Mx[:fa_subscript_c]}/,'<sub>\1</sub>')
+ s=s.gsub(/#{Mx[:fa_monospace_o]}(.+?)#{Mx[:fa_monospace_c]}/,'<tt>\1</tt>') # tt, kbd
s=s.gsub(/#{Mx[:gl_o]}#(?:126|152)#{Mx[:gl_c]}/i,'~')
end
def markup_object(t_o)
@@ -225,6 +226,11 @@ GSUB
h={:txt =>txt,:class =>'norm',:type =>'substantive',:id =>@ocn}
tag_para(h)
end
+ def code
+ txt=markup_object(@t_o)
+ h={:txt =>"<tt>#{txt}</tt>",:class =>'code',:type =>'substantive',:id =>@ocn}
+ tag_para(h)
+ end
def indent(t)
txt=markup_object(@t_o)
h={:txt =>txt,:class =>"indent#{t}",:type =>'substantive',:id =>@ocn}
diff --git a/lib/sisu/v2/shared_xml.rb b/lib/sisu/v2/shared_xml.rb
index 4d504882..2fcab17e 100644
--- a/lib/sisu/v2/shared_xml.rb
+++ b/lib/sisu/v2/shared_xml.rb
@@ -357,6 +357,7 @@ module SiSU_XML_munge
dob.obj.gsub!(/#{Mx[:fa_insert_o]}(.+?)#{Mx[:fa_insert_c]}/,'<ins>\1</ins>')
dob.obj.gsub!(/#{Mx[:fa_cite_o]}(.+?)#{Mx[:fa_cite_c]}/,'<cite>\1</cite>')
dob.obj.gsub!(/#{Mx[:fa_strike_o]}(.+?)#{Mx[:fa_strike_c]}/,'<del>\1</del>')
+ dob.obj.gsub!(/#{Mx[:fa_monospace_o]}(.+?)#{Mx[:fa_monospace_c]}/,'<tt>\1</tt>')
dob.obj.gsub!(/<:pb>\s*/,'') #Fix
dob.obj.gsub!(/<+[-~]#>+/,'')
if dob.is !~/^code/
diff --git a/lib/sisu/v2/sysenv.rb b/lib/sisu/v2/sysenv.rb
index 1727e630..3a532d65 100644
--- a/lib/sisu/v2/sysenv.rb
+++ b/lib/sisu/v2/sysenv.rb
@@ -1352,7 +1352,11 @@ WOK
man_path=@@man_path=File.expand_path(@rc['webserv']['path'])
else nil
end
- else manpath=@@man_path
+ else @@man_path
+ end
+ man_path_head=man_path.gsub(/(\S+)\/[^\/\s]+$/,'\1')
+ unless FileTest.directory?(man_path)
+ mkdir_p(man_path) if File.writable?("#{man_path_head}/.")
end
@webserv_path=if defined? man_path \
and File.writable?("#{man_path}/.")
@@ -1977,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
@@ -2665,10 +2669,10 @@ WOK
def get_version
@version={}
@pwd=ENV['PWD']
- yst_etc="#{defaults[:sisu_etc]}/#{SiSU_version_dir}/version.yml"
+ yst_ver="#{defaults[:sisu_share]}/#{SiSU_version_dir}/v/version.yml"
lib_path=@@lib_path ? @@lib_path : `echo $RUBYLIB`.split(':')
@@lib_path ||=lib_path
- if File.exist?(yst_etc); @version=YAML::load(File::open(yst_etc)) #unless @@noyaml
+ if File.exist?(yst_ver); @version=YAML::load(File::open(yst_ver)) #unless @@noyaml
end
@version
end
diff --git a/lib/sisu/v2/texpdf.rb b/lib/sisu/v2/texpdf.rb
index b9d9e2c0..9aa82927 100644
--- a/lib/sisu/v2/texpdf.rb
+++ b/lib/sisu/v2/texpdf.rb
@@ -443,10 +443,10 @@ module SiSU_TeX
dob.tmp = ocn \
+ @tex_ml.paraskip_small \
+ "\n" \
- + ' \\begin{scriptsize}' \
+ + ' \\begin{Codeblock}' \
+ "\n" \
+ dob.tmp \
- + '\\end{scriptsize}' \
+ + ' \\end{Codeblock}' \
+ "\n" \
+ @tex_ml.paraskip_normal
dob
@@ -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'
@@ -566,6 +566,8 @@ module SiSU_TeX
\\makeatother
\\chardef\\txtbullet="2022
\\chardef\\tilde="7E
+\\definecolor{Light}{gray}{.92}
+\\newcommand{\\Codeblock}[1]{\\normaltext\\raggedright\\tiny\\ttfamily\\texbackslash#1}
% \\sloppy
\\begin{document}
WOK
@@ -591,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 <<<<WOK
\\pagenumbering{roman}\\maketitle
\\pagestyle{fancy}
WOK
- @tex_file << "\\newpage\n"
- @tex_file << @@rights if defined? @md.rights.all and @md.rights.all #if @orientation =~/landscape/
- @tex_file << @@prefix_b if defined? @md.creator.prefix_b and @md.creator.prefix_b
- @tex_file << @tex_ml.sisu_rights
- @tex_file << (@md.sc_info ? @tex_ml.doc_sc_info : @tex_ml.doc_no_sc_info)
- @tex_file << @tex_ml.manifest_info
+ if defined? @md.rights.all \
+ and @md.rights.all
+ @tex_file << "\\newpage\n"
+ @tex_file << @@rights
+ @tex_file << @@prefix_b if defined? @md.creator.prefix_b and @md.creator.prefix_b
+ end
x={}
x[:l] =<<WOK
#{@tex_ml.newpage('landscape')}
@@ -658,37 +660,6 @@ WOK
end
@tex_file << dob
end
- @tex_file << "\n\\newpage\n" # was \\pagebreak\n
- # kludge ... look again later
- @tex_file << if @md.doc_skin !~/skin_mail/; @tex_ml.doc_tail
- else @tex_ml.mail_tail
- end
- if defined? @md.lnk \
- and @md.lnk
- @md.lnk.each do |l|
- if l[:say]
- url=%<#{l[:url]}>
- 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 ba615749..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
@@ -967,7 +968,10 @@ WOK
w.gsub!(/[#{Mx[:br_line]}#{Mx[:br_paragraph]}]/,' \newline ') #watch
w.gsub!(/#{Mx[:gl_o]}#(?:126|152)#{Mx[:gl_c]}/,'<=tilde>') #126 usual
w.gsub!(/\\?\||#{Mx[:gl_o]}#124#{Mx[:gl_c]}/,'<=pipe>') #unless is=='code' #unless w=~/<~\d+;(?:[ohmu]|[0-6]:)\d+;\w\d+>/ # | SiSU not really special sisu character but done, also LaTeX
- w.gsub!(/\#/,'<=hash>') unless w =~/#{Mx[:rel_o]}/
+ if w !~/#{Mx[:rel_o]}/ \
+ and w !~/#{Mx[:gl_o]}#/
+ w.gsub!(/\#/,'<=hash>')
+ end
para_array << w
end
str=para_array.join(' ')
@@ -1060,6 +1064,7 @@ WOK
str.gsub!(/#{Mx[:fa_strike_o]}(.+?)#{Mx[:fa_strike_c]}/,'\sout{\1}') # ulem
str.gsub!(/#{Mx[:fa_superscript_o]}(.+?)#{Mx[:fa_superscript_c]}/,"\$^{\\textrm{\\1}}\$")
str.gsub!(/#{Mx[:fa_subscript_o]}(.+?)#{Mx[:fa_subscript_c]}/,"\$_{\\textrm{\\1}}\$")
+ str.gsub!(/#{Mx[:fa_monospace_o]}(.+?)#{Mx[:fa_monospace_c]}/,' \monosp{ \1 } ')
unless is=='code'
str.gsub!(/"(.+?)"/,'“\1”') # quote marks / quotations open & close " need condition exclude for code
str.gsub!(/\s+"/,' “') # open "
diff --git a/lib/sisu/v2/urls.rb b/lib/sisu/v2/urls.rb
index 56b93a78..1011eda4 100644
--- a/lib/sisu/v2/urls.rb
+++ b/lib/sisu/v2/urls.rb
@@ -114,6 +114,7 @@ module SiSU_urls
'P (Ruby profiler)'=>'profile',
's (sisu markup)'=>source,
'S (sisupod)'=>@fn[:sisupod],
+ 't (Plain-text (endnotes))'=>@fn[:plain],
'x (XML sax type)'=>@fn[:sax],
'X (XML dom type)'=>@fn[:dom],
'y (Manifest, html)'=>@fn[:manifest],
@@ -129,8 +130,8 @@ module SiSU_urls
end
end
def urls_maintenance(opt,x,y)
- if x=~/^([abcehHmNopwxXy])/ \
- and opt.cmd =~/[abcehHmNopwxXy]/ \
+ if x=~/^([abcehHmNoptwxXy])/ \
+ and opt.cmd =~/[abcehHmNoptwxXy]/ \
and x=~/^[#{opt.cmd}]/ \
and opt.cmd =~/M/
m=$1
@@ -191,8 +192,8 @@ module SiSU_urls
@u.each do |x,y|
if @opt.fns =~ @m_regular
if @opt.cmd =~/[MVv]/
- if x=~/^([abchHNopwxXyY])/ \
- and @opt.cmd=~/[abchHNopwxXyY]/ \
+ if x=~/^([abchHNoptwxXyY])/ \
+ and @opt.cmd=~/[abchHNoptwxXyY]/ \
and x=~/^[#{@opt.cmd}]/
m=$1
SiSU_Screen::Ansi.new(@opt.cmd,"-#{x}","#{@prog.web_browser} #{@env.url.output_tell}/#{@fnb}/#{y}").result