Loading lib/jsduck/index_html.rb +3 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ module JsDuck "{guides}" => @assets.guides.to_html("display:none"), "{head_html}" => @opts.head_html, "{body_html}" => @opts.body_html, "{head_css}" => TagRegistry.css, }) end Loading @@ -47,6 +48,7 @@ module JsDuck write_template(in_file, out_file, { "{title}" => @opts.title, "{header}" => @opts.header, "{head_css}" => TagRegistry.css, }) end Loading @@ -59,6 +61,7 @@ module JsDuck "{header}" => @opts.header, "{categories}" => categories ? "<h1>API Documentation</h1> #{categories}" : "", "{guides}" => guides ? "<h1>Guides</h1> #{guides}" : "", "{head_css}" => TagRegistry.css, }) end Loading lib/jsduck/tag/tag.rb +7 −0 Original line number Diff line number Diff line Loading @@ -189,6 +189,13 @@ module JsDuck::Tag def to_html(context) end # A string of CSS to add to the builtin CSS of the generated docs. # For example, to style a signature label: # # @css = ".signature .mytag { color: red }" # attr_reader :css # Returns all descendants of JsDuck::Tag::Tag class. def self.descendants result = [] Loading lib/jsduck/tag_registry.rb +10 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ module JsDuck @html_renderers = [] @html_renderers_sorted = false @member_types = [] @css = [] @loader = TagLoader.new load_from(File.dirname(__FILE__) + "/tag") Loading Loading @@ -65,6 +66,10 @@ module JsDuck if tag.html_position @html_renderers << tag end if tag.css @css << tag.css end end end Loading Loading @@ -132,6 +137,11 @@ module JsDuck @html_renderers end # Returns all the CSS gathered from @css attributes of tags. def css @css.join("\n") end # # Accessors for a single tag # Loading template/index-template.html +1 −0 Original line number Diff line number Diff line Loading @@ -14,6 +14,7 @@ <link rel="stylesheet" href="resources/codemirror/codemirror.css" type="text/css" /> <link rel="stylesheet" href="resources/prettify/prettify.css" type="text/css" /> <!-- END CSS --> <style type="text/css">{head_css}</style> </head> <body style="background: #fff; min-width: 0;"> Loading template/print-template.html +1 −0 Original line number Diff line number Diff line Loading @@ -14,6 +14,7 @@ <style type="text/css"> .description .short { display: none !important } .description .long { display: block !important } {head_css} </style> <title>{subtitle} - {title}</title> </head> Loading Loading
lib/jsduck/index_html.rb +3 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ module JsDuck "{guides}" => @assets.guides.to_html("display:none"), "{head_html}" => @opts.head_html, "{body_html}" => @opts.body_html, "{head_css}" => TagRegistry.css, }) end Loading @@ -47,6 +48,7 @@ module JsDuck write_template(in_file, out_file, { "{title}" => @opts.title, "{header}" => @opts.header, "{head_css}" => TagRegistry.css, }) end Loading @@ -59,6 +61,7 @@ module JsDuck "{header}" => @opts.header, "{categories}" => categories ? "<h1>API Documentation</h1> #{categories}" : "", "{guides}" => guides ? "<h1>Guides</h1> #{guides}" : "", "{head_css}" => TagRegistry.css, }) end Loading
lib/jsduck/tag/tag.rb +7 −0 Original line number Diff line number Diff line Loading @@ -189,6 +189,13 @@ module JsDuck::Tag def to_html(context) end # A string of CSS to add to the builtin CSS of the generated docs. # For example, to style a signature label: # # @css = ".signature .mytag { color: red }" # attr_reader :css # Returns all descendants of JsDuck::Tag::Tag class. def self.descendants result = [] Loading
lib/jsduck/tag_registry.rb +10 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ module JsDuck @html_renderers = [] @html_renderers_sorted = false @member_types = [] @css = [] @loader = TagLoader.new load_from(File.dirname(__FILE__) + "/tag") Loading Loading @@ -65,6 +66,10 @@ module JsDuck if tag.html_position @html_renderers << tag end if tag.css @css << tag.css end end end Loading Loading @@ -132,6 +137,11 @@ module JsDuck @html_renderers end # Returns all the CSS gathered from @css attributes of tags. def css @css.join("\n") end # # Accessors for a single tag # Loading
template/index-template.html +1 −0 Original line number Diff line number Diff line Loading @@ -14,6 +14,7 @@ <link rel="stylesheet" href="resources/codemirror/codemirror.css" type="text/css" /> <link rel="stylesheet" href="resources/prettify/prettify.css" type="text/css" /> <!-- END CSS --> <style type="text/css">{head_css}</style> </head> <body style="background: #fff; min-width: 0;"> Loading
template/print-template.html +1 −0 Original line number Diff line number Diff line Loading @@ -14,6 +14,7 @@ <style type="text/css"> .description .short { display: none !important } .description .long { display: block !important } {head_css} </style> <title>{subtitle} - {title}</title> </head> Loading