Loading lib/jsduck/options/parser.rb +0 −2 Original line number Diff line number Diff line Loading @@ -177,7 +177,6 @@ module JsDuck separator "" attribute :title, "Documentation - JSDuck" attribute :header, "<strong>Documentation</strong> JSDuck" option('--title=TEXT', "Custom title text for the documentation.", "", Loading @@ -187,7 +186,6 @@ module JsDuck "the header of the page. Inside page header the left", "part (from ' - ' separator) will be shown in bold.") do |text| @opts.title = text @opts.header = text.sub(/^(.*?) +- +/, "<strong>\\1</strong> ") end attribute :footer, "Generated on {DATE} by {JSDUCK} {VERSION}." Loading lib/jsduck/web/index_html.rb +7 −3 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ module JsDuck write_template(in_file, out_file, { "{title}" => @opts.title, "{mobile_redirect}" => @opts.seo ? include_script(@opts.template+"/mobile-redirect.js") : "", "{header}" => @opts.header, "{header}" => header, "{footer}" => footer, "{extjs_path}" => @opts.extjs_path, "{data_path}" => File.basename(@paths[:data]), Loading @@ -52,7 +52,7 @@ module JsDuck def create_print_template_html(in_file, out_file) write_template(in_file, out_file, { "{title}" => @opts.title, "{header}" => @opts.header, "{header}" => header, "{css_path}" => File.basename(@paths[:css]), }) end Loading @@ -63,7 +63,7 @@ module JsDuck write_template(in_file, out_file, { "{title}" => @opts.title, "{header}" => @opts.header, "{header}" => header, "{categories}" => categories ? "<h1>API Documentation</h1> #{categories}" : "", "{guides}" => guides ? "<h1>Guides</h1> #{guides}" : "", "{css_path}" => File.basename(@paths[:css]), Loading @@ -74,6 +74,10 @@ module JsDuck "<script type='text/javascript'>\n" + Util::IO.read(filename) + "\n</script>" end def header @opts.title.sub(/^(.*?) +- +/, "<strong>\\1</strong> ") end def footer jsduck = "<a href='https://github.com/senchalabs/jsduck'>JSDuck</a>" date = Time.new.strftime('%a %d %b %Y %H:%M:%S') Loading spec/options_spec.rb +1 −14 Original line number Diff line number Diff line Loading @@ -111,20 +111,6 @@ describe JsDuck::Options::Parser do end end describe :title do it "defaults to 'Documentation - JSDuck'" do opts = parse() opts.title.should == 'Documentation - JSDuck' opts.header.should == "<strong>Documentation</strong> JSDuck" end it "sets both title and header" do opts = parse("--title", "Docs - MyApp") opts.title.should == "Docs - MyApp" opts.header.should == "<strong>Docs</strong> MyApp" end end describe :import do it "defaults to empty array" do parse().import.should == [] Loading Loading @@ -251,6 +237,7 @@ describe JsDuck::Options::Parser do # Simple setters { :encoding => "--encoding", :title => ["--title", "Documentation - JSDuck"], :footer => ["--footer", "Generated on {DATE} by {JSDUCK} {VERSION}."], :welcome => "--welcome", :guides => "--guides", Loading Loading
lib/jsduck/options/parser.rb +0 −2 Original line number Diff line number Diff line Loading @@ -177,7 +177,6 @@ module JsDuck separator "" attribute :title, "Documentation - JSDuck" attribute :header, "<strong>Documentation</strong> JSDuck" option('--title=TEXT', "Custom title text for the documentation.", "", Loading @@ -187,7 +186,6 @@ module JsDuck "the header of the page. Inside page header the left", "part (from ' - ' separator) will be shown in bold.") do |text| @opts.title = text @opts.header = text.sub(/^(.*?) +- +/, "<strong>\\1</strong> ") end attribute :footer, "Generated on {DATE} by {JSDUCK} {VERSION}." Loading
lib/jsduck/web/index_html.rb +7 −3 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ module JsDuck write_template(in_file, out_file, { "{title}" => @opts.title, "{mobile_redirect}" => @opts.seo ? include_script(@opts.template+"/mobile-redirect.js") : "", "{header}" => @opts.header, "{header}" => header, "{footer}" => footer, "{extjs_path}" => @opts.extjs_path, "{data_path}" => File.basename(@paths[:data]), Loading @@ -52,7 +52,7 @@ module JsDuck def create_print_template_html(in_file, out_file) write_template(in_file, out_file, { "{title}" => @opts.title, "{header}" => @opts.header, "{header}" => header, "{css_path}" => File.basename(@paths[:css]), }) end Loading @@ -63,7 +63,7 @@ module JsDuck write_template(in_file, out_file, { "{title}" => @opts.title, "{header}" => @opts.header, "{header}" => header, "{categories}" => categories ? "<h1>API Documentation</h1> #{categories}" : "", "{guides}" => guides ? "<h1>Guides</h1> #{guides}" : "", "{css_path}" => File.basename(@paths[:css]), Loading @@ -74,6 +74,10 @@ module JsDuck "<script type='text/javascript'>\n" + Util::IO.read(filename) + "\n</script>" end def header @opts.title.sub(/^(.*?) +- +/, "<strong>\\1</strong> ") end def footer jsduck = "<a href='https://github.com/senchalabs/jsduck'>JSDuck</a>" date = Time.new.strftime('%a %d %b %Y %H:%M:%S') Loading
spec/options_spec.rb +1 −14 Original line number Diff line number Diff line Loading @@ -111,20 +111,6 @@ describe JsDuck::Options::Parser do end end describe :title do it "defaults to 'Documentation - JSDuck'" do opts = parse() opts.title.should == 'Documentation - JSDuck' opts.header.should == "<strong>Documentation</strong> JSDuck" end it "sets both title and header" do opts = parse("--title", "Docs - MyApp") opts.title.should == "Docs - MyApp" opts.header.should == "<strong>Docs</strong> MyApp" end end describe :import do it "defaults to empty array" do parse().import.should == [] Loading Loading @@ -251,6 +237,7 @@ describe JsDuck::Options::Parser do # Simple setters { :encoding => "--encoding", :title => ["--title", "Documentation - JSDuck"], :footer => ["--footer", "Generated on {DATE} by {JSDUCK} {VERSION}."], :welcome => "--welcome", :guides => "--guides", Loading