Class: Raggle::HTML::Renderer

Class | Raggle::HTML::Renderer
In: | raggle (CVS)
Parent: | Object

Text-mode HTML renderer.

### Methods

action_force_line_break action_handle_img action_insert_link_ref action_maybe_new_paragraph action_new_paragraph action_save_href call_actions context_enter context_exit new reflow_text render

### Attributes

rendered_text | [R] |

### Public Class methods

new(source, width)

Raggle::HTML::Renderer constructor.

### Public Instance methods

action_force_line_break()

Force line break.

action_handle_img()
action_insert_link_ref()

Insert reference to the latest link into the rendered text.

action_maybe_new_paragraph()

Append paragraph break, unless there is one already.

action_new_paragraph()

Append paragraph break

action_save_href()

Save href of the current tag (if it exists) unless duplicate link exists.

call_actions(tag, phase, *params)

Execute actions defined for `tag` in this `phase`.

actions: | actions set
tag: | tag from tag set
phase: | either +:start+ or +:end+
params: | params passed to the actions

context_enter(context, tag)

Enter to context defined by tag (if any)

context: | current context stack
tag: | tag from tag set

context_exit(context, tag)

Exit from context defined by tag (if any)

context: | current context stack
tag: | tag from tag set

reflow_text(text)

Reflow `text`, and append the result to `lines`

lines: | line array representing lines on screen
text: | text to be reflown
width: | maximum width of each line on screen

render()

Renders HTML in `src` to a screen with maximum width `width`. Returns `String` containing rendered text.

src: | HTML source
width: | Screen width

[Validate]