{
    "mode": "man",
    "parameter": "erubis",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/erubis/1/json",
    "generated": "2026-06-03T04:25:36Z",
    "synopsis": "erubis [..options..] [file ...]",
    "sections": {
        "NAME": {
            "content": "erubis - eRuby style template engine for multiple languages\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "erubis [..options..] [file ...]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Embedded templating engine for multiple languages.  Erubis will take a template file as input\nand output code to convey that data in the language specified.   The  following  output  lan‐\nguages are supported:\n\n* Ruby\n* PHP\n* C\n* Java\n* Scheme\n* Perl\n* JavaScript\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-h --help",
                    "content": "help\n",
                    "flag": "-h",
                    "long": "--help"
                },
                {
                    "name": "-v",
                    "content": "",
                    "flag": "-v"
                },
                {
                    "name": "-x",
                    "content": "",
                    "flag": "-x"
                },
                {
                    "name": "-X",
                    "content": "",
                    "flag": "-X"
                },
                {
                    "name": "-N",
                    "content": "",
                    "flag": "-N"
                },
                {
                    "name": "-U",
                    "content": "",
                    "flag": "-U"
                },
                {
                    "name": "-C",
                    "content": "",
                    "flag": "-C"
                },
                {
                    "name": "-b",
                    "content": "",
                    "flag": "-b"
                },
                {
                    "name": "-z",
                    "content": "",
                    "flag": "-z"
                },
                {
                    "name": "-e",
                    "content": "",
                    "flag": "-e"
                },
                {
                    "name": "-p",
                    "content": "embedded pattern (default '<% %>')\n",
                    "flag": "-p"
                },
                {
                    "name": "-l",
                    "content": "convert but no execute (ruby/php/c/java/scheme/perl/js)\n",
                    "flag": "-l"
                },
                {
                    "name": "-E",
                    "content": "enhancer names (Escape, PercentLine, BiPattern, ...)\n",
                    "flag": "-E"
                },
                {
                    "name": "-I",
                    "content": "library include path\n",
                    "flag": "-I"
                },
                {
                    "name": "-K",
                    "content": "kanji code (euc/sjis/utf8) (default none)\n",
                    "flag": "-K"
                },
                {
                    "name": "-c",
                    "content": "context data string (yaml inline style or ruby code)\n",
                    "flag": "-c"
                },
                {
                    "name": "-f",
                    "content": "context data file ('*.yaml', '*.yml', or '*.rb')\n",
                    "flag": "-f"
                },
                {
                    "name": "-T",
                    "content": "",
                    "flag": "-T"
                },
                {
                    "name": "-S",
                    "content": "",
                    "flag": "-S"
                },
                {
                    "name": "-B",
                    "content": "--pi=name\nparse '<?name ... ?>' instead of '<% ... %>'\n",
                    "flag": "-B"
                },
                {
                    "name": "supported properties:",
                    "content": "* (common)\n\n--escapefunc=nil\n: escape function name\n\n--pattern=\"<% %>\"\n: embed pattern\n\n--trim=true\n: trim spaces around <% ... %>\n\n--preamble=nil\n: preamble (no preamble when false)\n\n--postamble=nil\n: postamble (no postamble when false)\n\n--escape=nil\n: escape expression or not in default\n\n* (basic) * (pi)\n\n--pi=\"rb\"\n: PI (Processing Instrunctions) name\n\n--embchar=\"@\"\n: char for embedded expression pattern('@{...}@')\n\n* ruby * php * c\n\n--indent=\"\"\n: indent spaces (ex. '  ')\n\n--out=\"stdout\"\n: output file pointer name\n\n* java\n\n--indent=\"\"\n: indent spaces (ex. '  ')\n\n--buf=\"buf\"\n: output buffer name\n\n--bufclass=\"StringBuffer\" : output buffer class (ex. 'StringBuilder')\n\n* scheme\n\n--func=\"add\"\n: function name (ex. 'display')\n\n* perl\n\n--func=\"print\"\n: function name\n\n* javascript\n\n--docwrite=true\n: use 'document.write()' when true\n"
                }
            ]
        },
        "EXAMPLES": {
            "content": "Run 'erubis -l php example.ephp' to convert the embedded document to php code.\n",
            "subsections": [
                {
                    "name": "example.ephp:",
                    "content": "<?xml version=\"1.0\"?>\n<html>\n<body>\n<p>Hello <%= $user %>!</p>\n<table>\n<tbody>\n<% $i = 0; %>\n<% foreach ($list as $item) { %>\n<%   $i++; %>\n<tr bgcolor=\"<%= $i % 2 == 0 ? '#FFCCCC' : '#CCCCFF' %>\">\n<td><%= $i %></td>\n<td><%== $item %></td>\n</tr>\n<% } %>\n</tbody>\n</table>\n</body>\n</html>\n\n"
                }
            ]
        },
        "SEE ALSO": {
            "content": "http://rubyforge.org/projects/erubis/\n\n\n\nerubis 2.6.2                                January 2009                                   ERUBIS(1)",
            "subsections": []
        }
    },
    "summary": "erubis - eRuby style template engine for multiple languages",
    "flags": [
        {
            "flag": "-h",
            "long": "--help",
            "arg": null,
            "description": "help"
        },
        {
            "flag": "-v",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-x",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-X",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-N",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-U",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-C",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-b",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-z",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-e",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-p",
            "long": null,
            "arg": null,
            "description": "embedded pattern (default '<% %>')"
        },
        {
            "flag": "-l",
            "long": null,
            "arg": null,
            "description": "convert but no execute (ruby/php/c/java/scheme/perl/js)"
        },
        {
            "flag": "-E",
            "long": null,
            "arg": null,
            "description": "enhancer names (Escape, PercentLine, BiPattern, ...)"
        },
        {
            "flag": "-I",
            "long": null,
            "arg": null,
            "description": "library include path"
        },
        {
            "flag": "-K",
            "long": null,
            "arg": null,
            "description": "kanji code (euc/sjis/utf8) (default none)"
        },
        {
            "flag": "-c",
            "long": null,
            "arg": null,
            "description": "context data string (yaml inline style or ruby code)"
        },
        {
            "flag": "-f",
            "long": null,
            "arg": null,
            "description": "context data file ('*.yaml', '*.yml', or '*.rb')"
        },
        {
            "flag": "-T",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-S",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-B",
            "long": null,
            "arg": null,
            "description": "--pi=name parse '<?name ... ?>' instead of '<% ... %>'"
        }
    ],
    "examples": [
        "Run 'erubis -l php example.ephp' to convert the embedded document to php code.",
        "<?xml version=\"1.0\"?>",
        "<html>",
        "<body>",
        "<p>Hello <%= $user %>!</p>",
        "<table>",
        "<tbody>",
        "<% $i = 0; %>",
        "<% foreach ($list as $item) { %>",
        "<%   $i++; %>",
        "<tr bgcolor=\"<%= $i % 2 == 0 ? '#FFCCCC' : '#CCCCFF' %>\">",
        "<td><%= $i %></td>",
        "<td><%== $item %></td>",
        "</tr>",
        "<% } %>",
        "</tbody>",
        "</table>",
        "</body>",
        "</html>"
    ],
    "see_also": []
}