diff options
author | Ralph Amissah <ralph@amissah.com> | 2013-08-08 18:50:31 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2013-08-08 18:50:31 -0400 |
commit | fa544551111f3f102ec483570283239338f2bf74 (patch) | |
tree | cb758d39ab7a193b1353eba3926e070ae5f73a4c /lib | |
parent | v4 v5: version & changelog (diff) |
v4 v5: dal_expand_insertions, refinement for monolingual outputsisu_4.1.11
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sisu/v4/dal_expand_insertions.rb | 16 | ||||
-rw-r--r-- | lib/sisu/v5/dal_expand_insertions.rb | 16 |
2 files changed, 22 insertions, 10 deletions
diff --git a/lib/sisu/v4/dal_expand_insertions.rb b/lib/sisu/v4/dal_expand_insertions.rb index bfa9f7da..52deed0a 100644 --- a/lib/sisu/v4/dal_expand_insertions.rb +++ b/lib/sisu/v4/dal_expand_insertions.rb @@ -110,11 +110,10 @@ module SiSU_DAL_Insertions end 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}" + @base_path="#{@md.file.output_path.base.url}/#{lng}" def fnh { fn: @linked_doc, - ft: ft, } end def path_and_file(fn,pth) @@ -182,10 +181,12 @@ module SiSU_DAL_Insertions end def by_filetype(linked_doc,lng,src=nil) @linked_doc,@lng,@src=linked_doc,lng,src + @lc=SiSU_Env::FilenameLanguageCodeInsert.new(@md.opt,lng).language_code_insert @base_path="#{@md.file.output_path.base.url}" def fnh { fn: @linked_doc, + lng: @lc, } end def path_and_file(fn,pth) @@ -253,14 +254,18 @@ module SiSU_DAL_Insertions end def by_filename(linked_doc,lng,src=nil) @linked_doc,@lng,@src=linked_doc,lng,src + @lc=SiSU_Env::FilenameLanguageCodeInsert.new(@md.opt,lng).language_code_insert @base_path="#{@md.file.output_path.base.url}/#{@linked_doc}" def fnh { fn: @linked_doc, + lng: @lc, } end - def path_and_file(fn) - "#{@base_path}/#{fn}" + def path_and_file(fn,pth=nil) + (pth.nil?) \ + ? "#{@base_path}/#{fn}" + : "#{@base_path}/#{pth}/#{fn}" end def manifest fn=@md.file.base_filename.manifest(fnh) @@ -279,7 +284,8 @@ module SiSU_DAL_Insertions path_and_file(fn) 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 fn=@md.file.base_filename.pdf_l_a4(fnh) diff --git a/lib/sisu/v5/dal_expand_insertions.rb b/lib/sisu/v5/dal_expand_insertions.rb index d85910aa..ca234624 100644 --- a/lib/sisu/v5/dal_expand_insertions.rb +++ b/lib/sisu/v5/dal_expand_insertions.rb @@ -110,11 +110,10 @@ module SiSU_DAL_Insertions end 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}" + @base_path="#{@md.file.output_path.base.url}/#{lng}" def fnh { fn: @linked_doc, - ft: ft, } end def path_and_file(fn,pth) @@ -182,10 +181,12 @@ module SiSU_DAL_Insertions end def by_filetype(linked_doc,lng,src=nil) @linked_doc,@lng,@src=linked_doc,lng,src + @lc=SiSU_Env::FilenameLanguageCodeInsert.new(@md.opt,lng).language_code_insert @base_path="#{@md.file.output_path.base.url}" def fnh { fn: @linked_doc, + lng: @lc, } end def path_and_file(fn,pth) @@ -253,14 +254,18 @@ module SiSU_DAL_Insertions end def by_filename(linked_doc,lng,src=nil) @linked_doc,@lng,@src=linked_doc,lng,src + @lc=SiSU_Env::FilenameLanguageCodeInsert.new(@md.opt,lng).language_code_insert @base_path="#{@md.file.output_path.base.url}/#{@linked_doc}" def fnh { fn: @linked_doc, + lng: @lc, } end - def path_and_file(fn) - "#{@base_path}/#{fn}" + def path_and_file(fn,pth=nil) + (pth.nil?) \ + ? "#{@base_path}/#{fn}" + : "#{@base_path}/#{pth}/#{fn}" end def manifest fn=@md.file.base_filename.manifest(fnh) @@ -279,7 +284,8 @@ module SiSU_DAL_Insertions path_and_file(fn) 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 fn=@md.file.base_filename.pdf_l_a4(fnh) |