Ruby SM::SimpleMarkup Functions

EditRocket provides the following information on SM::SimpleMarkup functions in the Ruby source code builder.

add_html(tag, name) - Add to the sequences recognized as general markup

add_special(pattern, name) - "Add to other inline sequences. For example, we could add WikiWords using something like:"

add_word_pair(start, stop, name) - Add to the sequences used to add formatting to an individual word (such as bold). Matching entries will generate attibutes that the output formatters can recognize by their name

content() - for debugging, we allow access to our line contents as text

convert(str, op) - We take a string, split it into lines, work out the type of each line, and from there deduce groups of lines (for example all lines in a paragraph). We then invoke the output formatter using a Visitor to display the result

get_line_types() - for debugging, return the list of line types

new() - take a block of text and use various heuristics to determine it's structure (paragraphs, lists, and so on). Invoke an event handler as we identify significant chunks.