RDoc::Markdown - ri - phpman

Look up a command

 

Markdown Format | JSON API | MCP Server Tool


RDoc::Markdown
RDoc::Markdown < Object Constants: Class methods: Instance methods:
= RDoc::Markdown < Object

(from gem rdoc-7.2.0)
------------------------------------------------------------------------
RDoc::Markdown as described by the markdown syntax(
http://daringfireball.net/projects/markdown/syntax ).
To choose Markdown as your only default format see
RDoc::Options@Saved+Options for instructions on setting up a
.rdoc_options
file to store your project default.
== Usage
Here is a brief example of using this parse to read a markdown file by
hand.
  data = File.read("README.md")
  formatter = RDoc::Markup::ToHtml.new(RDoc::Options.new, nil)
  html = RDoc::Markdown.parse(data).accept(formatter)

  # do something with html

== Extensions
The following markdown extensions are supported by the parser, but not
all
are used in RDoc output by default.
=== RDoc
The RDoc Markdown parser has the following built-in behaviors that
cannot be
disabled.
Underscores embedded in words are never interpreted as emphasis. (While
the
markdown dingus( http://daringfireball.net/projects/markdown/dingus )
emphasizes in-word underscores, neither the
Markdown syntax nor MarkdownTest mention this behavior.)
For HTML output, RDoc always auto-links bare URLs.
=== Break on Newline
The break_on_newline extension converts all newlines into hard line
breaks
as in Github Flavored Markdown( https://github.github.com/gfm/ ). This
extension is disabled by
default.
=== CSS
The #css extension enables CSS blocks to be included in the output, but
they
are not used for any built-in RDoc output format. This extension is
disabled
by default.
Example:
  <style type="text/css">
  h1 { font-size: 3em }
  </style>

=== Definition Lists
The definition_lists extension allows definition lists using the PHP
Markdown Extra syntax(
https://michelf.ca/projects/php-markdown/extra/#def-list ), but only one
label and definition are supported
at this time. This extension is enabled by default.
Example:
  cat
:   A small furry mammal
that seems to sleep a lot

ant
:   A little insect that is known
to enjoy picnics


Produces:
cat:
  A small furry mammal
  that seems to sleep a lot

ant:
  A little insect that is known
  to enjoy picnics

=== Strike
Example:
  This is ~~striked~~.

Produces:
This is ~striked~.
=== Github
The #github extension enables a partial set of Github Flavored Markdown(
https://github.github.com/gfm/ ). This extension is enabled by default.
Supported github extensions include:
==== Fenced code blocks
Use ``` around a block of code instead of indenting it four spaces.
==== Syntax highlighting
Use ``` ruby as the start of a code fence to add syntax highlighting.
(Currently only ruby syntax is supported).
=== HTML
Enables raw HTML to be included in the output. This extension is enabled
by
default.
Example:
  <table>
  ...
  </table>

=== Notes
The #notes extension enables footnote support. This extension is enabled
by
default.
Example:
  Here is some text[^1] including an inline footnote ^[for short footnotes]

  ...

  [^1]: With the footnote text down at the bottom

Produces:
Here is some text*1( rdoc-label:foottext-1:footmark-1 ) including an
inline footnote *2( rdoc-label:foottext-2:footmark-2 )
== Limitations
* Link titles are not used
* Footnotes are collapsed into a single paragraph
== Author
This markdown parser is a port to kpeg from peg-markdown(
https://github.com/jgm/peg-markdown ) by
John MacFarlane.
It is used under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining a
copy
of this software and associated documentation files (the "Software"), to
deal
in the Software without restriction, including without limitation the
rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN
THE SOFTWARE.
The port to kpeg was performed by Eric Hodel and Evan Phoenix
------------------------------------------------------------------------
^1( rdoc-label:footmark-1:foottext-1 ) With the footnote text down at
the bottom
^2( rdoc-label:footmark-2:foottext-2 ) for short footnotes
------------------------------------------------------------------------
= Constants:

DEFAULT_EXTENSIONS:
  Extensions enabled by default

EXTENSIONS:
  Supported extensions

HTML_ENTITIES:
  HTML entity name map for RDoc::Markdown


= Class methods:

  extension
  new
  parse

= Instance methods:

  break_on_newline
  code
  css
  definition_lists
  emphasis
  extension
  extension?
  github
  html
  link_to
  list_item_from
  note
  note_for
  notes
  orig_initialize
  paragraph
  parse
  parse_cell_inline
  parse_table_cells
  peg_parse
  rdoc_escape
  rdoc_link_url_escape
  reference
  strike
  strong


Generated by phpMan Author: Che Dong Under GNU General Public License
2026-06-02 08:01 @216.73.216.198 CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 TransitionalValid CSS!

^_back to top