Class: Docgenerator::Sectioning::DummySectioning

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

Overview

Define Element :sectioning

This is a dummy-element as template for section…

Attributes may be:

  • :short:

  • HTML_ATTR_CORE

  • HTML_ATTR_I18N

  • HTML_ATTR_EVENTS

  • :lang, ATTR_LANG

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

Class Method Summary collapse

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, #initialize, #insert, #insertafter, #insertbefore, #inspect, #inspect_creation_caller, #linebreak, overview, #prepare_tracing_info, #restrict_to, #texkeyval, #texoptional, #to_context, #to_creole, #to_doc, #to_html, #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

Class Method Details

.inherited(subclass) ⇒ Object



52
53
54
55
56
57
58
59
60
61
62
# File 'lib/docgenerator/sections.rb', line 52

def inherited(subclass)
  Element.inherited(subclass)     
  subclass.class_eval(<<-attr
    add_attributes HTML_ATTR_CORE
    add_attributes HTML_ATTR_I18N
    add_attributes HTML_ATTR_EVENTS
    add_attribute :lang, ATTR_LANG
    add_attribute :short, Attribute.create( [ :latex ] )
  attr
  )
end

.set_wikilevel(level) ⇒ Object

Define the number of ‘=’ for this section-command in wiki syntax.



66
67
68
# File 'lib/docgenerator/sections.rb', line 66

def set_wikilevel( level )
  class_eval( "def wikilevel(); '#{'=' * level}'; end")
end

Instance Method Details

#hypertarget(id) ⇒ Object

Small helper to make TeX-Hyperlinks like in HTML (attribute id)



78
79
80
81
82
83
84
# File 'lib/docgenerator/sections.rb', line 78

def hypertarget(id)
  #~ return "\\hypertarget{#{id}}{}" if id.is_a?(String)
  #~ return '' if ! id.content or id.content.to_s =~/\A\s*\Z/
  return '' if ! id.content or id.content.join =~/\A\s*\Z/  #Ruby 1.9
  #~ return "\\hypertarget{#{id}}{}"
  return "\\hypertarget{#{id}}{}\\label{#{id}}"
end

#texmakroObject

Determine the TeX-Makroname from class name



88
89
90
# File 'lib/docgenerator/sections.rb', line 88

def texmakro()
  self.class.name.split('::').last.downcase
end

#wikilevelObject

Default marup for title for wikis.

Is redefined by set_wikilevel( level )



75
# File 'lib/docgenerator/sections.rb', line 75

def wikilevel(); ''; end