{
    "mode": "ri",
    "parameter": "RDoc::Markup",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/ri/RDoc%3A%3AMarkup/json",
    "generated": "2026-06-02T15:54:43Z",
    "sections": {
        "RDoc::Markup < Object": {
            "content": "(from gem rdoc-7.2.0)\n------------------------------------------------------------------------\nRDoc::Markup parses plain text documents and attempts to decompose them\ninto their constituent parts.  Some of these parts are high-level:\nparagraphs, chunks of verbatim text, list entries and the like.  Other\nparts happen at the character level: a piece of bold text, a word in\ncode font.  This markup is similar in spirit to that used on WikiWiki\nwebs, where folks create web pages using a simple set of formatting\nrules.\n\nRDoc::Markup and other markup formats do no output formatting, this is\nhandled by the RDoc::Markup::Formatter subclasses.\n",
            "subsections": []
        },
        "Markup Formats": {
            "content": "RDoc supports these markup formats:\n\n* rdoc: the RDoc markup format; see RDoc Markup Reference(\nrdoc-ref:doc/markupreference/rdoc.rdoc )\n* markdown: The markdown markup format as described in the Markdown\nGuide( https://www.markdownguide.org ); see RDoc::Markdown.\n* rd: the rd markup format format; see RDoc::RD.\n* tomdoc: the TomDoc format as described in TomDoc for Ruby(\nhttp://tomdoc.org ); see RDoc::TomDoc.\n\nYou can choose a markup format using the following methods:\n\nper project:\nIf you build your documentation with rake use RDoc::Task#markup.\n\nIf you build your documentation by hand run:\n\nrdoc --markup yourfavoriteformat --write-options\n\nand commit .rdocoptions and ship it with your packaged gem.\n\nper file:\nAt the top of the file use the :markup: directive to set the default\nformat for the rest of the file.\n\nper comment:\nUse the :markup: directive at the top of a comment you want to write\nin a different format.\n\n",
            "subsections": []
        },
        "RDoc::Markup": {
            "content": "RDoc::Markup is extensible at runtime: you can add new markup elements\nto be recognized in the documents that RDoc::Markup parses.\n\nRDoc::Markup is intended to be the basis for a family of tools which\nshare the common requirement that simple, plain-text should be rendered\nin a variety of different output formats and media.  It is envisaged\nthat RDoc::Markup could be the basis for formatting RDoc style comment\nblocks, Wiki entries, and online FAQs.\n",
            "subsections": [
                {
                    "name": "Synopsis",
                    "content": "This code converts inputstring to HTML.  The conversion takes place in\nthe convert method, so you can use the same RDoc::Markup converter to\nconvert multiple input strings.\n\nrequire 'rdoc'\n\nh = RDoc::Markup::ToHtml.new(RDoc::Options.new)\n\nputs h.convert(inputstring)\n\nYou can extend the RDoc::Markup parser to recognize new markup\nsequences, and to add regexp handling. Here we make WikiWords\nsignificant to the parser, and also make the sequences {word} and\n<no>text...</no> signify strike-through text.  We then subclass the HTML\noutput class to deal with these:\n\nrequire 'rdoc'\n\nclass WikiHtml < RDoc::Markup::ToHtml\ndef handleregexpWIKIWORD(target)\n\"<font color=red>\" + target + \"</font>\"\nend\nend\n\nmarkup = RDoc::Markup.new\nmarkup.addwordpair(\"{\", \"}\", :STRIKE)\nmarkup.addhtml(\"no\", :STRIKE)\n\nmarkup.addregexphandling(/\\b([A-Z][a-z]+[A-Z]\\w+)/, :WIKIWORD)\n\nwh = WikiHtml.new RDoc::Options.new, markup\nwh.addtag(:STRIKE, \"<strike>\", \"</strike>\")\n\nputs \"<body>#{wh.convert ARGF.read}</body>\"\n"
                },
                {
                    "name": "Encoding",
                    "content": "Where Encoding support is available, RDoc will automatically convert all\ndocuments to the same output encoding.  The output encoding can be set\nvia RDoc::Options#encoding and defaults to Encoding.defaultexternal.\n"
                }
            ]
        },
        "RDoc Markup Reference": {
            "content": "See RDoc Markup Reference( rdoc-ref:doc/markupreference/rdoc.rdoc )\n\n\n\n\n\n\n------------------------------------------------------------------------",
            "subsections": []
        },
        "Constants:": {
            "content": "Heading:\n[not documented]\n\n",
            "subsections": []
        },
        "Class methods:": {
            "content": "new\nparse\n",
            "subsections": []
        },
        "Instance methods:": {
            "content": "addregexphandling\nconvert\nregexphandlings\n",
            "subsections": []
        },
        "Attributes:": {
            "content": "attrreader regexphandlings\n",
            "subsections": []
        }
    },
    "flags": [],
    "examples": [],
    "see_also": []
}