aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v4/manifest.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2013-08-08 00:19:39 -0400
committerRalph Amissah <ralph@amissah.com>2013-08-08 00:19:45 -0400
commit2635b72eaa5e22cc7f16a43aa292c22496f7c19c (patch)
tree0ea520ea857cfce09a55bb3adb0cac26d30394ed /lib/sisu/v4/manifest.rb
parentv5: output structure by, multilingual, monolingual filenames tweak (diff)
v4: merge v5 lib (5.0.10)sisu_4.1.10
* output structure by, add monolingual alt for :filetype & :filename, step 1 * output structure by, monolingual alternative for :filetype or :filename without language code, if document is in default language * set a default language, 'en' or as specified * set in rc file or from command line instruction * command line e.g. sisu -hv --monolingual --by-filename sisu_markup.sst sisu -3v --monolingual --by-filetype sisu_manual.ssm * sisurc.yml lingual: 'mono' | 'multi' lingual: 'mono' * note: output by :filetype is roughly equivalent to what monolingual output by :language would be * allow command line setting of default language using language code --default-language='en' --default-lang-en if used together with --monolingual and --by-filetype or --by-filename the selected default language document will not have a language code in the output filename * output structure by, monolingual alternative, documentation * cgi helper script, sample search form, single form, monolingual option * single cgi form, (with different internal variables set for output types)
Diffstat (limited to 'lib/sisu/v4/manifest.rb')
-rw-r--r--lib/sisu/v4/manifest.rb22
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/sisu/v4/manifest.rb b/lib/sisu/v4/manifest.rb
index 600b33d1..ba5a0556 100644
--- a/lib/sisu/v4/manifest.rb
+++ b/lib/sisu/v4/manifest.rb
@@ -176,27 +176,29 @@ module SiSU_Manifest
mp,mn,mt,mr=nil,nil,nil,nil
ln=SiSU_i18n::Languages.new.language.list
Px[:lng_lst].each do |lc|
+ lngc=SiSU_Env::FilenameLanguageCodeInsert.new(@md.opt,lc).language_code_insert
+ fnh={
+ fn: @md.fnb,
+ lng: lngc,
+ }
+ mn=@f.base_filename.manifest(fnh)
if @o_str.dump_or_redirect? #does not work for --redirect or --dump
mp="#{@f.output_path.base.dir}"
- mn="#{@md.fnb}.html"
mt="#{mp}/#{mn}"
mr="../../#{lc}/manifest/#{mn}"
mu="#{url}/#{mn}"
elsif @f.output_dir_structure.by_language_code?
mp="#{@f.output_path.base.dir}/#{lc}/manifest"
- mn="#{@md.fnb}.html"
mt="#{mp}/#{mn}"
mr="../../#{lc}/manifest/#{mn}"
mu="#{url}/#{lc}/manifest/#{mn}"
elsif @f.output_dir_structure.by_filetype?
mp="#{@f.output_path.base.dir}/manifest"
- mn="#{@md.fnb}.#{lc}.html"
mt="#{mp}/#{mn}"
mr=mn
mu="#{url}/manifest/#{mn}"
else
mp="#{@f.output_path.base.dir}/#{@md.fnb}"
- mn="sisu_manifest.#{lc}.html"
mt="#{mp}/#{mn}"
mr=mn
mu="#{url}/#{mn}"
@@ -211,18 +213,16 @@ module SiSU_Manifest
@m=@m.uniq
end
def languages(id,file)
- flv=published_manifests?
@manifest[:html] << %{<tr><th class="left"><div id="horizontal_links"><ul id="horizontal">\n}
- flv.each do |l|
+ published_manifests?.each do |l|
SiSU_Translate::Source.new(@md,@language,l[:n]).language_list
@manifest[:txt] << "#{l[:mu]} #{l[:l]}\n"
@manifest[:html] << %{<li class="norm"><a href="#{l[:rel]}">#{l[:l]}</a>&nbsp;&nbsp;&nbsp;</li>}
end
@manifest[:html] << %{</ul></div></th></tr>\n}
end
- def published_languages(id,file)
- flv=published_manifests?
- flv.each do |l|
+ def published_languages(id)
+ published_manifests?.each do |l|
@manifest[:txt] << "#{l[:mu]} #{l[:l]}\n"
@manifest[:html] << %{<tr><th class="left"><p class="bold"><a href="#{l[:mu]}">#{l[:l]}</a></p></th><td><p class="norm">#{l[:l]}</p><p class="tiny">#{@brace_url.xml_open}<a href="#{l[:mu]}">#{l[:mu]}</a>#{@brace_url.xml_close}</p></td><td class="right"><p class="right">&nbsp;</p></td></tr>\n}
end
@@ -445,8 +445,8 @@ module SiSU_Manifest
end
def language_versions
if FileTest.file?(@f.place_file.manifest.dir)==true
- id,file='Markup (SiSU source)',@md.fns
- published_languages(id,file)
+ id='Markup (SiSU source)'
+ published_languages(id)
end
end
def qrc_image