Loading lib/jsduck/options.rb +10 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ module JsDuck attr_accessor :footer attr_accessor :head_html attr_accessor :body_html attr_accessor :css attr_accessor :message attr_accessor :welcome attr_accessor :guides Loading Loading @@ -99,6 +100,7 @@ module JsDuck @footer = "Generated with <a href='https://github.com/senchalabs/jsduck'>JSDuck</a> #{@version}." @head_html = "" @body_html = "" @css = "" @message = "" @welcome = nil @guides = nil Loading Loading @@ -294,6 +296,14 @@ module JsDuck @body_html += html end opts.on('--css=CSS', "Extra CSS rules to include to the page.", "", "This option can be used repeatedly to append multiple", "chunks of CSS.") do |css| @css += css end opts.on('--message=HTML', "(Warning) message to show prominently.", "", Loading lib/jsduck/web/css.rb +6 −2 Original line number Diff line number Diff line Loading @@ -4,12 +4,16 @@ require 'jsduck/util/md5' module JsDuck module Web # Writes the CSS gathered from Tag classes into given file. # Writes the CSS gathered from Tag classes and --css option into given file. # Then Renames the file so it contains an MD5 hash inside it, # returning the resulting fingerprinted name. class Css def initialize(opts) @opts = opts end def write(filename) File.open(filename, 'w') {|f| f.write(TagRegistry.css) } File.open(filename, 'w') {|f| f.write(TagRegistry.css + @opts.css) } Util::MD5.rename(filename) end end Loading lib/jsduck/web/writer.rb +1 −1 Original line number Diff line number Diff line Loading @@ -51,7 +51,7 @@ module JsDuck # Remember the MD5-fingerprinted filenames paths = { :data => Web::Data.new(@relations, @assets, @opts).write(@opts.output_dir+"/data.js"), :css => Web::Css.new.write(@opts.output_dir+"/styles.css"), :css => Web::Css.new(@opts).write(@opts.output_dir+"/styles.css"), } Web::IndexHtml.new(@assets, @opts, paths).write Loading Loading
lib/jsduck/options.rb +10 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ module JsDuck attr_accessor :footer attr_accessor :head_html attr_accessor :body_html attr_accessor :css attr_accessor :message attr_accessor :welcome attr_accessor :guides Loading Loading @@ -99,6 +100,7 @@ module JsDuck @footer = "Generated with <a href='https://github.com/senchalabs/jsduck'>JSDuck</a> #{@version}." @head_html = "" @body_html = "" @css = "" @message = "" @welcome = nil @guides = nil Loading Loading @@ -294,6 +296,14 @@ module JsDuck @body_html += html end opts.on('--css=CSS', "Extra CSS rules to include to the page.", "", "This option can be used repeatedly to append multiple", "chunks of CSS.") do |css| @css += css end opts.on('--message=HTML', "(Warning) message to show prominently.", "", Loading
lib/jsduck/web/css.rb +6 −2 Original line number Diff line number Diff line Loading @@ -4,12 +4,16 @@ require 'jsduck/util/md5' module JsDuck module Web # Writes the CSS gathered from Tag classes into given file. # Writes the CSS gathered from Tag classes and --css option into given file. # Then Renames the file so it contains an MD5 hash inside it, # returning the resulting fingerprinted name. class Css def initialize(opts) @opts = opts end def write(filename) File.open(filename, 'w') {|f| f.write(TagRegistry.css) } File.open(filename, 'w') {|f| f.write(TagRegistry.css + @opts.css) } Util::MD5.rename(filename) end end Loading
lib/jsduck/web/writer.rb +1 −1 Original line number Diff line number Diff line Loading @@ -51,7 +51,7 @@ module JsDuck # Remember the MD5-fingerprinted filenames paths = { :data => Web::Data.new(@relations, @assets, @opts).write(@opts.output_dir+"/data.js"), :css => Web::Css.new.write(@opts.output_dir+"/styles.css"), :css => Web::Css.new(@opts).write(@opts.output_dir+"/styles.css"), } Web::IndexHtml.new(@assets, @opts, paths).write Loading