REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 3.35 KB
Close
/proc/thread-self/root/opt/alt/ruby18/share/ri/1.8/system/SM/SimpleMarkup/cdesc-SimpleMarkup.yaml
Text
Base64
--- !ruby/object:RI::ClassDescription attributes: [] class_methods: - !ruby/object:RI::MethodSummary name: new comment: - !ruby/struct:SM::Flow::H level: 2 text: Synopsis - !ruby/struct:SM::Flow::P body: This code converts <tt>input_string</tt>, which is in the format described in markup/simple_markup.rb, to HTML. The conversion takes place in the <tt>convert</tt> method, so you can use the same SimpleMarkup object to convert multiple input strings. - !ruby/struct:SM::Flow::VERB body: " require 'rdoc/markup/simple_markup'\n require 'rdoc/markup/simple_markup/to_html'\n\n p = SM::SimpleMarkup.new\n h = SM::ToHtml.new\n\n puts p.convert(input_string, h)\n" - !ruby/struct:SM::Flow::P body: "You can extend the SimpleMarkup parser to recognise new markup sequences, and to add special processing for text that matches a regular epxression. Here we make WikiWords significant to the parser, and also make the sequences {word} and <no>text...</no> signify strike-through text. When then subclass the HTML output class to deal with these:" - !ruby/struct:SM::Flow::VERB body: " require 'rdoc/markup/simple_markup'\n require 'rdoc/markup/simple_markup/to_html'\n\n class WikiHtml < SM::ToHtml\n def handle_special_WIKIWORD(special)\n "<font color=red>" + special.text + "</font>"\n end\n end\n\n p = SM::SimpleMarkup.new\n p.add_word_pair("{", "}", :STRIKE)\n p.add_html("no", :STRIKE)\n\n p.add_special(/\\b([A-Z][a-z]+[A-Z]\\w+)/, :WIKIWORD)\n\n h = WikiHtml.new\n h.add_tag(:STRIKE, "<strike>", "</strike>")\n\n puts "<body>" + p.convert(ARGF.read, h) + "</body>"\n" - !ruby/struct:SM::Flow::H level: 2 text: Output Formatters - !ruby/struct:SM::Flow::P body: <em>missing</em> constants: - !ruby/object:RI::Constant comment: name: SPACE value: ?\s - !ruby/object:RI::Constant comment: - !ruby/struct:SM::Flow::P body: "List entries look like:" - !ruby/struct:SM::Flow::VERB body: " * text\n 1. text\n [label] text\n label:: text\n" - !ruby/struct:SM::Flow::P body: Flag it as a list entry, and work out the indent for subsequent lines name: SIMPLE_LIST_RE value: /^( ( \* (?# bullet) |- (?# bullet) |\d+\. (?# numbered ) |[A-Za-z]\. (?# alphabetically numbered ) ) \s+ )\S/x - !ruby/object:RI::Constant comment: name: LABEL_LIST_RE value: "/^( ( \\[.*?\\] (?# labeled ) |\\S.*:: (?# note ) )(?:\\s+|$) )/x" full_name: SM::SimpleMarkup includes: [] instance_methods: - !ruby/object:RI::MethodSummary name: add_html - !ruby/object:RI::MethodSummary name: add_special - !ruby/object:RI::MethodSummary name: add_word_pair - !ruby/object:RI::MethodSummary name: assign_types_to_lines - !ruby/object:RI::MethodSummary name: content - !ruby/object:RI::MethodSummary name: convert - !ruby/object:RI::MethodSummary name: get_line_types - !ruby/object:RI::MethodSummary name: group_lines - !ruby/object:RI::MethodSummary name: handled_labeled_list name: SimpleMarkup superclass: Object
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 11
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
add_html-i.yaml
275 B
lrw-r--r--
2023-07-26 13:47:37
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
add_special-i.yaml
554 B
lrw-r--r--
2023-07-26 13:47:37
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
add_word_pair-i.yaml
437 B
lrw-r--r--
2023-07-26 13:47:37
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
assign_types_to_lines-i.yaml
387 B
lrw-r--r--
2023-07-26 13:47:37
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
cdesc-SimpleMarkup.yaml
3.35 KB
lrw-r--r--
2023-07-26 13:47:37
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
content-i.yaml
274 B
lrw-r--r--
2023-07-26 13:47:37
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
convert-i.yaml
444 B
lrw-r--r--
2023-07-26 13:47:37
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
get_line_types-i.yaml
273 B
lrw-r--r--
2023-07-26 13:47:37
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
group_lines-i.yaml
550 B
lrw-r--r--
2023-07-26 13:47:37
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
handled_labeled_list-i.yaml
1.03 KB
lrw-r--r--
2023-07-26 13:47:37
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
new-c.yaml
373 B
lrw-r--r--
2023-07-26 13:47:37
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).