diff options
| -rw-r--r-- | data/doc/sisu/CHANGELOG_v3 | 4 | ||||
| -rw-r--r-- | lib/sisu/v3/concordance.rb | 1 | ||||
| -rw-r--r-- | lib/sisu/v3/harvest.rb | 11 | ||||
| -rw-r--r-- | lib/sisu/v3/html.rb | 6 | ||||
| -rw-r--r-- | lib/sisu/v3/manifest.rb | 3 | ||||
| -rw-r--r-- | lib/sisu/v3/sysenv.rb | 191 | ||||
| -rw-r--r-- | lib/sisu/v3/xhtml.rb | 1 | ||||
| -rw-r--r-- | lib/sisu/v3/xml.rb | 1 | ||||
| -rw-r--r-- | lib/sisu/v3/xml_dom.rb | 1 | 
9 files changed, 150 insertions, 69 deletions
| diff --git a/data/doc/sisu/CHANGELOG_v3 b/data/doc/sisu/CHANGELOG_v3 index 859ace6a..90d3fbd6 100644 --- a/data/doc/sisu/CHANGELOG_v3 +++ b/data/doc/sisu/CHANGELOG_v3 @@ -32,6 +32,10 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_3.2.10.orig.tar.xz    --by-language; --by-filetype; --by-filename    * documentation update sisu_commands.ssi, manpage sisu.1, man2html +* v3: css, ensure css available for generated content (without need for +  --init-site / --configure), checks whether exists if not copies (for +  --init-site / --configure just copies, takes as a re-copy request) +  %% 3.2.9.orig.tar.xz (2012-05-19:20/6)  http://git.sisudoc.org/?p=code/sisu.git;a=log;h=refs/tags/sisu_3.2.9  http://git.sisudoc.org/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_3.2.9-1 diff --git a/lib/sisu/v3/concordance.rb b/lib/sisu/v3/concordance.rb index 12968935..2a3b585a 100644 --- a/lib/sisu/v3/concordance.rb +++ b/lib/sisu/v3/concordance.rb @@ -99,6 +99,7 @@ module SiSU_Concordance            __LINE__.to_s + ':' + __FILE__          end        ensure +        SiSU_Env::CreateSite.new(@opt.cmd).cp_css        end      end      private diff --git a/lib/sisu/v3/harvest.rb b/lib/sisu/v3/harvest.rb index 4ce5a09b..ea967c37 100644 --- a/lib/sisu/v3/harvest.rb +++ b/lib/sisu/v3/harvest.rb @@ -70,9 +70,14 @@ module SiSU_Harvest        @env=SiSU_Env::InfoEnv.new      end      def read -      harvest_pth="#{@env.path.webserv}/#{@opt.base_stub}" -      FileUtils::mkdir_p(harvest_pth) unless FileTest.directory?(harvest_pth) -      cases(@opt,@env) +      begin +        harvest_pth="#{@env.path.webserv}/#{@opt.base_stub}" +        FileUtils::mkdir_p(harvest_pth) unless FileTest.directory?(harvest_pth) +        cases(@opt,@env) +      rescue +      ensure +        SiSU_Env::CreateSite.new(@opt.cmd).cp_css +      end      end      def help        puts <<WOK diff --git a/lib/sisu/v3/html.rb b/lib/sisu/v3/html.rb index 4babb617..46f051c6 100644 --- a/lib/sisu/v3/html.rb +++ b/lib/sisu/v3/html.rb @@ -77,7 +77,11 @@ module SiSU_HTML        @particulars=SiSU_Particulars::CombinedSingleton.instance.get_all(opt)      end      def read -      songsheet +      begin +        songsheet +      ensure +        SiSU_Env::CreateSite.new(@opt.cmd).cp_css +      end      end      def songsheet        begin diff --git a/lib/sisu/v3/manifest.rb b/lib/sisu/v3/manifest.rb index 17b0283f..4d51d76c 100644 --- a/lib/sisu/v3/manifest.rb +++ b/lib/sisu/v3/manifest.rb @@ -97,6 +97,7 @@ module SiSU_Manifest            __LINE__.to_s + ':' + __FILE__          end        ensure +        SiSU_Env::CreateSite.new(@opt.cmd).cp_css        end      end      private @@ -837,7 +838,7 @@ WOK    <a href="#metadata">Document Metadata</a>  </p>  <p class="tiny"> -      <a href="#links">(metadata suggested links (if any)</a> +      <a href="#links">metadata suggested links (if any)</a>  </p>  <table summary="normal text css" width="100%" border="0" bgcolor="white" cellpadding="2" align="center">  WOK 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 diff --git a/lib/sisu/v3/xhtml.rb b/lib/sisu/v3/xhtml.rb index 98b445a6..e73b97b7 100644 --- a/lib/sisu/v3/xhtml.rb +++ b/lib/sisu/v3/xhtml.rb @@ -99,6 +99,7 @@ module SiSU_XHTML            __LINE__.to_s + ':' + __FILE__          end        ensure +        SiSU_Env::CreateSite.new(@opt.cmd).cp_css        end      end      private diff --git a/lib/sisu/v3/xml.rb b/lib/sisu/v3/xml.rb index 65a9beee..1346f33e 100644 --- a/lib/sisu/v3/xml.rb +++ b/lib/sisu/v3/xml.rb @@ -98,6 +98,7 @@ module SiSU_XML_SAX          end        ensure          #file closed in songsheet +        SiSU_Env::CreateSite.new(@opt.cmd).cp_css        end      end      private diff --git a/lib/sisu/v3/xml_dom.rb b/lib/sisu/v3/xml_dom.rb index 69cedff9..4508c389 100644 --- a/lib/sisu/v3/xml_dom.rb +++ b/lib/sisu/v3/xml_dom.rb @@ -98,6 +98,7 @@ module SiSU_XML_DOM            __LINE__.to_s + ':' + __FILE__          end        ensure +        SiSU_Env::CreateSite.new(@opt.cmd).cp_css        end      end      private | 
