lib/inochi/tasks/2-man.rake in inochi-6.0.2 vs lib/inochi/tasks/2-man.rake in inochi-6.1.0

- old
+ new

@@ -12,24 +12,31 @@ # Run manual through Ember to produce a single input file for AsciiDoc. file @man_asciidoc_dst => @man_asciidoc_src do input = [ - # use the default icons that were installed along with AsciiDoc - # see http://groups.google.com/group/asciidoc/msg/adb7cf741147ce38 - ':iconsdir: {asciidoc-dir}/{iconsdir}', + ':pygments:', # for better syntax coloring than GNU Source Highlight + ':data-uri:', # to ensure the output is a monolithic HTML document + ':icons:', ':iconsdir: {asciidoc-confdir}/{iconsdir}', + ':toc2:', ':stylesheet: ' + __FILE__.ext('css'), + Array(@project_config[:man_asciidoc_attributes]).map do |attribute| + name, value = attribute.split('=') + ":#{name}: #{value}" + end, + ":revdate: #{@project_module::RELDATE}", ":revnumber: #{@project_module::VERSION}", "= #{@project_package_name}(1)", '== NAME', "#{@project_package_name} - #{@project_module::TAGLINE}", "%+ #{@man_asciidoc_src.first.inspect}", - ].join("\n\n") + ]. + flatten.join("\n\n") options = { :shorthand => true, :unindent => true, :infer_end => true @@ -43,26 +50,18 @@ CLEAN.include @man_asciidoc_dst #----------------------------------------------------------------------------- -build_asciidoc_args = proc do |*atts| - atts.concat Array(@project_config[:man_asciidoc_attributes]) - args = atts.map {|a| ['-a', a] }.flatten - - args.push '-v' if Rake.application.options.trace - args.push @man_asciidoc_dst - +build_asciidoc_args = lambda do + args = [@man_asciidoc_dst] + args.unshift '-v' if Rake.application.options.trace args end file @man_html_dst => @man_asciidoc_dst do - args = build_asciidoc_args.call( - 'pygments', # for better syntax coloring than GNU Source Highlight - 'data-uri', 'icons', # NOTE: iconsdir is defined above in eRuby template - 'toc', 'stylesheet=' + __FILE__.ext('css') - ) - sh 'asciidoc', '-o', @man_html_dst, *args + args = build_asciidoc_args.call + sh 'asciidoc', '-o', @man_html_dst, '-b', 'html5', *args end CLOBBER.include @man_html_dst file @man_docbook_dst => @man_asciidoc_dst do