Class: Docgenerator::Style

Inherits:
Element show all
Defined in:
lib/docgenerator/css.rb

Overview

Define Element ‘:style’

Create an instance with

element( :style, [ attributes, [content]] )

Style.new( [ attributes, [content]] )

Only for HTML.

Constant Summary

Constants inherited from Element

Element::SUPPORTED_TARGETS

Constants included from Docgenerator

ATTR_LANG, CSS_BORDER, CSS_COLORS, CSS_WIDTH, DOCGENERATOR_DEFAULT_LOGGER, DOCGENERATOR_LOGGER, ENDTAG, HTML_ATTR_ALIGN, HTML_ATTR_ALL, HTML_ATTR_CORE, HTML_ATTR_EVENTS, HTML_ATTR_I18N, HTML_ATTR_VALIGN, VERSION

Instance Attribute Summary

Attributes inherited from Element

#attr, #content, #log

Instance Method Summary collapse

Methods inherited from Element

#<<, #CR, #Cr, #[], add, add_attribute, add_attributes, add_context_output, add_creole_output, add_html_output, add_html_tag, add_id, add_latex_output, add_output, add_text_output, add_wiki_output, attributes, #cR, #content?, #cr, create, create_convert_to_code, #delete, element_ids, #element_ids, #empty?, get, get_attribute_list, has_no_content, #htmltag, #ids, inherited, #initialize, #insert, #insertafter, #insertbefore, #inspect, #inspect_creation_caller, #linebreak, overview, #prepare_tracing_info, #restrict_to, #texkeyval, #texoptional, #to_context, #to_creole, #to_doc, #to_latex, #to_s, #to_text, #to_wiki, trace=

Methods included from Docgenerator

#set_option_defaults, set_option_defaults, trace_off, trace_on, trace_on?

Constructor Details

This class inherits a constructor from Docgenerator::Element

Instance Method Details

#to_html(options = {}) ⇒ Object

Prepare HTML-Output for Style-Tag. The values can be overwritten, if different CSS-Elements are inside.



26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/docgenerator/css.rb', line 26

def to_html( options = {} )
  o = set_option_defaults(options)
  o[:log].debug("Enter style.to_html") if o[:log].debug?
  res =	""
  res <<	"\n" if @crbefore
  res <<	"<style type=\"text/css\">\n"
  @content.each{|c|
      res	<< c.to_html(options)
  }
  res << "</style>"
  res << "\n" if @crafter
  return res
end