From 2635b72eaa5e22cc7f16a43aa292c22496f7c19c Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 8 Aug 2013 00:19:39 -0400 Subject: v4: merge v5 lib (5.0.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) --- lib/sisu/v4/html.rb | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'lib/sisu/v4/html.rb') diff --git a/lib/sisu/v4/html.rb b/lib/sisu/v4/html.rb index 210bc0b3..d4987c4d 100644 --- a/lib/sisu/v4/html.rb +++ b/lib/sisu/v4/html.rb @@ -418,14 +418,21 @@ WOK linkname,ocn=dob.obj.strip,dob.ocn p_num=SiSU_HTML_Format::ParagraphNumber.new(@md,ocn) if ocn if dob.ln ==4 - seg_link=%{ + fnh={ + fn: dob.name, + } + f=@md.file.base_filename.html_seg(fnh) + seg_link=%{ #{dob.obj} } @@seg_url=dob.name elsif dob.obj =~/\d+.\d+.\d+.\d+|\d+.\d+.\d+|\d+.\d+|\d+/ - seg_link=dob.obj.gsub(/^(\d+.\d+.\d+.\d+|\d+.\d+.\d+|\d+.\d+|\d+)(.*)/, - %{\\1 \\2 }) + fn,hd=/^(\d+.\d+.\d+.\d+|\d+.\d+.\d+|\d+.\d+|\d+)(.*)/.match(dob.obj)[1,2] + fnh={ + fn: fn, + } + f=@md.file.base_filename.html_seg(fnh) + seg_link=%{#{fn} #{hd} } end p_num=SiSU_HTML_Format::ParagraphNumber.new(@md,ocn) if ocn @file=SiSU_Env::FileOp.new(@md) if @md @@ -459,8 +466,12 @@ WOK toc={} if ocn \ and ocn !~/#/ + fnh={ + fn: @@seg_url, + } + f=@md.file.base_filename.html_seg(fnh) p_num=SiSU_HTML_Format::ParagraphNumber.new(@md,ocn) - lnk_n_txt=%{ + lnk_n_txt=%{ #{linkname} } txt_obj={ txt: lnk_n_txt } @@ -480,8 +491,12 @@ WOK toc={} if ocn \ and ocn !~/#/ + fnh={ + fn: @@seg_url, + } + f=@md.file.base_filename.html_seg(fnh) p_num=SiSU_HTML_Format::ParagraphNumber.new(@md,ocn) - lnk_n_txt=%{ + lnk_n_txt=%{ #{linkname} } txt_obj={ txt: lnk_n_txt } -- cgit v1.2.3