aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v3/sysenv.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2012-05-28 04:47:13 -0400
committerRalph Amissah <ralph@amissah.com>2012-05-28 04:47:45 -0400
commita8493b259f8d166708601bb431267c86f1d78193 (patch)
tree1634ebebde4ae34b6b9bdc23d7ca41a94e65bb0c /lib/sisu/v3/sysenv.rb
parentv3: documentation update, command line control of output dir structure (diff)
v3: css, ensure css available for generated content
* checks whether exists if not copies (for --init-site / --configure just copies, takes as a re-copy request)
Diffstat (limited to 'lib/sisu/v3/sysenv.rb')
-rw-r--r--lib/sisu/v3/sysenv.rb191
1 files changed, 127 insertions, 64 deletions
diff --git a/lib/sisu/v3/sysenv.rb b/lib/sisu/v3/sysenv.rb
index a28b4060..f699ee92 100644
--- a/lib/sisu/v3/sysenv.rb
+++ b/lib/sisu/v3/sysenv.rb
@@ -1737,47 +1737,6 @@ WOK
'./'
end
end
- def default_output_css
- if (@md.opt.opt_act[:dump][:bool] \
- && @md.opt.opt_act[:dump][:inst]) \
- || (@md.opt.opt_act[:redirect][:bool] \
- && @md.opt.opt_act[:redirect][:inst])
- './'
- elsif @env.output_dir_structure.by_language_code?
- '../../'
- elsif @env.output_dir_structure.by_filetype?
- '../'
- else
- '../'
- end
- end
- def html_scroll_css
- default_output_css
- end
- def xhtml_css
- default_output_css
- end
- def xml_css
- default_output_css
- end
- def html_seg_css
- if @env.output_dir_structure.by_language_code?
- '../../../'
- elsif @env.output_dir_structure.by_filetype?
- '../../'
- else
- '../'
- end
- end
- def manifest_css
- if @env.output_dir_structure.by_language_code?
- '../../_sisu/css'
- elsif @env.output_dir_structure.by_filetype?
- ''
- else
- '../'
- end
- end
self
end
def read_source_file(fns)
@@ -4024,6 +3983,86 @@ WOK
FileUtils::mkdir_p(@env.processing_path.dal) unless FileTest.directory?(@env.processing_path.dal)
FileUtils::mkdir_p(@env.processing_path.tune) unless FileTest.directory?(@env.processing_path.tune)
end
+ def path_rel_links
+ def html_scroll_2
+ if output_dir_structure.by_language_code?
+ '../../'
+ elsif output_dir_structure.by_filetype?
+ '../'
+ else
+ '../'
+ end
+ end
+ def html_seg_2
+ if output_dir_structure.by_language_code?
+ '../../../'
+ elsif output_dir_structure.by_filetype?
+ '../../'
+ else
+ '../'
+ end
+ end
+ def html_scroll_1
+ if output_dir_structure.by_language_code?
+ '../'
+ elsif output_dir_structure.by_filetype?
+ '../'
+ else
+ './'
+ end
+ end
+ def html_seg_1
+ if output_dir_structure.by_language_code?
+ '../../'
+ elsif output_dir_structure.by_filetype?
+ '../../'
+ else
+ './'
+ end
+ end
+ def default_output_css
+ if (@md.opt.opt_act[:dump][:bool] \
+ && @md.opt.opt_act[:dump][:inst]) \
+ || (@md.opt.opt_act[:redirect][:bool] \
+ && @md.opt.opt_act[:redirect][:inst])
+ './'
+ elsif output_dir_structure.by_language_code?
+ '../../'
+ elsif output_dir_structure.by_filetype?
+ '../'
+ else
+ '../'
+ end
+ end
+ def html_scroll_css
+ default_output_css
+ end
+ def xhtml_css
+ default_output_css
+ end
+ def xml_css
+ default_output_css
+ end
+ def html_seg_css
+ if output_dir_structure.by_language_code?
+ '../../../'
+ elsif output_dir_structure.by_filetype?
+ '../../'
+ else
+ '../'
+ end
+ end
+ def manifest_css
+ if output_dir_structure.by_language_code?
+ '../../_sisu/css'
+ elsif output_dir_structure.by_filetype?
+ ''
+ else
+ '../'
+ end
+ end
+ self
+ end
def mkdir
txt_path="#{output_path.base.dir}/#{@md.fnb}"
def output
@@ -5703,7 +5742,8 @@ WOK
"#{@md.doc_css}_html.css"
elsif FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@env.path.stub_pwd}_html.css")
"#{@env.path.stub_pwd}_html.css"
- else SiSU_Env::CSS_Default.new.html
+ else
+ SiSU_Env::CSS_Default.new.html
end
end
def html_tables
@@ -5894,28 +5934,51 @@ WOK
css=SiSU_Style::CSS.new
path_style="#{@env.path.output}/#{@env.path.style}"
FileUtils::mkdir_p(path_style) unless FileTest.directory?(path_style)
- style=File.new("#{path_style}/#{fn_css.homepage}",'w')
- style << css.homepage
- style.close
- style=File.new("#{path_style}/#{fn_css.html_tables}",'w')
- style << css.html_tables
- style.close
- style=File.new("#{path_style}/#{fn_css.html}",'w')
- style << css.html
- style.close
- style=File.new("#{path_style}/#{fn_css.xml_sax}",'w')
- style << css.xml_sax
- style.close
- style=File.new("#{path_style}/#{fn_css.xml_dom}",'w')
- style << css.xml_dom
- style=File.new("#{path_style}/#{fn_css.docbook_xml}",'w')
- style << css.docbook_xml
- style.close
- style=File.new("#{path_style}/#{fn_css.xhtml}",'w')
- style << css.xhtml
- style=File.new("#{path_style}/#{fn_css.harvest}",'w')
- style << css.harvest
- style.close
+ if @cmd =~/C/ \
+ or not FileTest.file?("#{path_style}/#{fn_css.homepage}")
+ style=File.new("#{path_style}/#{fn_css.homepage}",'w')
+ style << css.homepage
+ style.close
+ end
+ if @cmd =~/C/ \
+ or not FileTest.file?("#{path_style}/#{fn_css.html_tables}")
+ style=File.new("#{path_style}/#{fn_css.html_tables}",'w')
+ style << css.html_tables
+ style.close
+ end
+ if @cmd =~/C/ \
+ or not FileTest.file?("#{path_style}/#{fn_css.html}")
+ style=File.new("#{path_style}/#{fn_css.html}",'w')
+ style << css.html
+ style.close
+ end
+ if @cmd =~/C/ \
+ or not FileTest.file?("#{path_style}/#{fn_css.harvest}")
+ style=File.new("#{path_style}/#{fn_css.harvest}",'w')
+ style << css.harvest
+ style.close
+ end
+ if @cmd =~/C/ \
+ or (@cmd =~/[x]/ \
+ and not FileTest.file?("#{path_style}/#{fn_css.xml_sax}"))
+ style=File.new("#{path_style}/#{fn_css.xml_sax}",'w')
+ style << css.xml_sax
+ style.close
+ end
+ if @cmd =~/C/ \
+ or (@cmd =~/[X]/ \
+ and not FileTest.file?("#{path_style}/#{fn_css.xml_dom}"))
+ style=File.new("#{path_style}/#{fn_css.xml_dom}",'w')
+ style << css.xml_dom
+ style.close
+ end
+ if @cmd =~/C/ \
+ or (@cmd =~/[b]/ \
+ and not FileTest.file?("#{path_style}/#{fn_css.xhtml}"))
+ style=File.new("#{path_style}/#{fn_css.xhtml}",'w')
+ style << css.xhtml
+ style.close
+ end
end
end
end