aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v4/dal_expand_insertions.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v4/dal_expand_insertions.rb')
-rw-r--r--lib/sisu/v4/dal_expand_insertions.rb139
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}"