Class: RDoc::Markup::Heading
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
self,
Struct
|
|
|
Instance Chain:
self,
Struct
|
|
| Inherits: |
Struct
|
| Defined in: | lib/rdoc/markup/heading.rb |
Overview
A heading with a level (1-6) and text
Class Method Summary
- .handle_regexp_CROSSREF(target)
-
.to_html
A singleton plain HTML formatter for headings.
-
.to_label
A singleton
ToLabelformatter for headings.
Instance Attribute Summary
Instance Method Summary
-
#accept(visitor)
Calls
#accept_headingonvisitor -
#aref
An HTML-safe anchor reference for this header.
-
#label(context = nil)
Creates a fully-qualified label which will include the label from
context. -
#plain_html
HTML markup of the text of this label without the surrounding header element.
- #pretty_print(q) Internal use only
Class Method Details
.handle_regexp_CROSSREF(target)
[ GitHub ]# File 'lib/rdoc/markup/heading.rb', line 30
def @to_html.handle_regexp_CROSSREF(target) target.text.sub(/^\\/, '') end
.to_html
A singleton plain HTML formatter for headings. Used for creating labels for the Table of Contents
# File 'lib/rdoc/markup/heading.rb', line 22
def self.to_html return @to_html if @to_html markup = RDoc::Markup.new markup.add_regexp_handling RDoc::CrossReference::CROSSREF_REGEXP, :CROSSREF @to_html = RDoc::Markup::ToHtml.new nil def @to_html.handle_regexp_CROSSREF(target) target.text.sub(/^\\/, '') end @to_html end
.to_label
A singleton ToLabel formatter for headings.
Instance Attribute Details
#level (rw)
A heading with a level (1-6) and text
# File 'lib/rdoc/markup/heading.rb', line 5
RDoc::Markup::Heading = Struct.new :level, :text do @to_html = nil @to_label = nil ## # A singleton RDoc::Markup::ToLabel formatter for headings. def self.to_label @to_label ||= RDoc::Markup::ToLabel.new end ## # A singleton plain HTML formatter for headings. Used for creating labels # for the Table of Contents def self.to_html return @to_html if @to_html markup = RDoc::Markup.new markup.add_regexp_handling RDoc::CrossReference::CROSSREF_REGEXP, :CROSSREF @to_html = RDoc::Markup::ToHtml.new nil def @to_html.handle_regexp_CROSSREF(target)
#text (rw)
A heading with a level (1-6) and text
# File 'lib/rdoc/markup/heading.rb', line 5
RDoc::Markup::Heading = Struct.new :level, :text do @to_html = nil @to_label = nil ## # A singleton RDoc::Markup::ToLabel formatter for headings. def self.to_label @to_label ||= RDoc::Markup::ToLabel.new end ## # A singleton plain HTML formatter for headings. Used for creating labels # for the Table of Contents def self.to_html return @to_html if @to_html markup = RDoc::Markup.new markup.add_regexp_handling RDoc::CrossReference::CROSSREF_REGEXP, :CROSSREF @to_html = RDoc::Markup::ToHtml.new nil def @to_html.handle_regexp_CROSSREF(target)
Instance Method Details
#accept(visitor)
Calls #accept_heading on visitor
# File 'lib/rdoc/markup/heading.rb', line 40
def accept(visitor) visitor.accept_heading self end
#aref
An HTML-safe anchor reference for this header.
#label(context = nil)
Creates a fully-qualified label which will include the label from context. This helps keep ids unique in HTML.
#plain_html
HTML markup of the text of this label without the surrounding header element.