From b00b98bbfc0d254b6949bd7f9da52d4be14b36f0 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 9 Jul 2010 11:02:28 -0400 Subject: dal, manifest & metadata headings, non-substantive, ocn removed --- lib/sisu/v2/dal_doc_str.rb | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'lib') 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) -- cgit v1.2.3 From 788e0a8bb4c7259a0a5b6d85df4cc3c4ef0280cd Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 9 Jul 2010 11:42:50 -0400 Subject: html_scroll, deals with index & endnotes --- lib/sisu/v2/html_scroll.rb | 44 ++++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 18 deletions(-) (limited to 'lib') 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') end - if defined? dob.name and dob.name =~/^metadata/ and dob.obj =~/Metadata/ - dob.obj.gsub!(/(Metadata)/,'\1') + 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") + '
' + @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!(/(\1(?:-\d+)?)<\/a>/,'\2') 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!(/(\1(?:-\d+)?)<\/a>/,'\2') - end - book_idx.join("\n") + '
' - elsif dob.is=='insert' and dob.obj=='Metadata' #use for metadata inject - metadata=Metadata::Summary.new(@md).xhtml.metadata end if dob =~// \ and dob =~/^(?:\^~\d+\s|)/ # hmmm re-adjusted 200507, for alt endnote which should again be matched ^~ ... not in response to problem though -- cgit v1.2.3 From 0e550ce034299ec718366c0e34c5ff7bb6c7ca54 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 9 Jul 2010 12:38:37 -0400 Subject: sysenv default output path fix --- lib/sisu/v2/sysenv.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') 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 -- cgit v1.2.3 From 07db68742ecf208143d68cbc9ca3e5d96b695e8f Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 9 Jul 2010 14:42:31 -0400 Subject: monospace (avoid url match false positive) --- lib/sisu/v2/dal_syntax.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib') 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, -- cgit v1.2.3 From 628f1f2ba1be897aecfb03a249450df93fc9b7d9 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 9 Jul 2010 14:51:13 -0400 Subject: texpdf, monospace fix --- lib/sisu/v2/texpdf.rb | 1 + lib/sisu/v2/texpdf_format.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') 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 " -- cgit v1.2.3