Class: RDoc::Markup::ToTest
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
self,
Formatter
|
|
|
Instance Chain:
self,
Formatter
|
|
| Inherits: |
RDoc::Markup::Formatter
|
| Defined in: | lib/rdoc/markup/to_test.rb |
Overview
This Markup outputter is used for testing purposes.
Visitor
- #accept_blank_line(blank_line)
- #accept_heading(heading)
- #accept_list_end(list)
- #accept_list_item_end(list_item)
- #accept_list_item_start(list_item)
- #accept_list_start(list)
- #accept_paragraph(paragraph)
- #accept_raw(raw)
- #accept_rule(rule)
- #accept_verbatim(verbatim)
- #end_accepting
- #handle_PLAIN_TEXT(text)
- #handle_REGEXP_HANDLING_TEXT(text)
- #start_accepting
Class Method Summary
Formatter - Inherited
| .gen_relative_url | Converts a target url to one that is relative to a given path. |
| .new | Creates a new |
Instance Method Summary
Formatter - Inherited
| #accept_document | Adds |
| #add_regexp_handling_RDOCLINK | Adds a regexp handling for links of the form rdoc-…: |
| #annotate | Allows |
| #apply_regexp_handling | Applies regexp handling to |
| #convert | Marks up |
| #convert_string | Converts a string to be fancier if desired. |
| #handle_BOLD | Called when processing bold nodes while traversing inline nodes from handle_inline. |
| #handle_BOLD_WORD | Called when processing bold word nodes while traversing inline nodes from handle_inline. |
| #handle_EM | Called when processing emphasis nodes while traversing inline nodes from handle_inline. |
| #handle_EM_WORD | Called when processing emphasis word nodes while traversing inline nodes from handle_inline. |
| #handle_HARD_BREAK | Called when processing a hard break while traversing inline nodes from handle_inline. |
| #handle_inline | Parses inline |
| #handle_PLAIN_TEXT | Called when processing plain text while traversing inline nodes from handle_inline. |
| #handle_REGEXP_HANDLING_TEXT | Called when processing regexp-handling-processed text while traversing inline nodes from handle_inline. |
| #handle_STRIKE | Called when processing strike nodes while traversing inline nodes from handle_inline. |
| #handle_TEXT | Called when processing text node while traversing inline nodes from handle_inline. |
| #handle_TIDYLINK | Called when processing tidylink nodes while traversing inline nodes from handle_inline. |
| #handle_TT | Called when processing tt nodes while traversing inline nodes from handle_inline. |
| #ignore | Use ignore in your subclass to ignore the content of a node. |
| #parse_url | Extracts and a scheme, url and an anchor id from |
| #traverse_inline_nodes | Traverses |
| #tt? | Is |
Constructor Details
This class inherits a constructor from RDoc::Markup::Formatter
Instance Method Details
#accept_blank_line(blank_line)
[ GitHub ]# File 'lib/rdoc/markup/to_test.rb', line 63
def accept_blank_line(blank_line) @res << "\n" end
#accept_heading(heading)
[ GitHub ]# File 'lib/rdoc/markup/to_test.rb', line 67
def accept_heading(heading) @res << "#{'=' * heading.level} #{heading.text}" end
#accept_list_end(list)
[ GitHub ]# File 'lib/rdoc/markup/to_test.rb', line 52
def accept_list_end(list) @list.pop end
#accept_list_item_end(list_item)
[ GitHub ]# File 'lib/rdoc/markup/to_test.rb', line 60
def accept_list_item_end(list_item) end
#accept_list_item_start(list_item)
[ GitHub ]# File 'lib/rdoc/markup/to_test.rb', line 56
def accept_list_item_start(list_item) @res << "#{' ' * (@list.size - 1)}#{@list.last}: " end
#accept_list_start(list)
[ GitHub ]# File 'lib/rdoc/markup/to_test.rb', line 41
def accept_list_start(list) @list << case list.type when :BULLET then '*' when :NUMBER then '1' else list.type end end
#accept_paragraph(paragraph)
[ GitHub ]# File 'lib/rdoc/markup/to_test.rb', line 29
def accept_paragraph(paragraph) handle_inline(paragraph.text) end
#accept_raw(raw)
[ GitHub ]# File 'lib/rdoc/markup/to_test.rb', line 33
def accept_raw(raw) @res << raw.parts.join end
#accept_rule(rule)
[ GitHub ]# File 'lib/rdoc/markup/to_test.rb', line 71
def accept_rule(rule) @res << '-' * rule.weight end
#accept_verbatim(verbatim)
[ GitHub ]# File 'lib/rdoc/markup/to_test.rb', line 37
def accept_verbatim(verbatim) @res << verbatim.text.gsub(/^(\S)/, ' \1') end
#end_accepting
[ GitHub ]# File 'lib/rdoc/markup/to_test.rb', line 17
def end_accepting @res end
#handle_PLAIN_TEXT(text)
[ GitHub ]# File 'lib/rdoc/markup/to_test.rb', line 21
def handle_PLAIN_TEXT(text) @res << text end
#handle_REGEXP_HANDLING_TEXT(text)
[ GitHub ]# File 'lib/rdoc/markup/to_test.rb', line 25
def handle_REGEXP_HANDLING_TEXT(text) @res << text end
#start_accepting
[ GitHub ]# File 'lib/rdoc/markup/to_test.rb', line 12
def start_accepting @res = [] @list = [] end