{
    "content": [
        {
            "type": "text",
            "text": "# RDoc::Markup (ri)\n\n## Section Outline\n\n- **RDoc::Markup < Object** (13 lines)\n- **Markup Formats** (30 lines)\n- **RDoc::Markup** (9 lines) — 2 subsections\n  - Synopsis (35 lines)\n  - Encoding (4 lines)\n- **RDoc Markup Reference** (8 lines)\n- **Constants:** (4 lines)\n- **Class methods:** (3 lines)\n- **Instance methods:** (4 lines)\n- **Attributes:** (2 lines)\n\n## Full Content\n\n### RDoc::Markup < Object\n\n(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\n### Markup Formats\n\nRDoc 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### RDoc::Markup\n\nRDoc::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\n#### Synopsis\n\nThis 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\n#### Encoding\n\nWhere 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\n### RDoc Markup Reference\n\nSee RDoc Markup Reference( rdoc-ref:doc/markupreference/rdoc.rdoc )\n\n\n\n\n\n\n------------------------------------------------------------------------\n\n### Constants:\n\nHeading:\n[not documented]\n\n### Class methods:\n\nnew\nparse\n\n### Instance methods:\n\naddregexphandling\nconvert\nregexphandlings\n\n### Attributes:\n\nattrreader regexphandlings\n\n"
        }
    ],
    "structuredContent": {
        "command": "RDoc::Markup",
        "section": "",
        "mode": "ri",
        "summary": null,
        "synopsis": null,
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "RDoc::Markup < Object",
                "lines": 13,
                "subsections": []
            },
            {
                "name": "Markup Formats",
                "lines": 30,
                "subsections": []
            },
            {
                "name": "RDoc::Markup",
                "lines": 9,
                "subsections": [
                    {
                        "name": "Synopsis",
                        "lines": 35
                    },
                    {
                        "name": "Encoding",
                        "lines": 4
                    }
                ]
            },
            {
                "name": "RDoc Markup Reference",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "Constants:",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "Class methods:",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "Instance methods:",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "Attributes:",
                "lines": 2,
                "subsections": []
            }
        ]
    }
}