aboutsummaryrefslogtreecommitdiffhomepage
path: root/sundry/misc/util/rb
diff options
context:
space:
mode:
Diffstat (limited to 'sundry/misc/util/rb')
-rwxr-xr-xsundry/misc/util/rb/cgi/spine.search.cgi174
-rwxr-xr-xsundry/misc/util/rb/tex/dr_tex.rb102
2 files changed, 139 insertions, 137 deletions
diff --git a/sundry/misc/util/rb/cgi/spine.search.cgi b/sundry/misc/util/rb/cgi/spine.search.cgi
index ff2bfc2..9184847 100755
--- a/sundry/misc/util/rb/cgi/spine.search.cgi
+++ b/sundry/misc/util/rb/cgi/spine.search.cgi
@@ -44,7 +44,7 @@
* Standard SiSU meta-markup syntax, and the
* Standard SiSU object citation numbering and system
- * Hompages:
+ * Homepages:
<https://www.sisudoc.org>
* Ralph Amissah
@@ -739,99 +739,99 @@ FCGI.each_cgi do |cgi|
<b>search string:</b> "#{green}#{analyze_format}</font>"<br />
#{p_text} #{p_fulltext} #{p_keywords} #{p_title} #{p_author} #{p_topic_register} #{p_subject} #{p_description} #{p_publisher} #{p_editor} #{p_contributor} #{p_date} #{p_type} #{p_format} #{p_identifier} #{p_source} #{p_language} #{p_relation} #{p_coverage} #{p_rights} #{p_comment} #{p_abstract} #{p_filename}
</font>
- WOK
- #eg = %{canned search e.g.:<br /> <a href="#{url}">#{url}</a><br />find: #{analyze}<br />database: #{database}}
- #% dbi_canning
- @header = Form.new(@base,search_field,selected_db,result_type,checked_sql_limit,checked_tip,checked_stats,checked_searched,checked_url,checked_case,checked_echo,checked_sql,checked_all,checked_none,checked_selected,checked_default,search_note,the_can).submission_form #% form
- unless q['s1'] =~/\S/ or q['au'] =~/\S/ or @search[:text][1] =~/\S/
- print "Content-type: text/html\n\n"
- puts (@header+@tail)
- else #% searches
- s1=(@search_for.text1 =~/\S/) \
- ? @search_for.text1
- : 'Unavailable'
- if checked_case=~/\S/
- @search[:text]<<%{doc_objects.clean~'#{CGI.unescape(s1)}'}
- else
- @search[:text]<<%{doc_objects.clean~*'#{CGI.unescape(s1)}'}
- end
- #% dbi_request
- dbi_statement=DBI_SearchStatement.new(@conn,@search_for,q,checked_case)
- @text_search_flag=false
- @text_search_flag=dbi_statement.text_search_flag
- s_contents=dbi_statement.contents
- @body_main=''
- @search_regx=nil
- olduid=""
- if @text_search_flag
- if checked_sql =~/\S/
- sql_select_body=dbi_statement.sql_select_body_format
- else sql_select_body=''
- end
- @body_main << sql_select_body
- #@body_main << '<p><hr><br /><b>Main Text:</b><br />' << sql_select_body
- else
- end
- @hostpath = "#{@hosturl_files}"
- #@hostpath="#{@hosturl_files}/#{@stub}"
- def path_manifest(fn,ln=nil)
- case @output_dir_structure_by
- when 'filename'
- @lingual =='mono' \
- ? "#{@hostpath}/#{fn}/sisu_manifest.html"
- : "#{@hostpath}/#{fn}/sisu_manifest.#{ln}.html"
- when 'filetype'
- @lingual =='mono' \
- ? "#{@hostpath}/manifest/#{fn}.html"
- : "#{@hostpath}/manifest/#{fn}.#{ln}.html"
+ WOK
+ #eg = %{canned search e.g.:<br /> <a href="#{url}">#{url}</a><br />find: #{analyze}<br />database: #{database}}
+ #% dbi_canning
+ @header = Form.new(@base,search_field,selected_db,result_type,checked_sql_limit,checked_tip,checked_stats,checked_searched,checked_url,checked_case,checked_echo,checked_sql,checked_all,checked_none,checked_selected,checked_default,search_note,the_can).submission_form #% form
+ unless q['s1'] =~/\S/ or q['au'] =~/\S/ or @search[:text][1] =~/\S/
+ print "Content-type: text/html\n\n"
+ puts (@header+@tail)
+ else #% searches
+ s1=(@search_for.text1 =~/\S/) \
+ ? @search_for.text1
+ : 'Unavailable'
+ if checked_case=~/\S/
+ @search[:text]<<%{doc_objects.clean~'#{CGI.unescape(s1)}'}
else
- "#{@hostpath}/#{ln}/manifest/#{fn}.html"
+ @search[:text]<<%{doc_objects.clean~*'#{CGI.unescape(s1)}'}
end
- end
- def path_html_seg(fn,ln=nil)
- case @output_dir_structure_by
- when 'filename'
- "#{@hostpath}/#{fn}"
- when 'filetype'
- "#{@hostpath}/html/#{fn}"
+ #% dbi_request
+ dbi_statement=DBI_SearchStatement.new(@conn,@search_for,q,checked_case)
+ @text_search_flag=false
+ @text_search_flag=dbi_statement.text_search_flag
+ s_contents=dbi_statement.contents
+ @body_main=''
+ @search_regx=nil
+ olduid=""
+ if @text_search_flag
+ if checked_sql =~/\S/
+ sql_select_body=dbi_statement.sql_select_body_format
+ else sql_select_body=''
+ end
+ @body_main << sql_select_body
+ #@body_main << '<p><hr><br /><b>Main Text:</b><br />' << sql_select_body
else
- "#{@hostpath}/#{ln}/html/#{fn}"
end
- end
- def path_toc(fn,ln=nil)
- if @output_dir_structure_by =='filename' \
- or @output_dir_structure_by =='filetype'
- @lingual =='mono' \
- ? "#{path_html_seg(fn,ln)}/toc.html"
- : "#{path_html_seg(fn,ln)}/toc.#{ln}.html"
- else
- "#{path_html_seg(fn,ln)}/toc.html"
+ @hostpath = "#{@hosturl_files}"
+ #@hostpath="#{@hosturl_files}/#{@stub}"
+ def path_manifest(fn,ln=nil)
+ case @output_dir_structure_by
+ when 'filename'
+ @lingual =='mono' \
+ ? "#{@hostpath}/#{fn}/sisu_manifest.html"
+ : "#{@hostpath}/#{fn}/sisu_manifest.#{ln}.html"
+ when 'filetype'
+ @lingual =='mono' \
+ ? "#{@hostpath}/manifest/#{fn}.html"
+ : "#{@hostpath}/manifest/#{fn}.#{ln}.html"
+ else
+ "#{@hostpath}/#{ln}/manifest/#{fn}.html"
+ end
end
- end
- def path_filename(fn,seg_name,ln=nil)
- if @output_dir_structure_by =='filename' \
- or @output_dir_structure_by =='filetype'
- @lingual =='mono' \
- ? "#{path_html_seg(fn,ln)}/#{seg_name}.html"
- : "#{path_html_seg(fn,ln)}/#{seg_name}.#{ln}.html"
- else
- "#{path_html_seg(fn,ln)}/#{seg_name}.html"
+ def path_html_seg(fn,ln=nil)
+ case @output_dir_structure_by
+ when 'filename'
+ "#{@hostpath}/#{fn}"
+ when 'filetype'
+ "#{@hostpath}/html/#{fn}"
+ else
+ "#{@hostpath}/#{ln}/html/#{fn}"
+ end
end
- end
- def path_html_doc(fn,ln=nil)
- case @output_dir_structure_by
- when 'filename'
- @lingual =='mono' \
- ? "#{path_html_seg(fn,ln)}/scroll.html"
- : "#{path_html_seg(fn,ln)}/scroll.#{ln}.html"
- when 'filetype'
- @lingual =='mono' \
- ? "#{@hostpath}/html/#{fn}.html"
- : "#{@hostpath}/html/#{fn}.#{ln}.html"
- else
- "#{@hostpath}/#{ln}/html/#{fn}.html"
+ def path_toc(fn,ln=nil)
+ if @output_dir_structure_by =='filename' \
+ or @output_dir_structure_by =='filetype'
+ @lingual =='mono' \
+ ? "#{path_html_seg(fn,ln)}/toc.html"
+ : "#{path_html_seg(fn,ln)}/toc.#{ln}.html"
+ else
+ "#{path_html_seg(fn,ln)}/toc.html"
+ end
+ end
+ def path_filename(fn,seg_name,ln=nil)
+ if @output_dir_structure_by =='filename' \
+ or @output_dir_structure_by =='filetype'
+ @lingual =='mono' \
+ ? "#{path_html_seg(fn,ln)}/#{seg_name}.html"
+ : "#{path_html_seg(fn,ln)}/#{seg_name}.#{ln}.html"
+ else
+ "#{path_html_seg(fn,ln)}/#{seg_name}.html"
+ end
+ end
+ def path_html_doc(fn,ln=nil)
+ case @output_dir_structure_by
+ when 'filename'
+ @lingual =='mono' \
+ ? "#{path_html_seg(fn,ln)}/scroll.html"
+ : "#{path_html_seg(fn,ln)}/scroll.#{ln}.html"
+ when 'filetype'
+ @lingual =='mono' \
+ ? "#{@hostpath}/html/#{fn}.html"
+ : "#{@hostpath}/html/#{fn}.#{ln}.html"
+ else
+ "#{@hostpath}/#{ln}/html/#{fn}.html"
+ end
end
- end
#% text_objects_body
s_contents.each do |c| #% text body
location=c['src_filename_base'][/(.+?)\.(?:ssm\.sst|sst)$/,1]
diff --git a/sundry/misc/util/rb/tex/dr_tex.rb b/sundry/misc/util/rb/tex/dr_tex.rb
index f310735..bb4ec7d 100755
--- a/sundry/misc/util/rb/tex/dr_tex.rb
+++ b/sundry/misc/util/rb/tex/dr_tex.rb
@@ -1,54 +1,56 @@
#!/usr/bin/env ruby
-# /+
-# - Name: Spine, Doc Reform [a part of]
-# - Description: documents, structuring, processing, publishing, search
-# - static content generator
-#
-# - Author: Ralph Amissah
-# [ralph.amissah@gmail.com]
-#
-# - Copyright: (C) 2015 - 2021 Ralph Amissah, All Rights
-# Reserved.
-#
-# - License: AGPL 3 or later:
-#
-# Spine (SiSU), a framework for document structuring, publishing and
-# search
-#
-# Copyright (C) Ralph Amissah
-#
-# This program is free software: you can redistribute it and/or modify it
-# under the terms of the GNU AFERO General Public License as published by the
-# Free Software Foundation, either version 3 of the License, or (at your
-# option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-# more details.
-#
-# You should have received a copy of the GNU General Public License along with
-# this program. If not, see [https://www.gnu.org/licenses/].
-#
-# If you have Internet connection, the latest version of the AGPL should be
-# available at these locations:
-# [https://www.fsf.org/licensing/licenses/agpl.html]
-# [https://www.gnu.org/licenses/agpl.html]
-#
-# - Spine (by Doc Reform, related to SiSU) uses standard:
-# - docReform markup syntax
-# - standard SiSU markup syntax with modified headers and minor modifications
-# - docReform object numbering
-# - standard SiSU object citation numbering & system
-#
-# - Homepages:
-# [https://www.doc_reform.org]
-# [https://www.sisudoc.org]
-#
-# - Git
-# [https://git.sisudoc.org/projects/?p=software/spine.git;a=summary]
-#
-# +/
+=begin
+/+
+- Name: Spine, Doc Reform [a part of]
+ - Description: documents, structuring, processing, publishing, search
+ - static content generator
+
+ - Author: Ralph Amissah
+ [ralph.amissah@gmail.com]
+
+ - Copyright: (C) 2015 - 2021 Ralph Amissah, All Rights
+ Reserved.
+
+ - License: AGPL 3 or later:
+
+ Spine (SiSU), a framework for document structuring, publishing and
+ search
+
+ Copyright (C) Ralph Amissah
+
+ This program is free software: you can redistribute it and/or modify it
+ under the terms of the GNU AFERO General Public License as published by the
+ Free Software Foundation, either version 3 of the License, or (at your
+ option) any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program. If not, see [https://www.gnu.org/licenses/].
+
+ If you have Internet connection, the latest version of the AGPL should be
+ available at these locations:
+ [https://www.fsf.org/licensing/licenses/agpl.html]
+ [https://www.gnu.org/licenses/agpl.html]
+
+ - Spine (by Doc Reform, related to SiSU) uses standard:
+ - docReform markup syntax
+ - standard SiSU markup syntax with modified headers and minor modifications
+ - docReform object numbering
+ - standard SiSU object citation numbering & system
+
+ - Homepages:
+ [https://www.doc_reform.org]
+ [https://www.sisudoc.org]
+
+ - Git
+ [https://git.sisudoc.org/projects/?p=software/spine.git;a=summary]
+
++/
+=end
require 'fileutils'
pwd = Dir.pwd
argv,texfiles_with_path,flags=[],[],[]