aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v5/cgi_sql_common.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v5/cgi_sql_common.rb')
-rw-r--r--lib/sisu/v5/cgi_sql_common.rb113
1 files changed, 59 insertions, 54 deletions
diff --git a/lib/sisu/v5/cgi_sql_common.rb b/lib/sisu/v5/cgi_sql_common.rb
index b551d6c8..0944ab61 100644
--- a/lib/sisu/v5/cgi_sql_common.rb
+++ b/lib/sisu/v5/cgi_sql_common.rb
@@ -845,72 +845,77 @@ module SiSU_CGI_SQL
@hostpath="#{@hosturl_files}/#{@stub}"
WOK_SQL
end
- def dir_structure
- case @opt.dir_structure_by
- when :language
- <<-'WOK_SQL'
- def path_manifest(fn,ln=nil)
- "#{@hostpath}/#{ln}/manifest/#{fn}.html"
- end
- def path_html_seg(fn,ln=nil)
- "#{@hostpath}/#{ln}/html/#{fn}"
- end
- def path_toc(fn,ln=nil)
- "#{path_html_seg(fn,ln)}/toc.html"
- end
- def path_filename(fn,seg,ln=nil)
- "#{path_html_seg(fn,ln)}/#{seg}.html"
- end
- def path_endnotes(fn,ln=nil)
- "#{path_html_seg(fn,ln)}/endnotes.html"
- end
- def path_html_doc(fn,ln=nil)
- "#{@hostpath}/#{ln}/html/#{fn}.html"
- end
- WOK_SQL
- when :filetype
- <<-'WOK_SQL'
- def path_manifest(fn,ln=nil)
- "#{@hostpath}/manifest/#{fn}.#{ln}.html"
- end
- def path_html_seg(fn,ln=nil)
- "#{@hostpath}/html/#{fn}"
- end
- def path_toc(fn,ln=nil)
- "#{path_html_seg(fn,ln)}/toc.#{ln}.html"
- end
- def path_filename(fn,seg,ln=nil)
- "#{path_html_seg(fn,ln)}/#{seg}.#{ln}.html"
- end
- def path_endnotes(fn,ln=nil)
- "#{path_html_seg(fn,ln)}/endnotes.#{ln}.html"
- end
- def path_html_doc(fn,ln=nil)
- "#{@hostpath}/html/#{fn}.#{ln}.html"
- end
- WOK_SQL
- else
- <<-'WOK_SQL'
+ def dir_structure #@opt.dir_structure_by
+ <<-'WOK_SQL'
def path_manifest(fn,ln=nil)
- "#{@hostpath}/#{fn}/sisu_manifest.#{ln}.html"
+ 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
def path_html_seg(fn,ln=nil)
- "#{@hostpath}/#{fn}"
+ case @output_dir_structure_by
+ when 'filename'
+ "#{@hostpath}/#{fn}"
+ when 'filetype'
+ "#{@hostpath}/html/#{fn}"
+ else
+ "#{@hostpath}/#{ln}/html/#{fn}"
+ end
end
def path_toc(fn,ln=nil)
- "#{path_html_seg(fn,ln)}/toc.#{ln}.html"
+ 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,ln=nil)
- "#{path_html_seg(fn,ln)}/#{seg}.#{ln}.html"
+ if @output_dir_structure_by =='filename' \
+ or @output_dir_structure_by =='filetype'
+ @lingual =='mono' \
+ ? "#{path_html_seg(fn,ln)}/#{seg}.html"
+ : "#{path_html_seg(fn,ln)}/#{seg}.#{ln}.html"
+ else
+ "#{path_html_seg(fn,ln)}/#{seg}.html"
+ end
end
def path_endnotes(fn,ln=nil)
- "#{path_html_seg(fn,ln)}/endnotes.#{ln}.html"
+ if @output_dir_structure_by =='filename' \
+ or @output_dir_structure_by =='filetype'
+ @lingual =='mono' \
+ ? "#{path_html_seg(fn,ln)}/endnotes.html"
+ : "#{path_html_seg(fn,ln)}/endnotes.#{ln}.html"
+ else
+ "#{path_html_seg(fn,ln)}/endnotes.html"
+ end
end
def path_html_doc(fn,ln=nil)
- "#{path_html_seg(fn,ln)}/scroll.#{ln}.html"
+ 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
- WOK_SQL
- end
+ WOK_SQL
end
def main3
<<-'WOK_SQL'