D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
RDoc
/
Markup
/
Filename :
cdesc-Markup.ri
back
Copy
U:RDoc::NormalClass[iI"Markup:ETI"RDoc::Markup;TI"Object;To:RDoc::Markup::Document:@parts[o;;[&o:RDoc::Markup::Paragraph;[I"RRDoc::Markup parses plain text documents and attempts to decompose them into ;TI"Otheir constituent parts. Some of these parts are high-level: paragraphs, ;TI"Pchunks of verbatim text, list entries and the like. Other parts happen at ;TI"Rthe character level: a piece of bold text, a word in code font. This markup ;TI"Pis similar in spirit to that used on WikiWiki webs, where folks create web ;TI"2pages using a simple set of formatting rules.;To:RDoc::Markup::BlankLine o; ;[I"LRDoc::Markup and other markup formats do no output formatting, this is ;TI"7handled by the RDoc::Markup::Formatter subclasses.;T@S:RDoc::Markup::Heading: leveli: textI"Markup Formats;T@o; ;[I"*+RDoc+ supports these markup formats:;T@o:RDoc::Markup::List: @type:BULLET:@items[ o:RDoc::Markup::ListItem:@label0;[o; ;[I" +rdoc+: ;TI"the +RDoc+ markup format; ;TI"see RDoc::MarkupReference.;To;;0;[o; ;[ I"+markdown+: ;TI"2The +markdown+ markup format as described in ;TI":the {Markdown Guide}[https://www.markdownguide.org]; ;TI"see RDoc::Markdown.;To;;0;[o; ;[I"+rd+: ;TI"$the +rd+ markup format format; ;TI"see RDoc::RD.;To;;0;[o; ;[ I"+tomdoc+: ;TI"'the TomDoc format as described in ;TI"+{TomDoc for Ruby}[http://tomdoc.org]; ;TI"see RDoc::TomDoc.;T@o; ;[I"@You can choose a markup format using the following methods:;T@o;;: NOTE;[o;;[I"per project;T;[o; ;[I"EIf you build your documentation with rake use RDoc::Task#markup.;T@o; ;[I"1If you build your documentation by hand run:;T@o:RDoc::Markup::Verbatim;[I"8rdoc --markup your_favorite_format --write-options ;T:@format0o; ;[I"Jand commit <tt>.rdoc_options</tt> and ship it with your packaged gem.;To;;[I" per file;T;[o; ;[I"KAt the top of the file use the <tt>:markup:</tt> directive to set the ;TI"-default format for the rest of the file.;To;;[I"per comment;T;[o; ;[I"JUse the <tt>:markup:</tt> directive at the top of a comment you want ;TI"$to write in a different format.;T@S;;i; I"RDoc::Markup;T@o; ;[I"PRDoc::Markup is extensible at runtime: you can add \new markup elements to ;TI"=be recognized in the documents that RDoc::Markup parses.;T@o; ;[ I"PRDoc::Markup is intended to be the basis for a family of tools which share ;TI"Lthe common requirement that simple, plain-text should be rendered in a ;TI"Jvariety of different output formats and media. It is envisaged that ;TI"ORDoc::Markup could be the basis for formatting RDoc style comment blocks, ;TI"#Wiki entries, and online FAQs.;T@S;;i; I" Synopsis;T@o; ;[I"OThis code converts +input_string+ to HTML. The conversion takes place in ;TI"Mthe +convert+ method, so you can use the same RDoc::Markup converter to ;TI"$convert multiple input strings.;T@o;;[ I"require 'rdoc' ;TI" ;TI"5h = RDoc::Markup::ToHtml.new(RDoc::Options.new) ;TI" ;TI""puts h.convert(input_string) ;T;0o; ;[ I"DYou can extend the RDoc::Markup parser to recognize new markup ;TI"Rsequences, and to add regexp handling. Here we make WikiWords significant to ;TI"Rthe parser, and also make the sequences {word} and \<no>text...</no> signify ;TI"Jstrike-through text. We then subclass the HTML output class to deal ;TI"with these:;T@o;;[I"require 'rdoc' ;TI" ;TI"+class WikiHtml < RDoc::Markup::ToHtml ;TI"* def handle_regexp_WIKIWORD(target) ;TI"6 "<font color=red>" + target.text + "</font>" ;TI" end ;TI" end ;TI" ;TI"markup = RDoc::Markup.new ;TI"-markup.add_word_pair("{", "}", :STRIKE) ;TI"$markup.add_html("no", :STRIKE) ;TI" ;TI"Fmarkup.add_regexp_handling(/\b([A-Z][a-z]+[A-Z]\w+)/, :WIKIWORD) ;TI" ;TI"1wh = WikiHtml.new RDoc::Options.new, markup ;TI"2wh.add_tag(:STRIKE, "<strike>", "</strike>") ;TI" ;TI"1puts "<body>#{wh.convert ARGF.read}</body>" ;T;0S;;i; I" Encoding;T@o; ;[I"NWhere Encoding support is available, RDoc will automatically convert all ;TI"Pdocuments to the same output encoding. The output encoding can be set via ;TI"FRDoc::Options#encoding and defaults to Encoding.default_external.;T@S;;i; I"\RDoc Markup Reference;T@o; ;[I"See RDoc::MarkupReference.;T: @fileI"lib/rdoc/markup.rb;T:0@omit_headings_from_table_of_contents_below0;0;0[[ I"attribute_manager;TI"R;T:publicFI"lib/rdoc/markup.rb;T[ [ [[I" class;T[[;[[I"new;T@�[I" parse;T@�[:protected[ [:private[ [I" instance;T[[;[ [I" add_html;T@�[I"add_regexp_handling;T@�[I"add_word_pair;T@�[I"convert;T@�[;[ [;[ [ [U:RDoc::Context::Section[i 0o;;[ ;0;0[@�I"lib/rdoc/parser.rb;TI"!lib/rdoc/parser/changelog.rb;TI"lib/rdoc/parser/simple.rb;TI"lib/rdoc/rd.rb;TI"lib/rdoc/stats.rb;TI"lib/rdoc/tom_doc.rb;T@�cRDoc::TopLevel