diff options
author | Ralph Amissah <ralph@amissah.com> | 2013-08-08 00:26:51 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2013-08-08 00:26:51 -0400 |
commit | 6f88dbf16ce50d3ab246b79e16222447cb3ddfc6 (patch) | |
tree | a5b35b294f9278ce2c20179f8ceb0e8c65877640 /lib/sisu/v4/dal_expand_insertions.rb | |
parent | debian/changelog (4.1.9-1) (diff) | |
parent | v4: merge v5 lib (5.0.10) (diff) |
Merge tag 'sisu_4.1.10' into debian/sid
SiSU 4.1.10
Diffstat (limited to 'lib/sisu/v4/dal_expand_insertions.rb')
-rw-r--r-- | lib/sisu/v4/dal_expand_insertions.rb | 139 |
1 files changed, 101 insertions, 38 deletions
diff --git a/lib/sisu/v4/dal_expand_insertions.rb b/lib/sisu/v4/dal_expand_insertions.rb index 9a242b28..bfa9f7da 100644 --- a/lib/sisu/v4/dal_expand_insertions.rb +++ b/lib/sisu/v4/dal_expand_insertions.rb @@ -111,44 +111,66 @@ module SiSU_DAL_Insertions def by_language(linked_doc,lng,src=nil) @linked_doc,@lng,@src=linked_doc,lng,src @base_path="#{@md.file.output_path.base.url}/#{@lng}" + def fnh + { + fn: @linked_doc, + ft: ft, + } + end + def path_and_file(fn,pth) + "#{@base_path}/#{pth}/#{fn}" + end def manifest - "#{@base_path}/manifest/#{@linked_doc}.html" + fn=@md.file.base_filename.manifest(fnh) + path_and_file(fn,'manifest') end def html_toc - "#{@base_path}/html/#{@linked_doc}.html" + fn=@md.file.base_filename.html_segtoc(fnh) + "#{@base_path}/html/#{@linked_doc}/#{fn}" end def html_doc - "#{@base_path}/html/#{@linked_doc}.html" + fn=@md.file.base_filename.html_scroll(fnh) + path_and_file(fn,'html') end def html_concordance - "#{@base_path}/html/#{@linked_doc}.html" + fn=@md.file.base_filename.html_concordance + "#{@base_path}/html/#{@linked_doc}/#{fn}" end def epub - "#{@base_path}/epub/#{@linked_doc}.epub" + fn=@md.file.base_filename.epub(fnh) + path_and_file(fn,'epub') end def pdf_landscape - "#{@base_path}/pdf/#{@linked_doc}.pdf" + fn=@md.file.base_filename.pdf_l_a4(fnh) + path_and_file(fn,'pdf') end def pdf_portrait - "#{@base_path}/pdf/#{@linked_doc}.pdf" + fn=@md.file.base_filename.pdf_p_a4(fnh) + path_and_file(fn,'pdf') end def odt - "#{@base_path}/odt/#{@linked_doc}.odt" + fn=@md.file.base_filename.odt(fnh) + path_and_file(fn,'odt') end def xhtml - "#{@base_path}/xhtml/#{@linked_doc}.xhtml" + fn=@md.file.base_filename.xhtml(fnh) + path_and_file(fn,'xhtml') end def xml_sax - "#{@base_path}/xml/#{@linked_doc}.xml" + fn=@md.file.base_filename.xml_sax(fnh) + path_and_file(fn,'xml_sax') end def xml_dom - "#{@base_path}/xml/#{@linked_doc}.xml" + fn=@md.file.base_filename.xml_dom(fnh) + path_and_file(fn,'xml_dom') end def txt - "#{@base_path}/txt/#{@linked_doc}.txt" + fn=@md.file.base_filename.txt(fnh) + path_and_file(fn,'txt') end def digest - "#{@base_path}/digest/#{@linked_doc}.txt" + fn=@md.file.base_filename.hash_digest(fnh) + path_and_file(fn,'digest') end def source "#{@base_path}/src/#{@src}" @@ -161,44 +183,65 @@ module SiSU_DAL_Insertions def by_filetype(linked_doc,lng,src=nil) @linked_doc,@lng,@src=linked_doc,lng,src @base_path="#{@md.file.output_path.base.url}" + def fnh + { + fn: @linked_doc, + } + end + def path_and_file(fn,pth) + "#{@base_path}/#{pth}/#{fn}" + end def manifest - "#{@base_path}/manifest/#{@linked_doc}.#{@lng}.html" + fn=@md.file.base_filename.manifest(fnh) + path_and_file(fn,'manifest') end def html_toc - "#{@base_path}/html/#{@linked_doc}.#{@lng}.html" + fn=@md.file.base_filename.html_segtoc(fnh) + path_and_file(fn,'html') end def html_doc - "#{@base_path}/html/#{@linked_doc}.#{@lng}.html" + fn=@md.file.base_filename.html_scroll(fnh) + path_and_file(fn,'html') end def html_concordance - "#{@base_path}/html/#{@linked_doc}.#{@lng}.html" + fn=@md.file.base_filename.html_concordance + path_and_file(fn,'html') end def epub - "#{@base_path}/epub/#{@linked_doc}.#{@lng}.epub" + fn=@md.file.base_filename.epub(fnh) + path_and_file(fn,'epub') end def pdf_landscape - "#{@base_path}/pdf/#{@linked_doc}.#{@lng}.pdf" + fn=@md.file.base_filename.pdf_l_a4(fnh) + path_and_file(fn,'pdf') end def pdf_portrait - "#{@base_path}/pdf/#{@linked_doc}.#{@lng}.pdf" + fn=@md.file.base_filename.pdf_p_a4(fnh) + path_and_file(fn,'pdf') end def odt - "#{@base_path}/odt/#{@linked_doc}.#{@lng}.odt" + fn=@md.file.base_filename.odt(fnh) + path_and_file(fn,'odt') end def xhtml - "#{@base_path}/xhtml/#{@linked_doc}.#{@lng}.xhtml" + fn=@md.file.base_filename.xhtml(fnh) + path_and_file(fn,'xhtml') end def xml_sax - "#{@base_path}/xml_sax/#{@linked_doc}.#{@lng}.xml" + fn=@md.file.base_filename.xml_sax(fnh) + path_and_file(fn,'xml_sax') end def xml_dom - "#{@base_path}/xml_dom/#{@linked_doc}.#{@lng}.xml" + fn=@md.file.base_filename.xml_dom(fnh) + path_and_file(fn,'xml_dom') end def txt - "#{@base_path}/txt/#{@linked_doc}.#{@lng}.txt" + fn=@md.file.base_filename.txt(fnh) + path_and_file(fn,'txt') end def digest - "#{@base_path}/digest/#{@linked_doc}.#{@lng}.txt" + fn=@md.file.base_filename.hash_digest(fnh) + path_and_file(fn,'digest') end def source "#{@base_path}/src/#{@src}" @@ -211,44 +254,64 @@ module SiSU_DAL_Insertions def by_filename(linked_doc,lng,src=nil) @linked_doc,@lng,@src=linked_doc,lng,src @base_path="#{@md.file.output_path.base.url}/#{@linked_doc}" + def fnh + { + fn: @linked_doc, + } + end + def path_and_file(fn) + "#{@base_path}/#{fn}" + end def manifest - "#{@base_path}/sisu_manifest.#{@lng}.html" + fn=@md.file.base_filename.manifest(fnh) + path_and_file(fn) end def html_toc - "#{@base_path}/toc.#{@lng}.html" + fn=@md.file.base_filename.html_segtoc(fnh) + path_and_file(fn) end def html_doc - "#{@base_path}/scroll.#{@lng}.html" + fn=@md.file.base_filename.html_scroll(fnh) + path_and_file(fn) end def html_concordance - "#{@base_path}/concordance.#{@lng}.html" + fn=@md.file.base_filename.html_concordance + path_and_file(fn) end def epub "#{@base_path}/epub/#{@linked_doc}.#{@lng}.epub" end def pdf_landscape - "#{@base_path}/landscape.#{@lng}.a4.pdf" + fn=@md.file.base_filename.pdf_l_a4(fnh) + path_and_file(fn) end def pdf_portrait - "#{@base_path}/portrait.#{@lng}.a4.pdf" + fn=@md.file.base_filename.pdf_p_a4(fnh) + path_and_file(fn) end def odt - "#{@base_path}/opendocument.#{@lng}.odt" + fn=@md.file.base_filename.odt(fnh) + path_and_file(fn) end def xhtml - "#{@base_path}/scroll.#{@lng}.xhtml" + fn=@md.file.base_filename.xhtml(fnh) + path_and_file(fn) end def xml_sax - "#{@base_path}/scroll.#{@lng}.sax.xml" + fn=@md.file.base_filename.xml_sax(fnh) + path_and_file(fn) end def xml_dom - "#{@base_path}/scroll.#{@lng}.dom.xml" + fn=@md.file.base_filename.xml_dom(fnh) + path_and_file(fn) end def txt - "#{@base_path}/plain.#{@lng}.txt" + fn=@md.file.base_filename.txt(fnh) + path_and_file(fn) end def digest - "#{@base_path}/digest.#{@lng}.txt" + fn=@md.file.base_filename.hash_digest(fnh) + path_and_file(fn) end def source "#{@base_path}/#{@src}" |