aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/sisu/v2/dal_doc_str.rb14
-rw-r--r--lib/sisu/v2/dal_syntax.rb8
-rw-r--r--lib/sisu/v2/html_scroll.rb44
-rw-r--r--lib/sisu/v2/sysenv.rb2
-rw-r--r--lib/sisu/v2/texpdf.rb1
-rw-r--r--lib/sisu/v2/texpdf_format.rb2
6 files changed, 39 insertions, 32 deletions
diff --git a/lib/sisu/v2/dal_doc_str.rb b/lib/sisu/v2/dal_doc_str.rb
index 1dc6076e..2d4ee192 100644
--- a/lib/sisu/v2/dal_doc_str.rb
+++ b/lib/sisu/v2/dal_doc_str.rb
@@ -422,16 +422,14 @@ module SiSU_document_structure_extract
h={:obj=>'Index'}
end
tuned_file << @pb
- h={:obj=>'Metadata'}
- h={:ln=>2,:obj=>'Metadata',:autonum_=>false}
+ h={:ln=>2,:obj=>'Metadata',:autonum_=>false,:ocn_=>false}
tuned_file << SiSU_document_structure::Object_heading.new.heading_insert(h)
- h={:ln=>4,:obj=>'SiSU Metadata, document information',:name=>'metadata',:autonum_=>false}
+ h={:ln=>4,:obj=>'SiSU Metadata, document information',:name=>'metadata',:autonum_=>false,:ocn_=>false}
tuned_file << SiSU_document_structure::Object_heading.new.heading_insert(h)
tuned_file << @pb
- h={:obj=>'Manifest'}
- h={:ln=>2,:obj=>'Manifest',:autonum_=>false}
+ h={:ln=>2,:obj=>'Manifest',:autonum_=>false,:ocn_=>false}
tuned_file << SiSU_document_structure::Object_heading.new.heading_insert(h)
- h={:ln=>4,:obj=>'SiSU Manifest, alternative outputs etc.',:name=>'sisu_manifest',:autonum_=>false}
+ h={:ln=>4,:obj=>'SiSU Manifest, alternative outputs etc.',:name=>'sisu_manifest',:autonum_=>false,:ocn_=>false}
tuned_file << SiSU_document_structure::Object_heading.new.heading_insert(h)
tuned_file
h={:obj=>'eof'}
@@ -462,9 +460,9 @@ module SiSU_document_structure_extract
language=l[:l]
tr=SiSU_Translate::Source.new(@md,language)
meta << @pb
- h={:ln=>2,:obj=>'Metadata'}
+ h={:ln=>2,:obj=>'Metadata',:ocn_=>false}
meta << SiSU_document_structure::Object_heading.new.heading(h)
- h={:ln=>4,:name=>'metadata',:obj=>'Metadata',:autonum_=>false}
+ h={:ln=>4,:name=>'metadata',:obj=>'Metadata',:autonum_=>false,:ocn_=>false}
meta << SiSU_document_structure::Object_heading.new.heading(h) #add ocnm
s="Document Manifest @\n #{base_html}/#{@md.fn[:manifest]}"
meta << meta_para(s)
diff --git a/lib/sisu/v2/dal_syntax.rb b/lib/sisu/v2/dal_syntax.rb
index 713bc886..2f78fbe6 100644
--- a/lib/sisu/v2/dal_syntax.rb
+++ b/lib/sisu/v2/dal_syntax.rb
@@ -243,6 +243,8 @@ module SiSU_Syntax
"\\1#{Mx[:fa_italics_o]}\\2#{Mx[:fa_italics_c]}") #italics
dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s+|['"]|#{Mx[:nbsp]}|#{Mx[:fa_o_c]}|#{Mx[:fa_c]}|#{Mx[:lnk_o]}|#{Mx[:br_line]}|#{Mx[:br_paragraph]}|[\(\[\{]|\>)_\{(.+?)\}_/,
"\\1#{Mx[:fa_underscore_o]}\\2#{Mx[:fa_underscore_c]}") #underscore
+ dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s+|['"]|#{Mx[:nbsp]}|#{Mx[:fa_o_c]}|#{Mx[:fa_c]}|#{Mx[:lnk_o]}|#{Mx[:br_line]}|#{Mx[:br_paragraph]}|[\(\[\{]|\>)#\{(.+?)\}#/,
+ "\\1#{Mx[:fa_monospace_o]}\\2#{Mx[:fa_monospace_c]}") #monospace
dob.obj.gsub!(/(^|#{Mx[:gl_c]}|\s+|['"]|#{Mx[:nbsp]}|#{Mx[:fa_o_c]}|#{Mx[:fa_c]}|\(|\>)\"\{(.+?)\}\"/,
"\\1#{Mx[:fa_cite_o]}\\2#{Mx[:fa_c_o]}cite#{Mx[:fa_c]}") #cite /blockquote?
dob.obj.gsub!(/(^|[^\\])\^\{(.+?)\}\^/,
@@ -253,8 +255,6 @@ 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/,
@@ -380,8 +380,8 @@ module SiSU_Syntax
dob.obj.gsub!(/(^|[#{Mx[:gl_c]}#{Mx[:nbsp]} ])\{~\^ (.+?)\s*\}((?:https?:|ftp:|:|[.]{1,2}\/)\S+?)([;,.]?)(?=\s|[#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}]|$)/m,
"\\1#{Mx[:lnk_o]}\\2#{Mx[:lnk_c]}\\3\\4 #{Mx[:en_a_o]}\\3#{Mx[:en_a_c]} ")
end
- dob.obj.gsub!(/\{\s*([^{}]+?)\s*\}((?:https?:|:|[.]{2}\/|#)\S+?)(?=\s|[#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}#{Mx[:en_a_o]}#{Mx[:en_b_o]}]|$)/,
- "#{Mx[:lnk_o]}\\1#{Mx[:lnk_c]}\\2") #linked (text or image, however text cannot include modified face, e.g. bold, ital, underline)
+ dob.obj.gsub!(/(^|[^#])\{\s*([^{}]+?)\s*\}((?:https?:|:|[.]{2}\/|#)\S+?)(?=\s|[#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}#{Mx[:en_a_o]}#{Mx[:en_b_o]}]|$)/,
+ "\\1#{Mx[:lnk_o]}\\2#{Mx[:lnk_c]}\\3") #linked (text or image, however text cannot include modified face, e.g. bold, ital, underline)
dob.obj.gsub!(/(^|[#{Mx[:gl_c]}#{Mx[:lnk_c]}#{Mx[:en_a_o]}#{Mx[:en_b_o]}(\s])((?:https?|ftp):\/\/\S+?\.[^>< ]+?)([,.;'"]?)(?=[\s#{Mx[:en_a_c]}#{Mx[:en_b_c]}#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}]|$)/m,
%{\\1#{Mx[:url_o]}\\2#{Mx[:url_c]}\\3})
dob.obj.gsub!(/#{Mx[:lnk_c]}#(\S+?[^>< ]+?)([,.;'"]?)(?=[\s#{Mx[:en_a_c]}#{Mx[:en_b_c]}#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}]|$)/m,
diff --git a/lib/sisu/v2/html_scroll.rb b/lib/sisu/v2/html_scroll.rb
index b0581ead..049eb922 100644
--- a/lib/sisu/v2/html_scroll.rb
+++ b/lib/sisu/v2/html_scroll.rb
@@ -81,17 +81,18 @@ module SiSU_HTML_scroll
@rcdc=false
@scr={ :body=>[],:metadata=>[],:owner_details=>[] }
data.each do |dob|
- if defined? dob.name and dob.name =~/^meta/ and dob.obj =~/Document Information/
+ if defined? dob.name and dob.name =~/^meta/ \
+ and dob.obj =~/Document Information/
dob.obj.gsub!(/(Document Information(?: \(metadata\))?)/,'\1<a name="docinfo"></a>')
end
- if defined? dob.name and dob.name =~/^metadata/ and dob.obj =~/Metadata/
- dob.obj.gsub!(/(Metadata)/,'\1<a name="metadata"></a>')
+ if dob.obj =~/^Metadata$/ \
+ and dob.lv =='B'
+ dob.obj.gsub!(/Metadata/,'')
end
- if @rcdc==false \
- and dob.is =='heading_insert' \
- and dob.ln ==1 \
+ if defined? dob.name \
and dob.name =~/^metadata/ \
- and dob.obj =~/Document Information/ #fix no current match
+ and dob.lv =='1' \
+ and dob.obj =~/SiSU Metadata, document information/
@rcdc=true
end
dob.obj.gsub!(/href="[a-z0-9._-]+(#\S+?")/m,'href="\1') # internal document links
@@ -125,11 +126,26 @@ module SiSU_HTML_scroll
sto.heading_body2
elsif dob.ln==3
sto.heading_body3
- elsif dob.ln==4
+ elsif dob.ln==4 \
+ and dob.obj !~/^(?:Endnotes|Index|Metadata|Manifest)$/
+ sto.heading_body4
+ elsif dob.ln==4 \
+ and dob.obj=='Endnotes'
sto.heading_body4
- if dob.obj=='Endnotes'
- @endnotes.join("\n") + '<hr width=90% />'
+ @endnotes.join("\n")
+ elsif dob.ln==4 \
+ and dob.obj=='Index'
+ sto.heading_body4
+ book_idx=SiSU_Particulars::Combined_singleton.instance.get_idx_html(@md.opt).html_idx
+ book_idx.each do |x| #takes book index prepared for segments and strips segment identifying info
+ x.gsub!(/<a href="\S+?\.html#(\d+)">(\1(?:-\d+)?)<\/a>/,'<a href="#\1">\2</a>')
end
+ book_idx.join("\n")
+ #elsif dob.ln==4 \
+ #and dob.obj=~/Meta/
+ #p __LINE__
+ ##and dob.obj=='Metadata'
+ #metadata=Metadata::Summary.new(@md).xhtml.metadata
elsif dob.ln==5
sto.heading_body5
elsif dob.ln==6
@@ -158,14 +174,6 @@ module SiSU_HTML_scroll
sto.code
elsif dob.is=='table'
sto.table
- elsif dob.is=='insert' and dob.obj=='Index'
- book_idx=SiSU_Particulars::Combined_singleton.instance.get_idx_html(@md.opt).html_idx
- book_idx.each do |x| #takes book index prepared for segments and strips segment identifying info
- x.gsub!(/<a href="\S+?\.html#(\d+)">(\1(?:-\d+)?)<\/a>/,'<a href="#\1">\2</a>')
- end
- book_idx.join("\n") + '<hr width=90% />'
- elsif dob.is=='insert' and dob.obj=='Metadata' #use for metadata inject
- metadata=Metadata::Summary.new(@md).xhtml.metadata
end
if dob =~/<a name="n\d+">/ \
and dob =~/^(?:\^~\d+\s|<!e[:_]\d+!>)/ # hmmm re-adjusted 200507, for alt endnote which should again be matched ^~ ... not in response to problem though
diff --git a/lib/sisu/v2/sysenv.rb b/lib/sisu/v2/sysenv.rb
index 3a532d65..8f330343 100644
--- a/lib/sisu/v2/sysenv.rb
+++ b/lib/sisu/v2/sysenv.rb
@@ -1350,7 +1350,7 @@ WOK
man_path=if defined? @rc['webserv']['path'] \
and @rc['webserv']['path'] =~/\S\S+/
man_path=@@man_path=File.expand_path(@rc['webserv']['path'])
- else nil
+ else defaults[:webserv_path]
end
else @@man_path
end
diff --git a/lib/sisu/v2/texpdf.rb b/lib/sisu/v2/texpdf.rb
index 9aa82927..0d77d65b 100644
--- a/lib/sisu/v2/texpdf.rb
+++ b/lib/sisu/v2/texpdf.rb
@@ -568,6 +568,7 @@ module SiSU_TeX
\\chardef\\tilde="7E
\\definecolor{Light}{gray}{.92}
\\newcommand{\\Codeblock}[1]{\\normaltext\\raggedright\\tiny\\ttfamily\\texbackslash#1}
+\\newcommand{\\monosp}[1]{\\normaltext\\ttfamily\\texbackslash#1}
% \\sloppy
\\begin{document}
WOK
diff --git a/lib/sisu/v2/texpdf_format.rb b/lib/sisu/v2/texpdf_format.rb
index 637271a0..4e489466 100644
--- a/lib/sisu/v2/texpdf_format.rb
+++ b/lib/sisu/v2/texpdf_format.rb
@@ -1064,7 +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 } ')
+ str.gsub!(/#{Mx[:fa_monospace_o]}(.+?)#{Mx[:fa_monospace_c]}/,'\begin{monosp}\1\end{monosp}')
unless is=='code'
str.gsub!(/"(.+?)"/,'“\1”') # quote marks / quotations open & close " need condition exclude for code
str.gsub!(/\s+"/,' “') # open "