doc/index.xhtml in erbook-5.0.0 vs doc/index.xhtml in erbook-6.0.0

- old
+ new

@@ -10,158 +10,71 @@ <!ENTITY icon_link "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAAAFVBMVEVmmcwzmcyZzP8AZswAZv////////9E6giVAAAAB3RSTlP///////8AGksDRgAAADhJREFUGFcly0ESAEAEA0Ei6/9P3sEcVB8kmrwFyni0bOeyyDpy9JTLEaOhQq7Ongf5FeMhHS/4AVnsAZubxDVmAAAAAElFTkSuQmCC"> ]> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> - <meta name="date" content="22 November 2008"/> - <meta name="author" content="Suraj N. Kurapati"/> - <meta name="generator" content="erbook 5.0.0"/> - <title>erbook 5.0.0 user manual</title> + <meta name="generator" content="ERBook 6.0.0"/> - <link rel="alternate" type="application/rss+xml" href="http://snk.tuxfamily.org/lib/erbook/ann"/> + <title>ERBook 6.0.0</title> - <style type="text/css" media="screen"> - <![CDATA[body -{ - margin : auto; - max-width : 36em; - padding : 0.5em; -} + <meta name="author" content="Suraj N. Kurapati"/> -/* source code */ + <meta name="date" content="19 January 2009"/> - tt - { - background-color : #F0F8FF; - } + <link rel="alternate" type="application/rss+xml" href="http://snk.tuxfamily.org/lib/erbook/ann.xml"/> - pre + <style type="text/css" media="all"> + <![CDATA[/* general */ + body { - cursor : text; - line-height : normal; - border : 1px solid #b1d827; - background-color : #F5FFDF; - padding : 1em; - overflow : auto; - } - - /* output of the syntax coloring library */ - pre.code - { - background-color : #FFFFE8; - border-color : #EEDD88; - } - -/* hyperlinks */ - - a - { - text-decoration : none; - } - - a:hover - { - text-decoration : underline; - } - - a:link - { - color : #002BB8; - } - - a:visited - { - color : #5A3696; - } - - a.here, - a.list - { color : #000000; + background-color : #FFFFFF; + line-height : 1.5em; + font-family : Calibri, Verdana, sans-serif; } - a:target, - a:target *, - *:target a.list - { - background-color : #FF4500 !important; - color : #FFFFFF !important; - } - - a:target, - *:target a.list - { - padding : 0.1em; - font-weight : bolder; - text-decoration : none; - } -]]> - </style> - <style type="text/css" media="all"> - <![CDATA[body -{ - color : #000000; - background-color : #FFFFFF; - line-height : 1.5em; - font-family : Calibri, Verdana, sans-serif; -} - /* emphasis */ - blockquote { color : #333; font-style : italic; } em { + font-family : Constantia, "Book Antiqua", "URW Bookman L", serif; + font-size : 105%; } hr { height : 0; border : 0; border-top : 2px solid #FF0000; } /* source code */ - tt, code, pre { font-family : Monaco, Consolas, "Lucida Console", monospace; font-size : 100%; /* appears like "size: small" otherwise */ } /* hyperlinks */ - a > img { border : none; } a img { _border : none; /* for IE6 */ } -/* lists */ - - #content li:first-child - { - margin-top : 1em; - } - - #content li - { - margin-bottom : 1em; - } - /* headings */ - h1, h2, h3, h4, h5, @@ -222,11 +135,10 @@ { font-size : 1.0em; } /* tables */ - table { border-collapse : collapse; /* no spacing between cell borders */ margin : auto; /* center horizontally */ margin-top : 1em; @@ -236,32 +148,26 @@ td { padding : 1em; border : 1px solid #bbb; vertical-align : top; - background-color : inherit; + background-color : #FFFFFF; _background-color : #FFFFFF; /* for IE6 */ } th { background-color : #F5F5F5; } /* document structure */ - - #nav - { - text-align : center; - margin-bottom : 4em; - } - #header { text-align : center; } + .logo, .header_outside_above, #header, .header_outside_below { margin-bottom : 5em; @@ -330,11 +236,10 @@ margin-top : 2em; margin-bottom : 2em; } /* document nodes */ - .part > .title, .chapter > .title { padding-bottom : 0.5em; } @@ -399,10 +304,24 @@ .procedure { margin : 3em; } + .tip .nav, + .note .nav, + .caution .nav, + .warning .nav, + .important .nav, + .figure .nav, + .table .nav, + .example .nav, + .equation .nav, + .procedure .nav + { + margin-left : -7.65em; + } + .tip > .content, .note > .content, .caution > .content, .warning > .content, .important > .content, @@ -454,26 +373,157 @@ { _display : block; /* for IE6 */ _margin : auto; /* for IE6 */ } ]]> - </style> - <style type="text/css" media="print"> - <![CDATA[/* source code */ + </style> + <style type="text/css" media="screen"> + <![CDATA[/* general */ + body + { + margin : 0; + padding : 0; + padding-left : 10em; /* room for local navigation menus */ + padding-right : 10em; /* keep #body visually centered */ + background-color : #808080; + } + /* the actual content of the <body> element */ + #body + { + margin : auto; + max-width : 38em; + + background-color : #FFFFFF; + border-left : 0.35em solid #696969; + border-right : 0.35em solid #696969; + padding : 2em; + } + +/* source code */ tt { + background-color : #F0F8FF; + } + + pre + { + cursor : text; + line-height : normal; + border : 1px solid #b1d827; + background-color : #F5FFDF; + padding : 1em; + + /* fit container to content; no overflow! */ + display : inline-block; + margin : 0; + min-width : 92.5%; + } + + /* output of the syntax coloring library */ + pre.code + { + background-color : #FFFFE8; + border-color : #EEDD88; + } + +/* hyperlinks */ + a + { + text-decoration : none; + } + + a:hover + { + text-decoration : underline; + } + + a:link + { + color : #0038E1; /* maximum saturation of RoyalBlue */ + } + + a:visited + { + color : #800080; + } + + #toc a:target:after, + #lof a:target:after, + #nav a:target:after + { + content : "★"; /* &#x2605; */ + color : #FF0000; + font-size : x-large; + padding-left : 0.125em; + } + +/* document structure */ + /* mini navigation menu beside every block node */ + .nav + { + width : 4em; + float : left; /* detach from main content */ + margin-left : -6.075em; + + font-size : 1.9em; + letter-spacing : 0.25em; + text-align : center; + + color : #696969; /* same colors to hide non-links */ + background-color : #696969; + padding : 0.5em; + margin-top : -0.5em; + } + + .nav:target, + .nav:hover + { + color : #333; /* same colors to hide non-links */ + background-color : #333; + } + + .nav a:link, + .nav a:visited + { + color : #D3D3D3; + } + + .nav a:hover, + #nav a:target:after { + color : #9ACD32; + text-decoration : none; + } + + /* global navigation menu at the top of the page */ + #nav + { + font-size : 1em; + letter-spacing : 0; + width : 8.5em; + margin-left : -11.5em; + } + + #nav li + { + list-style-type : none; + } +]]> + </style> + <style type="text/css" media="print"> + <![CDATA[/* source code */ + tt + { font-weight : normal; } pre { border : none; } /* headings */ - h1, h2, h3, h4, h5, @@ -482,32 +532,31 @@ font-weight : normal; clear : both; } /* hyperlinks */ - /* blend all hyperlinks with normal text */ a:link, a:visited { color : #000000; text-decoration : none; } /* emphasize external and cross-reference hyperlinks */ - a:not([href^="#"]):link, - a:not([href^="#"]):visited, + a[href]:not([href^="#"]):link, + a[href]:not([href^="#"]):visited, a.xref[title]:link, a.xref[title]:visited { color : #0000FF; text-decoration : underline; font-weight : bolder; } /* show URL of destination for external hyperlinks */ - a:not([href^="#"]):after + a[href]:not([href^="#"]):after { content : " " attr(href); font-family : Monaco, Consolas, "Lucida Console", monospace; } @@ -522,12 +571,12 @@ font-weight : normal; font-size : smaller; } /* document structure */ - #nav, + .nav, #lof { display : none; } @@ -538,11 +587,10 @@ { page-break-before : always; } /* document nodes */ - .part > .title > big, .chapter > .title > big { padding-bottom : 0.5em; } @@ -551,18 +599,17 @@ .chapter .title big { _padding-bottom : 0.5em; /* for IE6 */ } ]]> - </style> + </style> <style type="text/css" media="screen"> <![CDATA[ /* decorate external hyperlinks with a visual indicator */ - a:not([href^="#"]) + a[href]:not([href^="#"]) { - color : #3366BB; background : url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAAAFVBMVEVmmcwzmcyZzP8AZswAZv////////9E6giVAAAAB3RSTlP///////8AGksDRgAAADhJREFUGFcly0ESAEAEA0Ei6/9P3sEcVB8kmrwFyni0bOeyyDpy9JTLEaOhQq7Ongf5FeMhHS/4AVnsAZubxDVmAAAAAElFTkSuQmCC"); background-position : center right; background-repeat : no-repeat; padding-right : 13px; } @@ -578,152 +625,133 @@ } ]]> </style> </head> <body> - <div id="nav"> - <a href="#Abstract">Abstract</a> &middot; <a href="#Contents">Contents</a> &middot; <a href="#Cautions">Cautions</a> &middot; <a href="#Equations">Equations</a> &middot; <a href="#Examples">Examples</a> &middot; <a href="#Figures">Figures</a> &middot; <a href="#Importants">Importants</a> &middot; <a href="#Notes">Notes</a> &middot; <a href="#Procedures">Procedures</a> &middot; <a href="#Tables">Tables</a> &middot; <a href="#Tips">Tips</a> &middot; <a href="#Warnings">Warnings</a> &middot; <a href="#References">References</a> - </div> + <div id="body"> + <ul id="nav" class="nav"> + <li><a id="rev:Contents" href="#Contents">Contents</a></li> + <li><a id="rev:Cautions" href="#Cautions">Cautions</a></li> + <li><a id="rev:Equations" href="#Equations">Equations</a></li> + <li><a id="rev:Examples" href="#Examples">Examples</a></li> + <li><a id="rev:Figures" href="#Figures">Figures</a></li> + <li><a id="rev:Importants" href="#Importants">Importants</a></li> + <li><a id="rev:Notes" href="#Notes">Notes</a></li> + <li><a id="rev:Procedures" href="#Procedures">Procedures</a></li> + <li><a id="rev:Tables" href="#Tables">Tables</a></li> + <li><a id="rev:Tips" href="#Tips">Tips</a></li> + <li><a id="rev:Warnings" href="#Warnings">Warnings</a></li> + <li><a id="rev:References" href="#References">References</a></li> + </ul> <br style="display: none"/> <hr style="display: none"/> <br style="display: none"/> <div id="header"> - <p><img src='erbook.png' alt='erbook logo' /></p> - <h1 class="title">erbook 5.0.0 user manual</h1> - <h2 class="authors"><a href="http://snk.tuxfamily.org">Suraj N. Kurapati</a></h2> - <h3 class="date">22 November 2008</h3> - - </div> - + <div class="logo"><img src='erbook.png' alt='ERBook logo' /></div> - <div id="Abstract"> - <h1 class="title"><a class="here" title="Permanent link to this section" href="#Abstract">Abstract</a></h1> - <div class="content"><p>erbook is an extensible document processor that emits <a class="xref" href="#xhtml" title="Chapter 5.1. XHTML (web page)">XHTML (web page)</a>, <a class="xref" href="#latex" title="Chapter 5.3. LaTeX (PDF)">LaTeX (PDF)</a>, <a class="xref" href="#man" title="Chapter 5.4. man (UNIX manual page)">man (UNIX manual page)</a>, <a class="xref" href="#text" title="Chapter 5.2. Plain text">plain text</a>, and <a class="xref" href="#HelloWorld" title="Section 3.2.3. Creating your own document format">any document format you can imagine</a> from <a href='http://en.wikipedia.org/wiki/ERuby'>eRuby templates</a> that allow scripting and dynamic content generation. <span style='float: right; font-size: larger'><a class="xref" href="#Introduction" title="Chapter 1. Introduction">Read more&#8230;</a></span></p> + <h1 class="title">ERBook 6.0.0</h1> -<p><div class="paragraph"> - <p class="title"><a class="here" title="Permanent link to this section" href="#Resources">Resources</a></p> - <div class="content"><ul> -<li><a href='http://snk.tuxfamily.org/lib/erbook/log'>Release notes</a> &#8212; news of project releases. <a href='http://snk.tuxfamily.org/lib/erbook/ann'><img src='feed-icon-28x28.png' alt='RSS feed' /></a></li> + <h2 class="subtitle">Extensible document processor based on eRuby</h2> -<li><a href='http://snk.tuxfamily.org/lib/erbook/pkg'>Downloads</a> &#8212; obtain the newest release package.</li> + <h3 class="authors"><a href="mailto:sunaku@gmail.com">Suraj N. Kurapati</a></h3> -<li><a href='http://snk.tuxfamily.org/lib/erbook/src'>Source code</a> &#8212; obtain via <a href='http://git.or.cz'>Git</a> or browse online. <a href='http://snk.tuxfamily.org/lib/erbook/dev'><img src='feed-icon-28x28.png' alt='RSS feed' /></a></li> + <h3 class="date">19 January 2009</h3> + + </div> + -<li><a href='api/index.html'>API reference</a> &#8212; documentation for source code.</li> -</ul> + -<p>To get help or provide feedback, simply <a class="xref" href="#License" title="Section 1.2.2. License">contact the author</a>.</p></div> -</div></p></div> -</div> - <br style="display: none"/> <hr style="display: none"/> <br style="display: none"/> <div id="toc"> - <h1 class="title" id="Contents"><a class="here" href="#Contents">Contents</a></h1> + <a name="Contents"/><div class="nav" id="Contents"><a title="Reverse jump to listing" href="#rev:Contents">&equiv;</a>&#x25B3;&#x25BD;<a title="Jump to this segment" href="#Contents">&#x25CE;</a></div> + <h1 class="title">Contents</h1> <ul> - <li>1&nbsp;&nbsp;<a id="rev:Introduction" href="#Introduction">Introduction</a><ul><li>1.1&nbsp;&nbsp;<a id="rev:Relevance" href="#Relevance">Relevance</a><ul><li>1.1.1&nbsp;&nbsp;<a id="rev:Reviews" href="#Reviews">Reviews</a></li></ul></li><li>1.2&nbsp;&nbsp;<a id="rev:Logistics" href="#Logistics">Logistics</a><ul><li>1.2.1&nbsp;&nbsp;<a id="rev:Credits" href="#Credits">Credits</a></li><li>1.2.2&nbsp;&nbsp;<a id="rev:License" href="#License">License</a></li><li>1.2.3&nbsp;&nbsp;<a id="rev:Version-numbers" href="#Version-numbers">Version numbers</a></li></ul></li></ul></li><li>2&nbsp;&nbsp;<a id="rev:Setup" href="#Setup">Setup</a><ul><li>2.1&nbsp;&nbsp;<a id="rev:Requirements" href="#Requirements">Requirements</a></li><li>2.2&nbsp;&nbsp;<a id="rev:Installation" href="#Installation">Installation</a></li><li>2.3&nbsp;&nbsp;<a id="rev:Manifest" href="#Manifest">Manifest</a></li></ul></li><li>3&nbsp;&nbsp;<a id="rev:Theory-of-operation" href="#Theory-of-operation">Theory of operation</a><ul><li>3.1&nbsp;&nbsp;<a id="rev:Nodes" href="#Nodes">Nodes</a><ul><li>3.1.1&nbsp;&nbsp;<a id="rev:Node.class" href="#Node.class">The <code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Node</span></code> class</a></li></ul></li><li>3.2&nbsp;&nbsp;<a id="rev:SpecFile" href="#SpecFile">Format specification file</a><ul><li>3.2.1&nbsp;&nbsp;<a id="rev:SpecFile.nodes" href="#SpecFile.nodes">Node definition</a><ul><li>3.2.1.1&nbsp;&nbsp;<a id="rev:SpecFile.nodes.output" href="#SpecFile.nodes.output">Node output template</a></li></ul></li><li>3.2.2&nbsp;&nbsp;<a id="rev:SpecFile.output" href="#SpecFile.output">Document output template</a></li><li>3.2.3&nbsp;&nbsp;<a id="rev:HelloWorld" href="#HelloWorld">Creating your own document format</a></li></ul></li></ul></li><li>4&nbsp;&nbsp;<a id="rev:Usage" href="#Usage">Usage</a><ul><li>4.1&nbsp;&nbsp;<a id="rev:Command-line-invocation" href="#Command-line-invocation">Command-line invocation</a></li><li>4.2&nbsp;&nbsp;<a id="rev:include" href="#include">Including external documents</a></li><li>4.3&nbsp;&nbsp;<a id="rev:Unindenting-nodes-hierarchically" href="#Unindenting-nodes-hierarchically">Unindenting nodes hierarchically</a></li></ul></li><li>5&nbsp;&nbsp;<a id="rev:Formats" href="#Formats">Formats</a><ul><li>5.1&nbsp;&nbsp;<a id="rev:xhtml" href="#xhtml">XHTML (web page)</a><ul><li>5.1.1&nbsp;&nbsp;<a id="rev:Text-to-XHTML-conversion" href="#Text-to-XHTML-conversion">Text to XHTML conversion</a><ul><li>5.1.1.1&nbsp;&nbsp;<a id="rev:Syntax-coloring-for-source-code" href="#Syntax-coloring-for-source-code">Syntax coloring for source code</a><ul><li>5.1.1.1.1&nbsp;&nbsp;<a id="rev:Specifying-the-programming-language" href="#Specifying-the-programming-language">Specifying the programming language</a></li></ul></li><li>5.1.1.2&nbsp;&nbsp;<a id="rev:Smart-sizing-of-source-code" href="#Smart-sizing-of-source-code">Smart sizing of source code</a></li><li>5.1.1.3&nbsp;&nbsp;<a id="rev:Protecting-verbatim-text" href="#Protecting-verbatim-text">Protecting verbatim text</a></li></ul></li><li>5.1.2&nbsp;&nbsp;<a id="rev:Parameters" href="#Parameters">Parameters</a></li><li>5.1.3&nbsp;&nbsp;<a id="rev:Methods" href="#Methods">Methods</a><ul><li>5.1.3.1&nbsp;&nbsp;<a id="rev:a-ERBook::Node-title" href="#a-ERBook::Node-title"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Node</span><span style="color:#666">#title()</span></code></a></li><li>5.1.3.2&nbsp;&nbsp;<a id="rev:a-ERBook::Node-id" href="#a-ERBook::Node-id"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Node</span><span style="color:#666">#id()</span></code></a></li><li>5.1.3.3&nbsp;&nbsp;<a id="rev:a-ERBook::Node-title_xhtml" href="#a-ERBook::Node-title_xhtml"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Node</span><span style="color:#666">#title_xhtml()</span></code></a></li><li>5.1.3.4&nbsp;&nbsp;<a id="rev:a-ERBook::Node-content_xhtml" href="#a-ERBook::Node-content_xhtml"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Node</span><span style="color:#666">#content_xhtml()</span></code></a></li><li>5.1.3.5&nbsp;&nbsp;<a id="rev:a-ERBook::Node-title_link-aTitle-nil" href="#a-ERBook::Node-title_link-aTitle-nil"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Node</span><span style="color:#666">#title_link(aTitle = nil)</span></code></a></li><li>5.1.3.6&nbsp;&nbsp;<a id="rev:a-ERBook::Node-index_link" href="#a-ERBook::Node-index_link"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Node</span><span style="color:#666">#index_link()</span></code></a></li><li>5.1.3.7&nbsp;&nbsp;<a id="rev:a-ERBook::Node-number_link" href="#a-ERBook::Node-number_link"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Node</span><span style="color:#666">#number_link()</span></code></a></li><li>5.1.3.8&nbsp;&nbsp;<a id="rev:a-Hash-to_xml_atts" href="#a-Hash-to_xml_atts"><code class="code"><span style="color:#036;font-weight:bold">Hash</span><span style="color:#666">#to_xml_atts()</span></code></a></li><li>5.1.3.9&nbsp;&nbsp;<a id="rev:a-ERBook::Template-verbatim-aContent" href="#a-ERBook::Template-verbatim-aContent"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Template</span><span style="color:#666">#verbatim(aContent)</span></code></a></li><li>5.1.3.10&nbsp;&nbsp;<a id="rev:a-ERBook::Template-hyperlink-aUrl-aLabel-aUrl-aTitle-nil" href="#a-ERBook::Template-hyperlink-aUrl-aLabel-aUrl-aTitle-nil"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Template</span><span style="color:#666">#hyperlink(aUrl, aLabel = aUrl, aTitle = nil)</span></code></a></li><li>5.1.3.11&nbsp;&nbsp;<a id="rev:a-ERBook::Template-embed_image_file-aPath-aFormat-aPath-w-aAtts" href="#a-ERBook::Template-embed_image_file-aPath-aFormat-aPath-w-aAtts"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Template</span><span style="color:#666">#embed_image_file(aPath, aFormat = aPath[/\w+/], aAtts = {})</span></code></a></li><li>5.1.3.12&nbsp;&nbsp;<a id="rev:a-ERBook::Template-embed_image_data-aData-aFormat-aAtts" href="#a-ERBook::Template-embed_image_data-aData-aFormat-aAtts"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Template</span><span style="color:#666">#embed_image_data(aData, aFormat, aAtts = {})</span></code></a></li><li>5.1.3.13&nbsp;&nbsp;<a id="rev:a-String-to_xml_entities" href="#a-String-to_xml_entities"><code class="code"><span style="color:#036;font-weight:bold">String</span><span style="color:#666">#to_xml_entities()</span></code></a></li><li>5.1.3.14&nbsp;&nbsp;<a id="rev:a-String-to_uri_fragment" href="#a-String-to_uri_fragment"><code class="code"><span style="color:#036;font-weight:bold">String</span><span style="color:#666">#to_uri_fragment()</span></code></a></li><li>5.1.3.15&nbsp;&nbsp;<a id="rev:a-String-to_inline_xhtml" href="#a-String-to_inline_xhtml"><code class="code"><span style="color:#036;font-weight:bold">String</span><span style="color:#666">#to_inline_xhtml()</span></code></a></li><li>5.1.3.16&nbsp;&nbsp;<a id="rev:a-String-to_xhtml-aInline-false" href="#a-String-to_xhtml-aInline-false"><code class="code"><span style="color:#036;font-weight:bold">String</span><span style="color:#666">#to_xhtml(aInline = false)</span></code></a></li></ul></li><li>5.1.4&nbsp;&nbsp;<a id="rev:xhtml.nodes" href="#xhtml.nodes">Nodes</a><ul><li>5.1.4.1&nbsp;&nbsp;<a id="rev:Structural-nodes" href="#Structural-nodes">Structural nodes</a><ul><li>5.1.4.1.1&nbsp;&nbsp;<a id="rev:xhtml.nodes.header" href="#xhtml.nodes.header">header</a></li><li>5.1.4.1.2&nbsp;&nbsp;<a id="rev:xhtml.nodes.footer" href="#xhtml.nodes.footer">footer</a></li><li>5.1.4.1.3&nbsp;&nbsp;<a id="rev:xhtml.nodes.abstract" href="#xhtml.nodes.abstract">abstract</a></li><li>5.1.4.1.4&nbsp;&nbsp;<a id="rev:xhtml.nodes.xref" href="#xhtml.nodes.xref">xref</a></li></ul></li><li>5.1.4.2&nbsp;&nbsp;<a id="rev:Organizational-nodes" href="#Organizational-nodes">Organizational nodes</a><ul><li>5.1.4.2.1&nbsp;&nbsp;<a id="rev:xhtml.nodes.part" href="#xhtml.nodes.part">part</a><ul><li>5.1.4.2.1.1&nbsp;&nbsp;<a id="rev:An-example" href="#An-example">An example</a></li></ul></li><li>5.1.4.2.2&nbsp;&nbsp;<a id="rev:xhtml.nodes.chapter" href="#xhtml.nodes.chapter">chapter</a><ul><li>5.1.4.2.2.1&nbsp;&nbsp;<a id="rev:An-example-5.1.4.2.2.1" href="#An-example-5.1.4.2.2.1">An example</a></li></ul></li><li>5.1.4.2.3&nbsp;&nbsp;<a id="rev:xhtml.nodes.section" href="#xhtml.nodes.section">section</a><ul><li>5.1.4.2.3.1&nbsp;&nbsp;<a id="rev:An-example-5.1.4.2.3.1" href="#An-example-5.1.4.2.3.1">An example</a></li></ul></li><li>5.1.4.2.4&nbsp;&nbsp;<a id="rev:xhtml.nodes.paragraph" href="#xhtml.nodes.paragraph">paragraph</a></li></ul></li><li>5.1.4.3&nbsp;&nbsp;<a id="rev:Admonition-nodes" href="#Admonition-nodes">Admonition nodes</a><ul><li>5.1.4.3.1&nbsp;&nbsp;<a id="rev:xhtml.nodes.warning" href="#xhtml.nodes.warning">warning</a></li><li>5.1.4.3.2&nbsp;&nbsp;<a id="rev:xhtml.nodes.caution" href="#xhtml.nodes.caution">caution</a></li><li>5.1.4.3.3&nbsp;&nbsp;<a id="rev:xhtml.nodes.important" href="#xhtml.nodes.important">important</a></li><li>5.1.4.3.4&nbsp;&nbsp;<a id="rev:xhtml.nodes.note" href="#xhtml.nodes.note">note</a></li><li>5.1.4.3.5&nbsp;&nbsp;<a id="rev:xhtml.nodes.tip" href="#xhtml.nodes.tip">tip</a></li></ul></li><li>5.1.4.4&nbsp;&nbsp;<a id="rev:Auxilary-materials" href="#Auxilary-materials">Auxilary materials</a><ul><li>5.1.4.4.1&nbsp;&nbsp;<a id="rev:xhtml.nodes.figure" href="#xhtml.nodes.figure">figure</a></li><li>5.1.4.4.2&nbsp;&nbsp;<a id="rev:xhtml.nodes.table" href="#xhtml.nodes.table">table</a></li><li>5.1.4.4.3&nbsp;&nbsp;<a id="rev:xhtml.nodes.example" href="#xhtml.nodes.example">example</a></li><li>5.1.4.4.4&nbsp;&nbsp;<a id="rev:xhtml.nodes.equation" href="#xhtml.nodes.equation">equation</a></li><li>5.1.4.4.5&nbsp;&nbsp;<a id="rev:xhtml.nodes.procedure" href="#xhtml.nodes.procedure">procedure</a></li></ul></li><li>5.1.4.5&nbsp;&nbsp;<a id="rev:Bibliographical-nodes" href="#Bibliographical-nodes">Bibliographical nodes</a><ul><li>5.1.4.5.1&nbsp;&nbsp;<a id="rev:xhtml.nodes.reference" href="#xhtml.nodes.reference">reference</a></li><li>5.1.4.5.2&nbsp;&nbsp;<a id="rev:xhtml.nodes.cite" href="#xhtml.nodes.cite">cite</a></li></ul></li></ul></li></ul></li><li>5.2&nbsp;&nbsp;<a id="rev:text" href="#text">Plain text</a></li><li>5.3&nbsp;&nbsp;<a id="rev:latex" href="#latex">LaTeX (PDF)</a></li><li>5.4&nbsp;&nbsp;<a id="rev:man" href="#man">man (UNIX manual page)</a></li></ul></li> + <li>1&nbsp;&nbsp;<a id="rev:Introduction" href="#Introduction">Introduction</a><ul><li>1.1&nbsp;&nbsp;<a id="rev:Logistics" href="#Logistics">Logistics</a><ul><li><a id="rev:Version-numbers" href="#Version-numbers">Version numbers</a></li></ul></li><li>1.2&nbsp;&nbsp;<a id="rev:License" href="#License">License</a></li><li>1.3&nbsp;&nbsp;<a id="rev:Credits" href="#Credits">Credits</a></li><li>1.4&nbsp;&nbsp;<a id="rev:Reviews" href="#Reviews">Reviews</a></li></ul></li><li>2&nbsp;&nbsp;<a id="rev:Setup" href="#Setup">Setup</a><ul><li>2.1&nbsp;&nbsp;<a id="rev:Requirements" href="#Requirements">Requirements</a></li><li>2.2&nbsp;&nbsp;<a id="rev:Installation" href="#Installation">Installation</a></li><li>2.3&nbsp;&nbsp;<a id="rev:Manifest" href="#Manifest">Manifest</a></li></ul></li><li>3&nbsp;&nbsp;<a id="rev:Theory-of-operation" href="#Theory-of-operation">Theory of operation</a><ul><li>3.1&nbsp;&nbsp;<a id="rev:Nodes" href="#Nodes">Nodes</a><ul><li>3.1.1&nbsp;&nbsp;<a id="rev:Node.class" href="#Node.class">The <code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Document</span>::<span style="color:#036;font-weight:bold">Node</span></code> class</a></li></ul></li><li>3.2&nbsp;&nbsp;<a id="rev:SpecFile" href="#SpecFile">Format specification file</a><ul><li>3.2.1&nbsp;&nbsp;<a id="rev:SpecFile.nodes" href="#SpecFile.nodes">Node definition</a><ul><li>3.2.1.1&nbsp;&nbsp;<a id="rev:SpecFile.nodes.output" href="#SpecFile.nodes.output">Node output template</a></li></ul></li><li>3.2.2&nbsp;&nbsp;<a id="rev:SpecFile.output" href="#SpecFile.output">Document output template</a></li><li>3.2.3&nbsp;&nbsp;<a id="rev:HelloWorld" href="#HelloWorld">Creating your own document format</a></li></ul></li></ul></li><li>4&nbsp;&nbsp;<a id="rev:Usage" href="#Usage">Usage</a><ul><li>4.1&nbsp;&nbsp;<a id="rev:Command-line-interface" href="#Command-line-interface">Command-line interface</a><ul><li>4.1.1&nbsp;&nbsp;<a id="rev:Saving-the-output-to-a-file" href="#Saving-the-output-to-a-file">Saving the output to a file</a></li></ul></li><li>4.2&nbsp;&nbsp;<a id="rev:include" href="#include">Including external documents</a></li><li>4.3&nbsp;&nbsp;<a id="rev:Unindenting-nodes-hierarchically" href="#Unindenting-nodes-hierarchically">Unindenting nodes hierarchically</a></li></ul></li><li>5&nbsp;&nbsp;<a id="rev:Formats" href="#Formats">Formats</a><ul><li>5.1&nbsp;&nbsp;<a id="rev:xhtml" href="#xhtml">XHTML (web page)</a><ul><li>5.1.1&nbsp;&nbsp;<a id="rev:Text-to-XHTML-conversion" href="#Text-to-XHTML-conversion">Text to XHTML conversion</a><ul><li>5.1.1.1&nbsp;&nbsp;<a id="rev:Syntax-coloring-for-source-code" href="#Syntax-coloring-for-source-code">Syntax coloring for source code</a><ul><li>5.1.1.1.1&nbsp;&nbsp;<a id="rev:Specifying-the-programming-language" href="#Specifying-the-programming-language">Specifying the programming language</a></li></ul></li><li>5.1.1.2&nbsp;&nbsp;<a id="rev:Smart-sizing-of-source-code" href="#Smart-sizing-of-source-code">Smart sizing of source code</a></li><li>5.1.1.3&nbsp;&nbsp;<a id="rev:Protecting-verbatim-text" href="#Protecting-verbatim-text">Protecting verbatim text</a></li></ul></li><li>5.1.2&nbsp;&nbsp;<a id="rev:Parameters" href="#Parameters">Parameters</a></li><li>5.1.3&nbsp;&nbsp;<a id="rev:Methods" href="#Methods">Methods</a><ul><li><a id="rev:a-ERBook::Document::Node-title" href="#a-ERBook::Document::Node-title"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Document</span>::<span style="color:#036;font-weight:bold">Node</span><span style="color:#666">#title()</span></code></a></li><li><a id="rev:a-ERBook::Document::Node-id" href="#a-ERBook::Document::Node-id"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Document</span>::<span style="color:#036;font-weight:bold">Node</span><span style="color:#666">#id()</span></code></a></li><li><a id="rev:a-ERBook::Document::Node-title_xhtml" href="#a-ERBook::Document::Node-title_xhtml"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Document</span>::<span style="color:#036;font-weight:bold">Node</span><span style="color:#666">#title_xhtml()</span></code></a></li><li><a id="rev:a-ERBook::Document::Node-content_xhtml" href="#a-ERBook::Document::Node-content_xhtml"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Document</span>::<span style="color:#036;font-weight:bold">Node</span><span style="color:#666">#content_xhtml()</span></code></a></li><li><a id="rev:a-ERBook::Document::Node-title_link-title-nil" href="#a-ERBook::Document::Node-title_link-title-nil"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Document</span>::<span style="color:#036;font-weight:bold">Node</span><span style="color:#666">#title_link(title = nil)</span></code></a></li><li><a id="rev:a-ERBook::Document::Node-index_link" href="#a-ERBook::Document::Node-index_link"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Document</span>::<span style="color:#036;font-weight:bold">Node</span><span style="color:#666">#index_link()</span></code></a></li><li><a id="rev:a-ERBook::Document::Node-number_link" href="#a-ERBook::Document::Node-number_link"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Document</span>::<span style="color:#036;font-weight:bold">Node</span><span style="color:#666">#number_link()</span></code></a></li><li><a id="rev:a-ERBook::Document::Node-navigation" href="#a-ERBook::Document::Node-navigation"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Document</span>::<span style="color:#036;font-weight:bold">Node</span><span style="color:#666">#navigation()</span></code></a></li><li><a id="rev:a-ERBook::Document::Node::navigation-here_frag-list_frag-prev_frag-next_frag" href="#a-ERBook::Document::Node::navigation-here_frag-list_frag-prev_frag-next_frag"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Document</span>::<span style="color:#036;font-weight:bold">Node</span>::navigation(here_frag, list_frag, prev_frag, next_frag)</code></a></li><li><a id="rev:a-ERBook::Document::Node-xref_link-label-nil" href="#a-ERBook::Document::Node-xref_link-label-nil"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Document</span>::<span style="color:#036;font-weight:bold">Node</span><span style="color:#666">#xref_link(label = nil)</span></code></a></li><li><a id="rev:a-Hash-to_xml_atts" href="#a-Hash-to_xml_atts"><code class="code"><span style="color:#036;font-weight:bold">Hash</span><span style="color:#666">#to_xml_atts()</span></code></a></li><li><a id="rev:a-ERBook::Template-verbatim-content" href="#a-ERBook::Template-verbatim-content"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Template</span><span style="color:#666">#verbatim(content)</span></code></a></li><li><a id="rev:a-ERBook::Template-hyperlink-url-label-url-title-nil" href="#a-ERBook::Template-hyperlink-url-label-url-title-nil"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Template</span><span style="color:#666">#hyperlink(url, label = url, title = nil)</span></code></a></li><li><a id="rev:a-ERBook::Template-embed_image_file-path-format-path-w-atts" href="#a-ERBook::Template-embed_image_file-path-format-path-w-atts"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Template</span><span style="color:#666">#embed_image_file(path, format = path[/\w+/], atts = {})</span></code></a></li><li><a id="rev:a-ERBook::Template-embed_image_data-data-format-atts" href="#a-ERBook::Template-embed_image_data-data-format-atts"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Template</span><span style="color:#666">#embed_image_data(data, format, atts = {})</span></code></a></li><li><a id="rev:a-String-to_xml_entities" href="#a-String-to_xml_entities"><code class="code"><span style="color:#036;font-weight:bold">String</span><span style="color:#666">#to_xml_entities()</span></code></a></li><li><a id="rev:a-String-to_uri_fragment" href="#a-String-to_uri_fragment"><code class="code"><span style="color:#036;font-weight:bold">String</span><span style="color:#666">#to_uri_fragment()</span></code></a></li><li><a id="rev:a-String-to_inline_xhtml" href="#a-String-to_inline_xhtml"><code class="code"><span style="color:#036;font-weight:bold">String</span><span style="color:#666">#to_inline_xhtml()</span></code></a></li><li><a id="rev:a-String-to_xhtml-inline-false" href="#a-String-to_xhtml-inline-false"><code class="code"><span style="color:#036;font-weight:bold">String</span><span style="color:#666">#to_xhtml(inline = false)</span></code></a></li></ul></li><li>5.1.4&nbsp;&nbsp;<a id="rev:xhtml.nodes" href="#xhtml.nodes">Nodes</a><ul><li>5.1.4.1&nbsp;&nbsp;<a id="rev:Structural-nodes" href="#Structural-nodes">Structural nodes</a><ul><li>5.1.4.1.1&nbsp;&nbsp;<a id="rev:xhtml.nodes.header" href="#xhtml.nodes.header">header</a></li><li>5.1.4.1.2&nbsp;&nbsp;<a id="rev:xhtml.nodes.footer" href="#xhtml.nodes.footer">footer</a></li><li>5.1.4.1.3&nbsp;&nbsp;<a id="rev:xhtml.nodes.abstract" href="#xhtml.nodes.abstract">abstract</a></li><li>5.1.4.1.4&nbsp;&nbsp;<a id="rev:xhtml.nodes.xref" href="#xhtml.nodes.xref">xref</a></li></ul></li><li>5.1.4.2&nbsp;&nbsp;<a id="rev:Organizational-nodes" href="#Organizational-nodes">Organizational nodes</a><ul><li>5.1.4.2.1&nbsp;&nbsp;<a id="rev:xhtml.nodes.node" href="#xhtml.nodes.node">node</a></li><li>5.1.4.2.2&nbsp;&nbsp;<a id="rev:xhtml.nodes.part" href="#xhtml.nodes.part">part</a><ul><li>5.1.4.2.2.1&nbsp;&nbsp;<a id="rev:An-example" href="#An-example">An example</a></li></ul></li><li>5.1.4.2.3&nbsp;&nbsp;<a id="rev:xhtml.nodes.chapter" href="#xhtml.nodes.chapter">chapter</a><ul><li>5.1.4.2.3.1&nbsp;&nbsp;<a id="rev:An-example-5.1.4.2.3.1" href="#An-example-5.1.4.2.3.1">An example</a></li></ul></li><li>5.1.4.2.4&nbsp;&nbsp;<a id="rev:xhtml.nodes.section" href="#xhtml.nodes.section">section</a><ul><li>5.1.4.2.4.1&nbsp;&nbsp;<a id="rev:An-example-5.1.4.2.4.1" href="#An-example-5.1.4.2.4.1">An example</a></li></ul></li><li>5.1.4.2.5&nbsp;&nbsp;<a id="rev:xhtml.nodes.paragraph" href="#xhtml.nodes.paragraph">paragraph</a><ul><li><a id="rev:An-example-608866148" href="#An-example-608866148">An example</a></li></ul></li></ul></li><li>5.1.4.3&nbsp;&nbsp;<a id="rev:Admonition-nodes" href="#Admonition-nodes">Admonition nodes</a><ul><li>5.1.4.3.1&nbsp;&nbsp;<a id="rev:xhtml.nodes.warning" href="#xhtml.nodes.warning">warning</a></li><li>5.1.4.3.2&nbsp;&nbsp;<a id="rev:xhtml.nodes.caution" href="#xhtml.nodes.caution">caution</a></li><li>5.1.4.3.3&nbsp;&nbsp;<a id="rev:xhtml.nodes.important" href="#xhtml.nodes.important">important</a></li><li>5.1.4.3.4&nbsp;&nbsp;<a id="rev:xhtml.nodes.note" href="#xhtml.nodes.note">note</a></li><li>5.1.4.3.5&nbsp;&nbsp;<a id="rev:xhtml.nodes.tip" href="#xhtml.nodes.tip">tip</a></li></ul></li><li>5.1.4.4&nbsp;&nbsp;<a id="rev:Auxilary-materials" href="#Auxilary-materials">Auxilary materials</a><ul><li>5.1.4.4.1&nbsp;&nbsp;<a id="rev:xhtml.nodes.figure" href="#xhtml.nodes.figure">figure</a></li><li>5.1.4.4.2&nbsp;&nbsp;<a id="rev:xhtml.nodes.table" href="#xhtml.nodes.table">table</a></li><li>5.1.4.4.3&nbsp;&nbsp;<a id="rev:xhtml.nodes.example" href="#xhtml.nodes.example">example</a></li><li>5.1.4.4.4&nbsp;&nbsp;<a id="rev:xhtml.nodes.equation" href="#xhtml.nodes.equation">equation</a></li><li>5.1.4.4.5&nbsp;&nbsp;<a id="rev:xhtml.nodes.procedure" href="#xhtml.nodes.procedure">procedure</a></li></ul></li><li>5.1.4.5&nbsp;&nbsp;<a id="rev:Bibliographical-nodes" href="#Bibliographical-nodes">Bibliographical nodes</a><ul><li>5.1.4.5.1&nbsp;&nbsp;<a id="rev:xhtml.nodes.reference" href="#xhtml.nodes.reference">reference</a><ul><li><a id="rev:An-example-609181648" href="#An-example-609181648">An example</a></li></ul></li><li>5.1.4.5.2&nbsp;&nbsp;<a id="rev:xhtml.nodes.cite" href="#xhtml.nodes.cite">cite</a></li></ul></li></ul></li></ul></li><li>5.2&nbsp;&nbsp;<a id="rev:text" href="#text">Plain text</a></li><li>5.3&nbsp;&nbsp;<a id="rev:latex" href="#latex">LaTeX (PDF)</a></li><li>5.4&nbsp;&nbsp;<a id="rev:man" href="#man">UNIX manual page</a></li></ul></li><li>6&nbsp;&nbsp;<a id="rev:history" href="#history">Project history</a><ul><li>6.1&nbsp;&nbsp;<a id="rev:Version-6.0.0-2009-01-19" href="#Version-6.0.0-2009-01-19">Version 6.0.0 (2009-01-19)</a><ul><li><a id="rev:Incompatible-changes" href="#Incompatible-changes">Incompatible changes</a></li><li><a id="rev:New-features" href="#New-features">New features</a></li><li><a id="rev:Bug-fixes" href="#Bug-fixes">Bug fixes</a></li><li><a id="rev:Housekeeping" href="#Housekeeping">Housekeeping</a></li></ul></li></ul></li> - <li><a href="#References">References</a></li> + <li><a id="rev:References" href="#References">References</a></li> </ul> </div> - <div id="lof"><h2 id="Cautions" class="title"><a class="here" href="#Cautions">Cautions</a></h2> <ol><li><a id="rev:An-example-1-1" href="#An-example-1-1">An example</a></li></ol><h2 id="Equations" class="title"><a class="here" href="#Equations">Equations</a></h2> <ol><li><a id="rev:An-example-1-1-1-1-1-1" href="#An-example-1-1-1-1-1-1">An example</a></li></ol><h2 id="Examples" class="title"><a class="here" href="#Examples">Examples</a></h2> <ol><li><a id="rev:HelloWorld.spec" href="#HelloWorld.spec">HelloWorld format specification file</a></li><li><a id="rev:HelloWorld.input" href="#HelloWorld.input">Input document for HelloWorld format</a></li><li><a id="rev:HelloWorld.output" href="#HelloWorld.output">Output of HelloWorld format</a></li><li><a id="rev:An-example-4" href="#An-example-4">An example</a></li></ol><h2 id="Figures" class="title"><a class="here" href="#Figures">Figures</a></h2> <ol><li><a id="rev:An-example-1-1-1-1" href="#An-example-1-1-1-1">An example</a></li></ol><h2 id="Importants" class="title"><a class="here" href="#Importants">Importants</a></h2> <ol><li><a id="rev:Save-XHTML-output-as-.xhtml" href="#Save-XHTML-output-as-.xhtml">Save XHTML output as <tt>.xhtml</tt></a></li><li><a id="rev:An-example-2" href="#An-example-2">An example</a></li></ol><h2 id="Notes" class="title"><a class="here" href="#Notes">Notes</a></h2> <ol><li><a id="rev:See-the-source-of-this-manual" href="#See-the-source-of-this-manual">See the source of this manual</a></li><li><a id="rev:An-example-2-2" href="#An-example-2-2">An example</a></li></ol><h2 id="Procedures" class="title"><a class="here" href="#Procedures">Procedures</a></h2> <ol><li><a id="rev:An-example-1-1-1-1-1-1-1" href="#An-example-1-1-1-1-1-1-1">An example</a></li></ol><h2 id="Tables" class="title"><a class="here" href="#Tables">Tables</a></h2> <ol><li><a id="rev:An-example-1-1-1-1-1" href="#An-example-1-1-1-1-1">An example</a></li></ol><h2 id="Tips" class="title"><a class="here" href="#Tips">Tips</a></h2> <ol><li><a id="rev:An-example-1-1-1" href="#An-example-1-1-1">An example</a></li></ol><h2 id="Warnings" class="title"><a class="here" href="#Warnings">Warnings</a></h2> <ol><li><a id="rev:An-example-1" href="#An-example-1">An example</a></li></ol></div> + <div id="lof"><a name="Cautions"/><div class="nav" id="Cautions"><a title="Reverse jump to listing" href="#rev:Cautions">&equiv;</a>&#x25B3;&#x25BD;<a title="Jump to this segment" href="#Cautions">&#x25CE;</a></div><h2 class="title">Cautions</h2> <ol><li><a id="rev:An-example-1-1" href="#An-example-1-1">An example</a></li></ol><a name="Equations"/><div class="nav" id="Equations"><a title="Reverse jump to listing" href="#rev:Equations">&equiv;</a>&#x25B3;&#x25BD;<a title="Jump to this segment" href="#Equations">&#x25CE;</a></div><h2 class="title">Equations</h2> <ol><li><a id="rev:An-example-1-1-1-1-1-1-1" href="#An-example-1-1-1-1-1-1-1">An example</a></li></ol><a name="Examples"/><div class="nav" id="Examples"><a title="Reverse jump to listing" href="#rev:Examples">&equiv;</a>&#x25B3;&#x25BD;<a title="Jump to this segment" href="#Examples">&#x25CE;</a></div><h2 class="title">Examples</h2> <ol><li><a id="rev:HelloWorld.spec" href="#HelloWorld.spec">HelloWorld format specification file</a></li><li><a id="rev:HelloWorld.input" href="#HelloWorld.input">Input document for HelloWorld format</a></li><li><a id="rev:HelloWorld.output" href="#HelloWorld.output">Output of HelloWorld format</a></li><li><a id="rev:An-example-4" href="#An-example-4">An example</a></li></ol><a name="Figures"/><div class="nav" id="Figures"><a title="Reverse jump to listing" href="#rev:Figures">&equiv;</a>&#x25B3;&#x25BD;<a title="Jump to this segment" href="#Figures">&#x25CE;</a></div><h2 class="title">Figures</h2> <ol><li><a id="rev:An-example-1-1-1-1-1" href="#An-example-1-1-1-1-1">An example</a></li></ol><a name="Importants"/><div class="nav" id="Importants"><a title="Reverse jump to listing" href="#rev:Importants">&equiv;</a>&#x25B3;&#x25BD;<a title="Jump to this segment" href="#Importants">&#x25CE;</a></div><h2 class="title">Importants</h2> <ol><li><a id="rev:Save-XHTML-output-as-.xhtml" href="#Save-XHTML-output-as-.xhtml">Save XHTML output as <tt>.xhtml</tt></a></li><li><a id="rev:An-example-2" href="#An-example-2">An example</a></li></ol><a name="Notes"/><div class="nav" id="Notes"><a title="Reverse jump to listing" href="#rev:Notes">&equiv;</a>&#x25B3;&#x25BD;<a title="Jump to this segment" href="#Notes">&#x25CE;</a></div><h2 class="title">Notes</h2> <ol><li><a id="rev:An-example-1-1-1" href="#An-example-1-1-1">An example</a></li></ol><a name="Procedures"/><div class="nav" id="Procedures"><a title="Reverse jump to listing" href="#rev:Procedures">&equiv;</a>&#x25B3;&#x25BD;<a title="Jump to this segment" href="#Procedures">&#x25CE;</a></div><h2 class="title">Procedures</h2> <ol><li><a id="rev:An-example-1-1-1-1-1-1-1-1" href="#An-example-1-1-1-1-1-1-1-1">An example</a></li></ol><a name="Tables"/><div class="nav" id="Tables"><a title="Reverse jump to listing" href="#rev:Tables">&equiv;</a>&#x25B3;&#x25BD;<a title="Jump to this segment" href="#Tables">&#x25CE;</a></div><h2 class="title">Tables</h2> <ol><li><a id="rev:An-example-1-1-1-1-1-1" href="#An-example-1-1-1-1-1-1">An example</a></li></ol><a name="Tips"/><div class="nav" id="Tips"><a title="Reverse jump to listing" href="#rev:Tips">&equiv;</a>&#x25B3;&#x25BD;<a title="Jump to this segment" href="#Tips">&#x25CE;</a></div><h2 class="title">Tips</h2> <ol><li><a id="rev:An-example-1-1-1-1" href="#An-example-1-1-1-1">An example</a></li></ol><a name="Warnings"/><div class="nav" id="Warnings"><a title="Reverse jump to listing" href="#rev:Warnings">&equiv;</a>&#x25B3;&#x25BD;<a title="Jump to this segment" href="#Warnings">&#x25CE;</a></div><h2 class="title">Warnings</h2> <ol><li><a id="rev:An-example-1" href="#An-example-1">An example</a></li></ol></div> <br style="display: none"/> <hr style="display: none"/> <br style="display: none"/> <div id="content"> - <div class="chapter"> + <a name="Introduction"/><div class="nav" id="Introduction"><a title="Reverse jump to listing" href="#rev:Introduction">&equiv;</a>&#x25B3;<a title="Jump to next segment" href="#Logistics">&#x25BD;</a><a title="Jump to this segment" href="#Introduction">&#x25CE;</a></div> <h1 class="title"> - Chapter&nbsp;<a class="list" title="Return to table of contents" id="Introduction" href="#rev:Introduction">1</a> + Chapter&nbsp;1 <br/> - <big><a class="here" title="Permanent link to this section" href="#Introduction">Introduction</a></big> + <big>Introduction</big> </h1> - <div class="content"><p>erbook is an extensible document processor that emits <a class="xref" href="#xhtml" title="Chapter 5.1. XHTML (web page)">XHTML (web page)</a>, <a class="xref" href="#latex" title="Chapter 5.3. LaTeX (PDF)">LaTeX (PDF)</a>, <a class="xref" href="#man" title="Chapter 5.4. man (UNIX manual page)">man (UNIX manual page)</a>, <a class="xref" href="#text" title="Chapter 5.2. Plain text">plain text</a>, and <a class="xref" href="#HelloWorld" title="Section 3.2.3. Creating your own document format">any document format you can imagine</a> from <a href='http://en.wikipedia.org/wiki/ERuby'>eRuby templates</a> that allow scripting and dynamic content generation.</p> + <div class="content"><p><p><strong>ERBook</strong> is an extensible document processor that emits <a class="xref" href="#HelloWorld" title="Section 3.2.3. Creating your own document format">any document you can imagine</a> from <a href='http://en.wikipedia.org/wiki/ERuby'>eRuby templates</a> that allow scripting and dynamic content generation.</p> -<p><div class="note"> - <p class="title"><a class="list" title="Return to table of contents" id="See-the-source-of-this-manual" href="#rev:See-the-source-of-this-manual">Note 1</a>.&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#See-the-source-of-this-manual">See the source of this manual</a></p> - <div class="content"><img class="icon" src="&icon_note;" alt="note"/><p>Did you know that this manual was generated by erbook? Here is <a href='manual.erb'>the source document</a> to prove it!</p></div> -</div> <div class="section"> - <h2 class="title"> - <a class="list" title="Return to table of contents" id="Relevance" href="#rev:Relevance">1.1</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#Relevance">Relevance</a> - </h2> - <div class="content"><p>Unlike document processors such as <a href='http://www.docbook.org'>DocBook</a>, <a href='http://deplate.sourceforge.net'>Deplate</a>, and <a href='http://www.jus.uio.no/sisu/SiSU/'>SiSU</a>, erbook is:</p> +<p>A working <a class="xref" href="#xhtml" title="Chapter 5.1. XHTML (web page)">XHTML (web page)</a> format is provided, while <a class="xref" href="#latex" title="Chapter 5.3. LaTeX (PDF)">LaTeX (PDF)</a>, <a class="xref" href="#man" title="Chapter 5.4. UNIX manual page">UNIX manual page</a>, and <a class="xref" href="#text" title="Chapter 5.2. Plain text">plain text</a> formats are planned&#8230; <a class="xref" href="#License" title="Section 1.2. License">patches are welcome</a>!</p> <strong>ERBook</strong> is exciting because:</p> <ul> -<li><em>tiny</em> because its core contains less than 210 source lines of code</li> +<li>Its documents are scriptable <a href='http://en.wikipedia.org/wiki/ERuby'>eRuby templates</a>.</li> -<li><em>extensible</em> because it lets you define <a class="xref" href="#HelloWorld" title="Section 3.2.3. Creating your own document format">your own custom document format</a></li> +<li>It lets you <a class="xref" href="#HelloWorld" title="Section 3.2.3. Creating your own document format">define your own document formats</a>.</li> + +<li>Its core contains less than 300 lines of code.</li> </ul> -<p>Unlike the documents of raw text processors such as <a href='http://www.methods.co.nz/asciidoc/'>AsciiDoc</a>, <a href='http://txt2tags.sourceforge.net'>txt2tags</a>, and <a href='http://www.triptico.com/software/grutatxt.html'>Grutatxt</a>, erbook documents are <em>scriptable</em> eRuby templates, which means that you can inject arbitrary Ruby code into your documents for <strong>dynamic content generation</strong>.</p> +<p>These features distinguish <strong>ERBook</strong> from the competition, which offers neither scriptable documents nor definable document formats:</p> -<p><div class="section"> - <h3 class="title"> - <a class="list" title="Return to table of contents" id="Reviews" href="#rev:Reviews">1.1.1</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#Reviews">Reviews</a> - </h3> - <div class="content"><p>Vitor Peres in <a href='http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/283052'>ruby-talk</a>:</p> +<ul> +<li><a href='http://www.docbook.org'>DocBook</a></li> -<blockquote> -<p>I actually felt like printing [this manual], because it&#8217;s just so well-thought typographically&#8230; Even if [erbook] weren&#8217;t great by itself, I&#8217;d feel good just looking at the manual.</p> -</blockquote> +<li><a href='http://deplate.sourceforge.net'>Deplate</a></li> -<p>Ara T. Howard in <a href='http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/282949'>ruby-talk</a>:</p> +<li><a href='http://www.jus.uio.no/sisu/SiSU/'>SiSU</a></li> -<blockquote> -<p>[this manual is] a insanely complete and nice looking bit of documentation [&#8230; erbook] looks like a great project</p> -</blockquote> +<li><a href='http://www.methods.co.nz/asciidoc/'>AsciiDoc</a></li> -<p>Martin DeMello in <a href='http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/283304'>ruby-talk</a>:</p> +<li><a href='http://txt2tags.sourceforge.net'>txt2tags</a></li> -<blockquote> -<p>Very nice work indeed!</p> -</blockquote></div> -</div></p></div> -</div> <div class="section"> +<li><a href='http://www.triptico.com/software/grutatxt.html'>Grutatxt</a></li> +</ul> + +<p><div class="section"> + <a name="Logistics"/><div class="nav" id="Logistics"><a title="Reverse jump to listing" href="#rev:Logistics">&equiv;</a><a title="Jump to previous segment" href="#Introduction">&#x25B3;</a><a title="Jump to next segment" href="#Version-numbers">&#x25BD;</a><a title="Jump to this segment" href="#Logistics">&#x25CE;</a></div> <h2 class="title"> - <a class="list" title="Return to table of contents" id="Logistics" href="#rev:Logistics">1.2</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#Logistics">Logistics</a> + 1.1&nbsp;&nbsp;Logistics </h2> - <div class="content"><p>erbook is <a class="xref" href="#License" title="Section 1.2.2. License">open source software</a> so feel free to contribute your improvements and discuss your ideas <a class="xref" href="#License" title="Section 1.2.2. License">with the author</a>. You can obtain the source code from <a href='http://snk.tuxfamily.org/lib/erbook/src'>this source repository</a> and monitor for changes by subscribing to <a href='http://snk.tuxfamily.org/lib/erbook/dev'>this news feed</a>.</p> + <div class="content"><ul> +<li><a class="xref" href="#history" title="Chapter 6. Project history">Release notes</a> &#8212; history of project releases.</li> -<p><div class="section"> - <h3 class="title"> - <a class="list" title="Return to table of contents" id="Credits" href="#rev:Credits">1.2.1</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#Credits">Credits</a> - </h3> - <div class="content"><p>The erbook logo, its image file &#8220;erbook.png&#8221;, and its source file &#8220;erbook.svg&#8221; make use of the <a href='http://openclipart.org/media/files/lemmling/9065'>&#8220;cartoon owl sitting on a book&#8221;</a> graphic, which was created and released into the public domain by <a href='http://openclipart.org/media/people/lemmling'>Jens Vierbuchen</a> on July 7, 2008.</p></div> -</div> <div class="section"> - <h3 class="title"> - <a class="list" title="Return to table of contents" id="License" href="#rev:License">1.2.2</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#License">License</a> - </h3> - <div class="content"><p>Copyright 2006 Suraj N. Kurapati <a href='mailto:sunaku@gmail.com'>&#115;&#117;&#110;&#097;&#107;&#117;&#064;&#103;&#109;&#097;&#105;&#108;&#046;&#099;&#111;&#109;</a></p> +<li><a href='http://github.com/sunaku/erbook'>Source code</a> &#8212; obtain via <a href='http://git.or.cz'>Git</a> or browse online.</li> -<p>Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.</p> +<li><a href='api/index.html'>API reference</a> &#8212; documentation for source code.</li> +</ul> -<p>THE SOFTWARE IS PROVIDED &#8220;AS IS&#8221; AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.</p></div> -</div> <div class="section"> - <h3 class="title"> - <a class="list" title="Return to table of contents" id="Version-numbers" href="#rev:Version-numbers">1.2.3</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#Version-numbers">Version numbers</a> - </h3> - <div class="content"><p>erbook releases are numbered in <em>major.minor.patch</em> form, according to the <a href='http://www.rubygems.org/read/chapter/7'>RubyGems rational versioning policy</a> which can be <a href='http://ablog.apress.com/?p=738'>summarized</a> thus:</p> +<p>To get help or provide feedback, simply <a class="xref" href="#License" title="Section 1.2. License">contact the authors</a>.</p> + +<p><div class="paragraph"> + <a name="Version-numbers"/><div class="nav" id="Version-numbers"><a title="Reverse jump to listing" href="#rev:Version-numbers">&equiv;</a><a title="Jump to previous segment" href="#Logistics">&#x25B3;</a><a title="Jump to next segment" href="#License">&#x25BD;</a><a title="Jump to this segment" href="#Version-numbers">&#x25CE;</a></div> + <p class="title">Version numbers</p> + <div class="content"><p><strong>ERBook</strong> releases are numbered in <em>major.minor.patch</em> form according to the <a href='http://www.rubygems.org/read/chapter/7'>RubyGems rational versioning policy</a>, which can be summarized thus:</p> <table border="1"> <thead> <tr> <td rowspan='2'>What increased in the version number?</td> - <td colspan='3'>What does the increase signify about the release?</td> + <td colspan='3'>The increase indicates that the release:</td> </tr> <tr> - <th>Backwards compatible?</th> - <th>New features?</th> - <th>Bug fixes?</th> + <th>Is backward compatible?</th> + <th>Has new features?</th> + <th>Has bug fixes?</th> </tr> </thead> <tbody> <tr> <th>major</th> @@ -744,80 +772,104 @@ <td>Yes</td> </tr> </tbody> </table></div> </div></p></div> +</div> <div class="section"> + <a name="License"/><div class="nav" id="License"><a title="Reverse jump to listing" href="#rev:License">&equiv;</a><a title="Jump to previous segment" href="#Version-numbers">&#x25B3;</a><a title="Jump to next segment" href="#Credits">&#x25BD;</a><a title="Jump to this segment" href="#License">&#x25CE;</a></div> + <h2 class="title"> + 1.2&nbsp;&nbsp;License + </h2> + <div class="content"><p>Copyright 2006 Suraj N. Kurapati <a href='mailto:sunaku@gmail.com'>&#115;&#117;&#110;&#097;&#107;&#117;&#064;&#103;&#109;&#097;&#105;&#108;&#046;&#099;&#111;&#109;</a></p> + +<p>Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.</p> + +<p>THE SOFTWARE IS PROVIDED &#8220;AS IS&#8221; AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.</p></div> +</div> <div class="section"> + <a name="Credits"/><div class="nav" id="Credits"><a title="Reverse jump to listing" href="#rev:Credits">&equiv;</a><a title="Jump to previous segment" href="#License">&#x25B3;</a><a title="Jump to next segment" href="#Reviews">&#x25BD;</a><a title="Jump to this segment" href="#Credits">&#x25CE;</a></div> + <h2 class="title"> + 1.3&nbsp;&nbsp;Credits + </h2> + <div class="content"><img src='erbook.png' alt='ERBook logo' /> +<p>The &#8220;erbook.png&#8221; image and its &#8220;erbook.svg&#8221; source utilize the <a href='http://openclipart.org/media/files/lemmling/9065'>&#8220;cartoon owl sitting on a book&#8221;</a> graphic, which was created and released into the public domain by <a href='http://openclipart.org/media/people/lemmling'>Jens Vierbuchen</a> on July 7, 2008.</p></div> +</div> <div class="section"> + <a name="Reviews"/><div class="nav" id="Reviews"><a title="Reverse jump to listing" href="#rev:Reviews">&equiv;</a><a title="Jump to previous segment" href="#Credits">&#x25B3;</a><a title="Jump to next segment" href="#Setup">&#x25BD;</a><a title="Jump to this segment" href="#Reviews">&#x25CE;</a></div> + <h2 class="title"> + 1.4&nbsp;&nbsp;Reviews + </h2> + <div class="content"><p>Vitor Peres in <a href='http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/283052'>ruby-talk</a>:</p> + +<blockquote> +<p>I actually felt like printing [this manual], because it&#8217;s just so well-thought typographically&#8230; Even if [<strong>ERBook</strong>] weren&#8217;t great by itself, I&#8217;d feel good just looking at the manual.</p> +</blockquote> + +<p>Ara T. Howard in <a href='http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/282949'>ruby-talk</a>:</p> + +<blockquote> +<p>[this manual is] a insanely complete and nice looking bit of documentation [&#8230; <strong>ERBook</strong>] looks like a great project</p> +</blockquote> + +<p>Martin DeMello in <a href='http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/283304'>ruby-talk</a>:</p> + +<blockquote> +<p>Very nice work indeed!</p> +</blockquote></div> </div></p></div> </div> <div class="chapter"> + <a name="Setup"/><div class="nav" id="Setup"><a title="Reverse jump to listing" href="#rev:Setup">&equiv;</a><a title="Jump to previous segment" href="#Reviews">&#x25B3;</a><a title="Jump to next segment" href="#Requirements">&#x25BD;</a><a title="Jump to this segment" href="#Setup">&#x25CE;</a></div> <h1 class="title"> - Chapter&nbsp;<a class="list" title="Return to table of contents" id="Setup" href="#rev:Setup">2</a> + Chapter&nbsp;2 <br/> - <big><a class="here" title="Permanent link to this section" href="#Setup">Setup</a></big> + <big>Setup</big> </h1> <div class="content"><p><div class="section"> + <a name="Requirements"/><div class="nav" id="Requirements"><a title="Reverse jump to listing" href="#rev:Requirements">&equiv;</a><a title="Jump to previous segment" href="#Setup">&#x25B3;</a><a title="Jump to next segment" href="#Installation">&#x25BD;</a><a title="Jump to this segment" href="#Requirements">&#x25CE;</a></div> <h2 class="title"> - <a class="list" title="Return to table of contents" id="Requirements" href="#rev:Requirements">2.1</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#Requirements">Requirements</a> + 2.1&nbsp;&nbsp;Requirements </h2> - <div class="content"><p>Your system needs the following software to run erbook.</p> -<table border="1"><thead><tr><th>Software</th><th>Description</th><th>Notes</th></tr></thead><tbody><tr><td style='text-align: left;'><a href='http://ruby-lang.org'>Ruby</a></td><td style='text-align: left;'>Ruby language interpreter</td><td style='text-align: left;'>Version 1.8.x is required.</td> -</tr><tr><td style='text-align: left;'><a href='http://maruku.rubyforge.org'>Maruku</a></td><td style='text-align: left;'>Markdown processor</td><td style='text-align: left;'>Required by the <a class="xref" href="#xhtml" title="Chapter 5.1. XHTML (web page)">default XHTML format</a>.</td> -</tr><tr><td style='text-align: left;'><a href='http://coderay.rubychan.de'>CodeRay</a></td><td style='text-align: left;'>Syntax highlighter</td><td style='text-align: left;'>Required by the <a class="xref" href="#xhtml" title="Chapter 5.1. XHTML (web page)">default XHTML format</a>.</td> -</tr><tr><td style='text-align: left;'><a href='http://trollop.rubyforge.org'>Trollop</a></td><td style='text-align: left;'>Command-line option parser</td><td style='text-align: left;'>Required by the <em>erbook</em> executable.</td> -</tr></tbody></table> -<p>If your system has <a href='http://rubygems.org'>RubyGems</a>, then you can install Maruku and CodeRay by running the following command:</p> - -<pre>gem install trollop maruku coderay</pre></div> + <div class="content"><p>Your system needs the following software to run <strong>ERBook</strong>.</p> +<table border="1"><thead><tr><th>Software</th><th>Description</th><th>Notes</th></tr></thead><tbody><tr><td style='text-align: left;'><a href='http://ruby-lang.org'>Ruby</a></td><td style='text-align: left;'>Ruby language interpreter</td><td style='text-align: left;'>Version 1.8.7 or newer is required.</td> +</tr><tr><td style='text-align: left;'><a href='http://rubygems.org'>RubyGems</a></td><td style='text-align: left;'>Ruby packaging system</td><td style='text-align: left;'>Version 1.0.0 or newer is required.</td> +</tr></tbody></table></div> </div> <div class="section"> + <a name="Installation"/><div class="nav" id="Installation"><a title="Reverse jump to listing" href="#rev:Installation">&equiv;</a><a title="Jump to previous segment" href="#Requirements">&#x25B3;</a><a title="Jump to next segment" href="#Manifest">&#x25BD;</a><a title="Jump to this segment" href="#Installation">&#x25CE;</a></div> <h2 class="title"> - <a class="list" title="Return to table of contents" id="Installation" href="#rev:Installation">2.2</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#Installation">Installation</a> + 2.2&nbsp;&nbsp;Installation </h2> - <div class="content"><p>If your system has <a href='http://rubygems.org'>RubyGems</a>, then you can install erbook by running the following commands:</p> + <div class="content"><p>You can install <strong>ERBook</strong> by running this command:</p> -<pre>gem install erbook -erbook -v</pre> +<pre>gem install erbook</pre> -<p>Otherwise, follow these instructions:</p> +<p>To check whether the installation was sucessful, run this command:</p> -<ol> -<li> -<p>Download the newest release package from <a href='http://snk.tuxfamily.org/lib/erbook/pkg'>the download area</a>.</p> -</li> +<pre>erbook -v</pre> -<li> -<p>Extract the release package somewhere on your system.</p> -</li> +<p>If the installation was successful, you will see output like this:</p> -<li> -<p>Go inside the extracted directory and run the following command:</p> +<p><pre>project: ERBook +version: 6.0.0 +release: 2009-01-19 +website: http://snk.tuxfamily.org/lib/erbook/ +install: /home/sun/src/erbook</pre></p> -<pre>ruby bin/erbook -v</pre> -</li> -</ol> - -<p>If the installation was successful, then you will see output like this: <pre>project: erbook -version: 5.0.0 -release: 2008-11-22 -website: http://snk.tuxfamily.org/lib/erbook -install: /home/sun/src/erbook -</pre></p> - -<p>Otherwise, you can <a class="xref" href="#License" title="Section 1.2.2. License">contact the author</a> for help.</p></div> +<p>Otherwise, you can <a class="xref" href="#License" title="Section 1.2. License">contact the author</a> for help.</p></div> </div> <div class="section"> + <a name="Manifest"/><div class="nav" id="Manifest"><a title="Reverse jump to listing" href="#rev:Manifest">&equiv;</a><a title="Jump to previous segment" href="#Installation">&#x25B3;</a><a title="Jump to next segment" href="#Theory-of-operation">&#x25BD;</a><a title="Jump to this segment" href="#Manifest">&#x25CE;</a></div> <h2 class="title"> - <a class="list" title="Return to table of contents" id="Manifest" href="#rev:Manifest">2.3</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#Manifest">Manifest</a> + 2.3&nbsp;&nbsp;Manifest </h2> - <div class="content"><p>You will see the following items inside erbook&#8217;s installation directory, whose path you can determine by running this command:</p> + <div class="content"><p>You will see the following items inside <strong>ERBook</strong>&#8217;s installation directory, whose path you can determine by running this command:</p> <pre>erbook -v</pre> <ul> <li> -<p><tt>bin/</tt> &#8212; contains executable programs.</p> +<p><tt>bin/</tt></p> <ul> -<li><tt>erbook</tt> &#8212; core logic of erbook.</li> +<li><tt>erbook</tt> &#8212; the main <strong>ERBook</strong> executable.</li> </ul> </li> <li> <p><tt>fmt/</tt> &#8212; contains the predefined set of <a class="xref" href="#SpecFile" title="Section 3.2. Format specification file">format specification files</a>. If you ever need to install your custom format specification file globally, then put it inside this directory.</p> @@ -838,15 +890,15 @@ <li> <p><tt>text.yaml</tt> &#8212; plain text, nothing fancy</p> </li> <li> -<p><tt>lib/</tt> &#8212; erbook automatically adds this directory to Ruby&#8217;s load path.</p> +<p><tt>lib/</tt></p> <ul> <li> -<p><tt>erbook.rb</tt> &#8212; project version information.</p> +<p><tt>erbook.rb</tt> &#8212; the main <strong>ERBook</strong> library.</p> </li> <li> <p><tt>erbook/</tt></p> @@ -866,19 +918,19 @@ <li> <p><tt>doc/</tt> &#8212; contains this manual and other documentation.</p> <ul> <li> -<p><tt>erbook.svg</tt> &#8212; source file of the erbook logo.</p> +<p><tt>erbook.svg</tt> &#8212; source file of the <strong>ERBook</strong> logo.</p> </li> <li> -<p><tt>manual.erb</tt> &#8212; source file of this manual.</p> +<p><tt>index.erb</tt> &#8212; source file of this manual.</p> </li> <li> -<p><tt>api/</tt> &#8212; contains API reference documentation for the provided Ruby code.</p> +<p><tt>api/</tt> &#8212; API reference documentation.</p> </li> </ul> </li> <li> @@ -886,16 +938,17 @@ </li> </ul></div> </div></p></div> </div> <div class="chapter"> + <a name="Theory-of-operation"/><div class="nav" id="Theory-of-operation"><a title="Reverse jump to listing" href="#rev:Theory-of-operation">&equiv;</a><a title="Jump to previous segment" href="#Manifest">&#x25B3;</a><a title="Jump to next segment" href="#Nodes">&#x25BD;</a><a title="Jump to this segment" href="#Theory-of-operation">&#x25CE;</a></div> <h1 class="title"> - Chapter&nbsp;<a class="list" title="Return to table of contents" id="Theory-of-operation" href="#rev:Theory-of-operation">3</a> + Chapter&nbsp;3 <br/> - <big><a class="here" title="Permanent link to this section" href="#Theory-of-operation">Theory of operation</a></big> + <big>Theory of operation</big> </h1> - <div class="content"><p>When you run erbook, it does the following:</p> + <div class="content"><p>When you run ERBook, it does the following:</p> <ol> <li> <p>Loads the <a class="xref" href="#SpecFile" title="Section 3.2. Format specification file">format specification file</a>.</p> </li> @@ -938,12 +991,13 @@ </ol> <p>Although there is only one document being processed here, we refer to it using three distinct terms: <strong>input</strong>, <strong>processed</strong>, and <strong>output</strong>; because the content of the document changes radically with every transformation.</p> <p><div class="section"> + <a name="Nodes"/><div class="nav" id="Nodes"><a title="Reverse jump to listing" href="#rev:Nodes">&equiv;</a><a title="Jump to previous segment" href="#Theory-of-operation">&#x25B3;</a><a title="Jump to next segment" href="#Node.class">&#x25BD;</a><a title="Jump to this segment" href="#Nodes">&#x25CE;</a></div> <h2 class="title"> - <a class="list" title="Return to table of contents" id="Nodes" href="#rev:Nodes">3.1</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#Nodes">Nodes</a> + 3.1&nbsp;&nbsp;Nodes </h2> <div class="content"><p>A node is a block of text that appears like this:</p> <pre>&lt;% node_type node_argument1, node_argument2, ... do |node_object| %&gt; node_content @@ -977,93 +1031,100 @@ <p>Technically, nodes are Ruby method invocations composed of the following:</p> <table border="1"><thead><tr><th>Component</th><th>Description</th></tr></thead><tbody><tr><td style='text-align: left;'><code class="code">node_type</code></td><td style='text-align: left;'>name of the method being invoked</td> </tr><tr><td style='text-align: left;'><code class="code">node_argument1, node_argument2, ...</code></td><td style='text-align: left;'>arguments for the method invocation</td> </tr><tr><td style='text-align: left;'><code class="code">node_content</code></td><td style='text-align: left;'>a block argument being passed to the method invocation</td> -</tr><tr><td style='text-align: left;'><code class="code">node_object</code></td><td style='text-align: left;'>a <code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Node</span></code> object (see <a class="xref" href="#Node.class">Section 3.1.1. The <code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Node</span></code> class</a>) representing this method invocation</td> +</tr><tr><td style='text-align: left;'><code class="code">node_object</code></td><td style='text-align: left;'>a <code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Document</span>::<span style="color:#036;font-weight:bold">Node</span></code> object (see <a class="xref" href="#Node.class">Section 3.1.1. The <code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Document</span>::<span style="color:#036;font-weight:bold">Node</span></code> class</a>) representing this method invocation</td> </tr></tbody></table> <p>A <a class="xref" href="#SpecFile" title="Section 3.2. Format specification file">format specification file</a> defines what types of nodes an input document may use.</p> <p><div class="section"> + <a name="Node.class"/><div class="nav" id="Node.class"><a title="Reverse jump to listing" href="#rev:Node.class">&equiv;</a><a title="Jump to previous segment" href="#Nodes">&#x25B3;</a><a title="Jump to next segment" href="#SpecFile">&#x25BD;</a><a title="Jump to this segment" href="#Node.class">&#x25CE;</a></div> <h3 class="title"> - <a class="list" title="Return to table of contents" id="Node.class" href="#rev:Node.class">3.1.1</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#Node.class">The <code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Node</span></code> class</a> + 3.1.1&nbsp;&nbsp;The <code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Document</span>::<span style="color:#036;font-weight:bold">Node</span></code> class </h3> - <div class="content"><p>When erbook builds a document tree from the nodes in an input document, it stores information about these nodes into <code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Node</span></code> objects. A <code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Node</span></code> object has the following properties (methods):</p> + <div class="content"><p>When ERBook builds a document tree from the nodes in an input document, it stores information about these nodes into <code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Document</span>::<span style="color:#036;font-weight:bold">Node</span></code> objects. A <code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Document</span>::<span style="color:#036;font-weight:bold">Node</span></code> object has the following properties (methods):</p> <table border="1"><thead><tr><th>Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td style='text-align: left;'>type</td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">String</span></code></td><td style='text-align: left;'>Name of the type of this node.</td> </tr><tr><td style='text-align: left;'>args</td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">Array</span></code></td><td style='text-align: left;'>Arguments passed to this node.</td> </tr><tr><td style='text-align: left;'>content</td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">String</span></code></td><td style='text-align: left;'>The block of text passed to this node.</td> </tr><tr><td style='text-align: left;'>output</td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">String</span></code></td><td style='text-align: left;'>Result of the node output template for the content of this node.</td> </tr><tr><td style='text-align: left;'>digest</td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">String</span></code></td><td style='text-align: left;'>A unique identifier for the content of this node.</td> </tr><tr><td style='text-align: left;'>trace</td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">Array</span></code></td><td style='text-align: left;'>A stack trace describing the location of this node in the input document.</td> </tr><tr><td style='text-align: left;'>index</td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">String</span></code></td><td style='text-align: left;'>A LaTeX-style section number for this node. This property is only present if the <strong>index</strong> parameter is enabled in the definition of this type of node.</td> </tr><tr><td style='text-align: left;'>number</td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">Integer</span></code></td><td style='text-align: left;'>An order-of-occurrence number for this node. This property is only present if the <strong>number</strong> parameter is enabled in the definition of this type of node.</td> </tr><tr><td style='text-align: left;'>depth</td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">Integer</span></code></td><td style='text-align: left;'>Distance from the root of the document tree to this node.</td> -</tr><tr><td style='text-align: left;'>parent</td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Node</span></code></td><td style='text-align: left;'>The <code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Node</span></code> object which contains this node. The value of this property will be <code class="code"><span style="color:#038;font-weight:bold">nil</span></code> if this node is a root of the document tree.</td> -</tr><tr><td style='text-align: left;'>children</td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">Array</span></code> of <code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Node</span></code></td><td style='text-align: left;'>List of child nodes from the document tree.</td> +</tr><tr><td style='text-align: left;'>parent</td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Document</span>::<span style="color:#036;font-weight:bold">Node</span></code></td><td style='text-align: left;'>The <code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Document</span>::<span style="color:#036;font-weight:bold">Node</span></code> object which contains this node. The value of this property will be <code class="code"><span style="color:#038;font-weight:bold">nil</span></code> if this node is a root of the document tree.</td> +</tr><tr><td style='text-align: left;'>children</td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">Array</span></code> of <code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Document</span>::<span style="color:#036;font-weight:bold">Node</span></code></td><td style='text-align: left;'>List of child nodes from the document tree.</td> </tr></tbody></table> -<p>Furthermore, the <code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Node</span></code> class is derived from <a href='http://www.ruby-doc.org/stdlib/libdoc/ostruct/rdoc/classes/OpenStruct.html'>Ruby&#8217;s <code class="code"><span style="color:#036;font-weight:bold">OpenStruct</span></code> class</a>, so you can define new properties for <code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Node</span></code> objects dynamically.</p></div> +<p>Furthermore, the <code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Document</span>::<span style="color:#036;font-weight:bold">Node</span></code> class is derived from <a href='http://www.ruby-doc.org/stdlib/libdoc/ostruct/rdoc/classes/OpenStruct.html'>Ruby&#8217;s <code class="code"><span style="color:#036;font-weight:bold">OpenStruct</span></code> class</a>, so you can define new properties for <code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Document</span>::<span style="color:#036;font-weight:bold">Node</span></code> objects dynamically.</p></div> </div></p></div> </div> <div class="section"> + <a name="SpecFile"/><div class="nav" id="SpecFile"><a title="Reverse jump to listing" href="#rev:SpecFile">&equiv;</a><a title="Jump to previous segment" href="#Node.class">&#x25B3;</a><a title="Jump to next segment" href="#SpecFile.nodes">&#x25BD;</a><a title="Jump to this segment" href="#SpecFile">&#x25CE;</a></div> <h2 class="title"> - <a class="list" title="Return to table of contents" id="SpecFile" href="#rev:SpecFile">3.2</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#SpecFile">Format specification file</a> + 3.2&nbsp;&nbsp;Format specification file </h2> <div class="content"><p>A format specification file is a plain-text file marked up in <a href='http://yaml4r.sourceforge.net/cookbook/'>YAML syntax</a>. Through the following parameters, it defines (1) what types of nodes an input document may contain, (2) how the content of those nodes is transformed into output, and (3) how the processed document is transformed into the output document.</p> <table border="1"><thead><tr><th>Parameter</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td style='text-align: left;'>desc</td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">String</span></code></td><td style='text-align: left;'>A short description of the output format.</td> -</tr><tr><td style='text-align: left;'>code</td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">String</span></code></td><td style='text-align: left;'>Ruby code that will be loaded before the input document is processed. This source code will be evaluated inside the main erbook executable, so any file-system or path-dependent portions of this source code should take appropriate precautions.</td> +</tr><tr><td style='text-align: left;'>code</td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">String</span></code></td><td style='text-align: left;'>Ruby code that will be loaded before the input document is processed. This source code will be evaluated inside the main ERBook executable, so any file-system or path-dependent portions of this source code should take appropriate precautions.</td> </tr><tr><td style='text-align: left;'>nodes</td><td style='text-align: left;'>Hash</td><td style='text-align: left;'>A listing of <a class="xref" href="#SpecFile.nodes" title="Section 3.2.1. Node definition">node definitions</a>.</td> </tr><tr><td style='text-align: left;'>output</td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">String</span></code></td><td style='text-align: left;'>An eRuby template for the final output document. See <a class="xref" href="#SpecFile.output">Section 3.2.2. Document output template</a>.</td> </tr></tbody></table> <p><div class="section"> + <a name="SpecFile.nodes"/><div class="nav" id="SpecFile.nodes"><a title="Reverse jump to listing" href="#rev:SpecFile.nodes">&equiv;</a><a title="Jump to previous segment" href="#SpecFile">&#x25B3;</a><a title="Jump to next segment" href="#SpecFile.nodes.output">&#x25BD;</a><a title="Jump to this segment" href="#SpecFile.nodes">&#x25CE;</a></div> <h3 class="title"> - <a class="list" title="Return to table of contents" id="SpecFile.nodes" href="#rev:SpecFile.nodes">3.2.1</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#SpecFile.nodes">Node definition</a> + 3.2.1&nbsp;&nbsp;Node definition </h3> <div class="content"><p>A node definition is a mapping from a name (the &#8220;node type&#8221;) to the following set of parameters:</p> <table border="1"><thead><tr><th>Parameter</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td style='text-align: left;'>index</td><td style='text-align: left;'>Boolean</td><td style='text-align: left;'>Assign a LaTeX-style section number to this node?</td> </tr><tr><td style='text-align: left;'>number</td><td style='text-align: left;'>Boolean</td><td style='text-align: left;'>Assign an order-of-occurrence number to this node?</td> </tr><tr><td style='text-align: left;'>silent</td><td style='text-align: left;'>Boolean</td><td style='text-align: left;'>Suppress the output of this node?</td> </tr><tr><td style='text-align: left;'>output</td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">String</span></code></td><td style='text-align: left;'>An eRuby template for the content of this node. See <a class="xref" href="#SpecFile.nodes.output">Section 3.2.1.1. Node output template</a>.</td> +</tr><tr><td style='text-align: left;'>inline</td><td style='text-align: left;'>Boolean</td><td style='text-align: left;'>Is node&#8217;s output an in-line string of text that can be embedded anywhere in the document?</td> </tr></tbody></table> <p>You may define additional parameters in a node definition if you want.</p> <p><div class="section"> + <a name="SpecFile.nodes.output"/><div class="nav" id="SpecFile.nodes.output"><a title="Reverse jump to listing" href="#rev:SpecFile.nodes.output">&equiv;</a><a title="Jump to previous segment" href="#SpecFile.nodes">&#x25B3;</a><a title="Jump to next segment" href="#SpecFile.output">&#x25BD;</a><a title="Jump to this segment" href="#SpecFile.nodes.output">&#x25CE;</a></div> <h4 class="title"> - <a class="list" title="Return to table of contents" id="SpecFile.nodes.output" href="#rev:SpecFile.nodes.output">3.2.1.1</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#SpecFile.nodes.output">Node output template</a> + 3.2.1.1&nbsp;&nbsp;Node output template </h4> - <div class="content"><p>A node output template (the <strong>output</strong> parameter in a node definition) is an eRuby template that transforms a node&#8217;s content into output. During the processing stage, erbook replaces all nodes in the input document with the result of this template <em>unless</em> the <strong>silent</strong> parameter is enabled in this node&#8217;s definition.</p> + <div class="content"><p>A node output template (the <strong>output</strong> parameter in a node definition) is an eRuby template that transforms a node&#8217;s content into output. During the processing stage, ERBook replaces all nodes in the input document with the result of this template <em>unless</em> the <strong>silent</strong> parameter is enabled in this node&#8217;s definition.</p> <p>The following variables are available for use in this template:</p> -<table border="1"><thead><tr><th>Variable</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td style='text-align: left;'><code class="code"><span style="color:#33B">@node</span></code></td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Node</span></code></td><td style='text-align: left;'>The node for which this template is being evaluated.</td> -</tr><tr><td style='text-align: left;'><code class="code"><span style="color:#33B">@roots</span></code></td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">Array</span></code> of <code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Node</span></code></td><td style='text-align: left;'>All root nodes in the document tree.</td> -</tr><tr><td style='text-align: left;'><code class="code"><span style="color:#33B">@nodes</span></code></td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">Array</span></code> of <code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Node</span></code></td><td style='text-align: left;'>All nodes in the document tree.</td> -</tr><tr><td style='text-align: left;'><code class="code"><span style="color:#33B">@types</span></code></td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">Hash</span></code></td><td style='text-align: left;'>Mapping from node type (<code class="code"><span style="color:#036;font-weight:bold">String</span></code>) to array of <code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Node</span></code> objects having that type.</td> -</tr><tr><td style='text-align: left;'><code class="code"><span style="color:#33B">@spec</span></code></td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">Hash</span></code></td><td style='text-align: left;'>Data from the format specification file.</td> +<table border="1"><thead><tr><th>Variable</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td style='text-align: left;'><code class="code"><span style="color:#33B">@node</span></code></td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Document</span>::<span style="color:#036;font-weight:bold">Node</span></code></td><td style='text-align: left;'>The node for which this template is being evaluated.</td> +</tr><tr><td style='text-align: left;'><code class="code"><span style="color:#33B">@roots</span></code></td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">Array</span></code> of <code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Document</span>::<span style="color:#036;font-weight:bold">Node</span></code></td><td style='text-align: left;'>All root nodes in the document tree.</td> +</tr><tr><td style='text-align: left;'><code class="code"><span style="color:#33B">@nodes</span></code></td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">Array</span></code> of <code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Document</span>::<span style="color:#036;font-weight:bold">Node</span></code></td><td style='text-align: left;'>All nodes in the document tree.</td> +</tr><tr><td style='text-align: left;'><code class="code"><span style="color:#33B">@nodes_by_type</span></code></td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">Hash</span></code></td><td style='text-align: left;'>Mapping from node type (<code class="code"><span style="color:#036;font-weight:bold">String</span></code>) to array of <code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Document</span>::<span style="color:#036;font-weight:bold">Node</span></code> objects having that type.</td> +</tr><tr><td style='text-align: left;'><code class="code"><span style="color:#33B">@format</span></code></td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">Hash</span></code></td><td style='text-align: left;'>Data from the format specification file.</td> </tr></tbody></table> -<p>erbook also provides the following mappings inside the <code class="code"><span style="color:#33B">@spec</span></code> variable:</p> -<table border="1"><thead><tr><th>Expression</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td style='text-align: left;'><code class="code"><span style="color:#33B">@spec</span>[<span style="color:#A60">:name</span>]</code></td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">String</span></code></td><td style='text-align: left;'>Short-hand name of the current format.</td> -</tr><tr><td style='text-align: left;'><code class="code"><span style="color:#33B">@spec</span>[<span style="color:#A60">:file</span>]</code></td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">String</span></code></td><td style='text-align: left;'>Path of the current format specification file.</td> +<p>ERBook also provides the following mappings inside the <code class="code"><span style="color:#33B">@format</span></code> variable:</p> +<table border="1"><thead><tr><th>Expression</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td style='text-align: left;'><code class="code"><span style="color:#33B">@format</span>[<span style="color:#A60">:name</span>]</code></td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">String</span></code></td><td style='text-align: left;'>Short-hand name of the current format.</td> +</tr><tr><td style='text-align: left;'><code class="code"><span style="color:#33B">@format</span>[<span style="color:#A60">:file</span>]</code></td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">String</span></code></td><td style='text-align: left;'>Path of the current format specification file.</td> </tr></tbody></table></div> </div></p></div> </div> <div class="section"> + <a name="SpecFile.output"/><div class="nav" id="SpecFile.output"><a title="Reverse jump to listing" href="#rev:SpecFile.output">&equiv;</a><a title="Jump to previous segment" href="#SpecFile.nodes.output">&#x25B3;</a><a title="Jump to next segment" href="#HelloWorld">&#x25BD;</a><a title="Jump to this segment" href="#SpecFile.output">&#x25CE;</a></div> <h3 class="title"> - <a class="list" title="Return to table of contents" id="SpecFile.output" href="#rev:SpecFile.output">3.2.2</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#SpecFile.output">Document output template</a> + 3.2.2&nbsp;&nbsp;Document output template </h3> <div class="content"><p>A document output template (the <strong>output</strong> parameter in a format specification file) is an eRuby template that transforms a processed document into the final output document.</p> <p>The following variables are available for use in this template:</p> <table border="1"><thead><tr><th>Variable</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td style='text-align: left;'><code class="code"><span style="color:#33B">@content</span></code></td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">String</span></code></td><td style='text-align: left;'>Content of the processed document.</td> -</tr><tr><td style='text-align: left;'><code class="code"><span style="color:#33B">@roots</span></code></td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">Array</span></code> of <code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Node</span></code></td><td style='text-align: left;'>All root nodes in the document tree.</td> -</tr><tr><td style='text-align: left;'><code class="code"><span style="color:#33B">@nodes</span></code></td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">Array</span></code> of <code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Node</span></code></td><td style='text-align: left;'>All nodes in the document tree.</td> -</tr><tr><td style='text-align: left;'><code class="code"><span style="color:#33B">@types</span></code></td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">Hash</span></code></td><td style='text-align: left;'>Mapping from node type (<code class="code"><span style="color:#036;font-weight:bold">String</span></code>) to array of <code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Node</span></code> objects having that type.</td> -</tr><tr><td style='text-align: left;'><code class="code"><span style="color:#33B">@spec</span></code></td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">Hash</span></code></td><td style='text-align: left;'>Data from the format specification file.</td> +</tr><tr><td style='text-align: left;'><code class="code"><span style="color:#33B">@roots</span></code></td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">Array</span></code> of <code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Document</span>::<span style="color:#036;font-weight:bold">Node</span></code></td><td style='text-align: left;'>All root nodes in the document tree.</td> +</tr><tr><td style='text-align: left;'><code class="code"><span style="color:#33B">@nodes</span></code></td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">Array</span></code> of <code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Document</span>::<span style="color:#036;font-weight:bold">Node</span></code></td><td style='text-align: left;'>All nodes in the document tree.</td> +</tr><tr><td style='text-align: left;'><code class="code"><span style="color:#33B">@nodes_by_type</span></code></td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">Hash</span></code></td><td style='text-align: left;'>Mapping from node type (<code class="code"><span style="color:#036;font-weight:bold">String</span></code>) to array of <code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Document</span>::<span style="color:#036;font-weight:bold">Node</span></code> objects having that type.</td> +</tr><tr><td style='text-align: left;'><code class="code"><span style="color:#33B">@format</span></code></td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">Hash</span></code></td><td style='text-align: left;'>Data from the format specification file.</td> </tr></tbody></table> -<p>erbook also provides the following mappings inside the <code class="code"><span style="color:#33B">@spec</span></code> variable:</p> -<table border="1"><thead><tr><th>Expression</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td style='text-align: left;'><code class="code"><span style="color:#33B">@spec</span>[<span style="color:#A60">:name</span>]</code></td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">String</span></code></td><td style='text-align: left;'>Short-hand name of the current format.</td> -</tr><tr><td style='text-align: left;'><code class="code"><span style="color:#33B">@spec</span>[<span style="color:#A60">:file</span>]</code></td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">String</span></code></td><td style='text-align: left;'>Path of the current format specification file.</td> +<p>ERBook also provides the following mappings inside the <code class="code"><span style="color:#33B">@format</span></code> variable:</p> +<table border="1"><thead><tr><th>Expression</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td style='text-align: left;'><code class="code"><span style="color:#33B">@format</span>[<span style="color:#A60">:name</span>]</code></td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">String</span></code></td><td style='text-align: left;'>Short-hand name of the current format.</td> +</tr><tr><td style='text-align: left;'><code class="code"><span style="color:#33B">@format</span>[<span style="color:#A60">:file</span>]</code></td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">String</span></code></td><td style='text-align: left;'>Path of the current format specification file.</td> </tr></tbody></table></div> </div> <div class="section"> + <a name="HelloWorld"/><div class="nav" id="HelloWorld"><a title="Reverse jump to listing" href="#rev:HelloWorld">&equiv;</a><a title="Jump to previous segment" href="#SpecFile.output">&#x25B3;</a><a title="Jump to next segment" href="#HelloWorld.spec">&#x25BD;</a><a title="Jump to this segment" href="#HelloWorld">&#x25CE;</a></div> <h3 class="title"> - <a class="list" title="Return to table of contents" id="HelloWorld" href="#rev:HelloWorld">3.2.3</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#HelloWorld">Creating your own document format</a> + 3.2.3&nbsp;&nbsp;Creating your own document format </h3> <div class="content"><p>Here is a working example to help you digest all that you&#8217;ve learned so far about format specification files. A few things to notice in this example are:</p> <ul> <li> @@ -1096,39 +1157,42 @@ <p>Examine the <tt>HelloWorld.output</tt> file to your satisfaction!</p> </li> </ol> <p><div class="example"> - <p class="title"><a class="list" title="Return to table of contents" id="HelloWorld.spec" href="#rev:HelloWorld.spec">Example 1</a>.&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#HelloWorld.spec">HelloWorld format specification file</a></p> + <a name="HelloWorld.spec"/><div class="nav" id="HelloWorld.spec"><a title="Reverse jump to listing" href="#rev:HelloWorld.spec">&equiv;</a><a title="Jump to previous segment" href="#HelloWorld">&#x25B3;</a><a title="Jump to next segment" href="#HelloWorld.input">&#x25BD;</a><a title="Jump to this segment" href="#HelloWorld.spec">&#x25CE;</a></div> + <p class="title">Example 1.&nbsp;&nbsp;HelloWorld format specification file</p> <div class="content"><p><pre class="code" lang="rhtml">desc: An example format. code: | - # Returns a random, yet pronounceable, name. - def generate_name - letters = ('a'..'z').to_a - %w[ c q w x ] # redundant sounds - vowels = %w[a e i o u] - consonants = letters - vowels - sets = [consonants, vowels] + class ERBook::Node + def name + # dynamically compute (and store) + # the name of this node on demand + @name ||= generate_name + end - length = 3 + rand(5) + private - name = (0...length).map do |i| - # alternate between consonants and vowels - set = sets[i % sets.length] + # Returns a random, yet pronounceable, name. + def generate_name + letters = ('a'..'z').to_a - %w[ c q w x ] # redundant sounds + vowels = %w[a e i o u] + consonants = letters - vowels + sets = [consonants, vowels] - # choose a random letter from the set - set[rand(set.length)] - end.join + length = 3 + rand(5) - name - end + name = (0...length).map do |i| + # alternate between consonants and vowels + set = sets[i % sets.length] - class Node - def name - # dynamically compute (and store) - # the name of this node on demand - @name ||= generate_name + # choose a random letter from the set + set[rand(set.length)] + end.join + + name end end nodes: hello: @@ -1138,178 +1202,156 @@ output: | <span style="color:#070">&lt;h3&gt;</span><span style="background:#eee"><span style="font-weight:bold;color:#888">&lt;%=</span> <span style="color:#33B">@node</span>.type <span style="font-weight:bold;color:#888">%&gt;</span></span> #<span style="background:#eee"><span style="font-weight:bold;color:#888">&lt;%=</span> <span style="color:#33B">@node</span>.index <span style="font-weight:bold;color:#888">%&gt;</span></span>: <span style="background:#eee"><span style="font-weight:bold;color:#888">&lt;%=</span> <span style="color:#33B">@node</span>.name.inspect <span style="font-weight:bold;color:#888">%&gt;</span></span><span style="color:#070">&lt;/h3&gt;</span> My name is <span style="background:#eee"><span style="font-weight:bold;color:#888">&lt;%=</span> <span style="color:#33B">@node</span>.name.inspect <span style="font-weight:bold;color:#888">%&gt;</span></span> and these are my properties: - <span style="color:#070">&lt;dl</span> <span style="color:#007">style</span>=<span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="background:#eee"><span style="font-weight:bold;color:#888">&lt;%=</span> <span style="color:#d70;font-weight:bold">$style</span> <span style="font-weight:bold;color:#888">%&gt;</span></span><span style="color:#710">&quot;</span></span><span style="color:#070">&gt;</span> + <span style="color:#070">&lt;dl</span> <span style="color:#007">style</span>=<span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="background:#eee"><span style="font-weight:bold;color:#888">&lt;%=</span> <span style="color:#d70;font-weight:bold">$style</span> <span style="font-weight:bold;color:#888">%&gt;</span></span><span style="color:#710">&quot;</span></span><span style="color:#070">&gt;</span> <span style="color:#070">&lt;dt&gt;</span>args<span style="color:#070">&lt;/dt&gt;</span> <span style="color:#070">&lt;dd&gt;</span><span style="color:#070">&lt;code&gt;</span><span style="background:#eee"><span style="font-weight:bold;color:#888">&lt;%=</span> <span style="color:#33B">@node</span>.args.inspect <span style="font-weight:bold;color:#888">%&gt;</span></span><span style="color:#070">&lt;/code&gt;</span><span style="color:#070">&lt;/dd&gt;</span> <span style="color:#070">&lt;dt&gt;</span>index<span style="color:#070">&lt;/dt&gt;</span> <span style="color:#070">&lt;dd&gt;</span><span style="color:#070">&lt;code&gt;</span><span style="background:#eee"><span style="font-weight:bold;color:#888">&lt;%=</span> <span style="color:#33B">@node</span>.index.inspect <span style="font-weight:bold;color:#888">%&gt;</span></span><span style="color:#070">&lt;/code&gt;</span><span style="color:#070">&lt;/dd&gt;</span> <span style="color:#070">&lt;dt&gt;</span>number<span style="color:#070">&lt;/dt&gt;</span> <span style="color:#070">&lt;dd&gt;</span><span style="color:#070">&lt;code&gt;</span><span style="background:#eee"><span style="font-weight:bold;color:#888">&lt;%=</span> <span style="color:#33B">@node</span>.number.inspect <span style="font-weight:bold;color:#888">%&gt;</span></span><span style="color:#070">&lt;/code&gt;</span><span style="color:#070">&lt;/dd&gt;</span> <span style="color:#070">&lt;dt&gt;</span>trace<span style="color:#070">&lt;/dt&gt;</span> - <span style="color:#070">&lt;dd&gt;</span><span style="color:#070">&lt;pre&gt;</span><span style="background:#eee"><span style="font-weight:bold;color:#888">&lt;%=</span> <span style="color:#33B">@node</span>.trace.join(<span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#b0b">\n</span><span style="color:#710">&quot;</span></span>) <span style="font-weight:bold;color:#888">%&gt;</span></span><span style="color:#070">&lt;/pre&gt;</span><span style="color:#070">&lt;/dd&gt;</span> + <span style="color:#070">&lt;dd&gt;</span><span style="color:#070">&lt;pre&gt;</span><span style="background:#eee"><span style="font-weight:bold;color:#888">&lt;%=</span> <span style="color:#33B">@node</span>.trace.join(<span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="color:#b0b">\n</span><span style="color:#710">&quot;</span></span>) <span style="font-weight:bold;color:#888">%&gt;</span></span><span style="color:#070">&lt;/pre&gt;</span><span style="color:#070">&lt;/dd&gt;</span> <span style="color:#070">&lt;dt&gt;</span>content<span style="color:#070">&lt;/dt&gt;</span> <span style="color:#070">&lt;dd&gt;</span><span style="background:#eee"><span style="font-weight:bold;color:#888">&lt;%=</span> <span style="color:#33B">@node</span>.content <span style="font-weight:bold;color:#888">%&gt;</span></span><span style="color:#070">&lt;/dd&gt;</span> <span style="color:#070">&lt;/dl&gt;</span> output: | - Welcome to the &quot;<span style="background:#eee"><span style="font-weight:bold;color:#888">&lt;%=</span> <span style="color:#33B">@spec</span>[<span style="color:#A60">:name</span>] <span style="font-weight:bold;color:#888">%&gt;</span></span>&quot; format. + Welcome to the &quot;<span style="background:#eee"><span style="font-weight:bold;color:#888">&lt;%=</span> <span style="color:#33B">@format</span>[<span style="color:#A60">:name</span>] <span style="font-weight:bold;color:#888">%&gt;</span></span>&quot; format. <span style="background:#eee"><span style="font-weight:bold;color:#888">&lt;%=</span> <span style="color:#33B">@content</span> <span style="font-weight:bold;color:#888">%&gt;</span></span> That's all folks! </pre></p></div> </div> <div class="example"> - <p class="title"><a class="list" title="Return to table of contents" id="HelloWorld.input" href="#rev:HelloWorld.input">Example 2</a>.&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#HelloWorld.input">Input document for HelloWorld format</a></p> - <div class="content"><p><pre class="code" lang="rhtml"><span style="background:#eee"><span style="font-weight:bold;color:#888">&lt;%</span> <span style="color:#d70;font-weight:bold">$style</span> = <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">border-left: thick dotted LightGrey; padding-left: 1em;</span><span style="color:#710">&quot;</span></span> <span style="font-weight:bold;color:#888">%&gt;</span></span> -<span style="background:#eee"><span style="font-weight:bold;color:#888">&lt;%</span> hello <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">Pretentious</span><span style="color:#710">&quot;</span></span>, <span style="color:#00D;font-weight:bold">1</span>, <span style="color:#00D;font-weight:bold">2</span>, <span style="color:#00D;font-weight:bold">3</span> <span style="color:#080;font-weight:bold">do</span> <span style="font-weight:bold;color:#888">%&gt;</span></span> + <a name="HelloWorld.input"/><div class="nav" id="HelloWorld.input"><a title="Reverse jump to listing" href="#rev:HelloWorld.input">&equiv;</a><a title="Jump to previous segment" href="#HelloWorld.spec">&#x25B3;</a><a title="Jump to next segment" href="#HelloWorld.output">&#x25BD;</a><a title="Jump to this segment" href="#HelloWorld.input">&#x25CE;</a></div> + <p class="title">Example 2.&nbsp;&nbsp;Input document for HelloWorld format</p> + <div class="content"><p><pre class="code" lang="rhtml"><span style="background:#eee"><span style="font-weight:bold;color:#888">&lt;%</span> <span style="color:#d70;font-weight:bold">$style</span> = <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">border-left: thick dotted LightGrey; padding-left: 1em;</span><span style="color:#710">&quot;</span></span> <span style="font-weight:bold;color:#888">%&gt;</span></span> +<span style="background:#eee"><span style="font-weight:bold;color:#888">&lt;%</span> hello <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">Pretentious</span><span style="color:#710">&quot;</span></span>, <span style="color:#00D;font-weight:bold">1</span>, <span style="color:#00D;font-weight:bold">2</span>, <span style="color:#00D;font-weight:bold">3</span> <span style="color:#080;font-weight:bold">do</span> <span style="font-weight:bold;color:#888">%&gt;</span></span> <span style="color:#070">&lt;big&gt;</span>I'm<span style="color:#070">&lt;/big&gt;</span> the very first node, oh _yes_ I am! *sneer* - <span style="background:#eee"><span style="font-weight:bold;color:#888">&lt;%</span> hello <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">Bashful</span><span style="color:#710">&quot;</span></span>, <span style="color:#00D;font-weight:bold">4</span>, <span style="color:#00D;font-weight:bold">5</span>, <span style="color:#00D;font-weight:bold">6</span> <span style="color:#080;font-weight:bold">do</span> <span style="font-weight:bold;color:#888">%&gt;</span></span> + <span style="background:#eee"><span style="font-weight:bold;color:#888">&lt;%</span> hello <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">Bashful</span><span style="color:#710">&quot;</span></span>, <span style="color:#00D;font-weight:bold">4</span>, <span style="color:#00D;font-weight:bold">5</span>, <span style="color:#00D;font-weight:bold">6</span> <span style="color:#080;font-weight:bold">do</span> <span style="font-weight:bold;color:#888">%&gt;</span></span> Hi, I... *hide* - <span style="background:#eee"><span style="font-weight:bold;color:#888">&lt;%</span> hello <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">Hopeful</span><span style="color:#710">&quot;</span></span>, rand <span style="color:#080;font-weight:bold">do</span> <span style="font-weight:bold;color:#888">%&gt;</span></span> + <span style="background:#eee"><span style="font-weight:bold;color:#888">&lt;%</span> hello <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">Hopeful</span><span style="color:#710">&quot;</span></span>, rand <span style="color:#080;font-weight:bold">do</span> <span style="font-weight:bold;color:#888">%&gt;</span></span> *sigh* - <span style="background:#eee"><span style="font-weight:bold;color:#888">&lt;%</span> hello <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">Confused</span><span style="color:#710">&quot;</span></span>, (rand * rand) <span style="color:#080;font-weight:bold">do</span> <span style="font-weight:bold;color:#888">%&gt;</span></span> + <span style="background:#eee"><span style="font-weight:bold;color:#888">&lt;%</span> hello <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">Confused</span><span style="color:#710">&quot;</span></span>, (rand * rand) <span style="color:#080;font-weight:bold">do</span> <span style="font-weight:bold;color:#888">%&gt;</span></span> Huh? <span style="background:#eee"><span style="font-weight:bold;color:#888">&lt;%</span> <span style="color:#080;font-weight:bold">end</span> <span style="font-weight:bold;color:#888">%&gt;</span></span> <span style="background:#eee"><span style="font-weight:bold;color:#888">&lt;%</span> <span style="color:#080;font-weight:bold">end</span> <span style="font-weight:bold;color:#888">%&gt;</span></span> - <span style="background:#eee"><span style="font-weight:bold;color:#888">&lt;%</span> hello <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">Raving</span><span style="color:#710">&quot;</span></span>, <span style="color:#038;font-weight:bold">__FILE__</span> <span style="color:#080;font-weight:bold">do</span> <span style="font-weight:bold;color:#888">%&gt;</span></span> + <span style="background:#eee"><span style="font-weight:bold;color:#888">&lt;%</span> hello <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">Raving</span><span style="color:#710">&quot;</span></span>, <span style="color:#038;font-weight:bold">__FILE__</span> <span style="color:#080;font-weight:bold">do</span> <span style="font-weight:bold;color:#888">%&gt;</span></span> Oh it's *on* now! You're going *down*! <span style="background:#eee"><span style="font-weight:bold;color:#888">&lt;%</span> <span style="color:#080;font-weight:bold">end</span> <span style="font-weight:bold;color:#888">%&gt;</span></span> <span style="background:#eee"><span style="font-weight:bold;color:#888">&lt;%</span> <span style="color:#080;font-weight:bold">end</span> <span style="font-weight:bold;color:#888">%&gt;</span></span> - <span style="background:#eee"><span style="font-weight:bold;color:#888">&lt;%</span> hello <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">Sleepy</span><span style="color:#710">&quot;</span></span>, <span style="color:#036;font-weight:bold">Time</span>.now <span style="color:#080;font-weight:bold">do</span> <span style="font-weight:bold;color:#888">%&gt;</span></span> + <span style="background:#eee"><span style="font-weight:bold;color:#888">&lt;%</span> hello <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">Sleepy</span><span style="color:#710">&quot;</span></span>, <span style="color:#036;font-weight:bold">Time</span>.now <span style="color:#080;font-weight:bold">do</span> <span style="font-weight:bold;color:#888">%&gt;</span></span> *yawn* Just five more minutes... - <span style="background:#eee"><span style="font-weight:bold;color:#888">&lt;%</span> hello <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">Peaceful</span><span style="color:#710">&quot;</span></span>, <span style="color:#036;font-weight:bold">Dir</span>.pwd <span style="color:#080;font-weight:bold">do</span> <span style="font-weight:bold;color:#888">%&gt;</span></span> + <span style="background:#eee"><span style="font-weight:bold;color:#888">&lt;%</span> hello <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">Peaceful</span><span style="color:#710">&quot;</span></span>, <span style="color:#036;font-weight:bold">Dir</span>.pwd <span style="color:#080;font-weight:bold">do</span> <span style="font-weight:bold;color:#888">%&gt;</span></span> So _be_ happy my friend, *happy*! - <span style="background:#eee"><span style="font-weight:bold;color:#888">&lt;%=</span> hello <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">Lonely (as you can see, I have no block)</span><span style="color:#710">&quot;</span></span> <span style="font-weight:bold;color:#888">%&gt;</span></span> + <span style="background:#eee"><span style="font-weight:bold;color:#888">&lt;%=</span> hello <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">Lonely (as you can see, I have no block)</span><span style="color:#710">&quot;</span></span> <span style="font-weight:bold;color:#888">%&gt;</span></span> <span style="background:#eee"><span style="font-weight:bold;color:#888">&lt;%</span> <span style="color:#080;font-weight:bold">end</span> <span style="font-weight:bold;color:#888">%&gt;</span></span> <span style="background:#eee"><span style="font-weight:bold;color:#888">&lt;%</span> <span style="color:#080;font-weight:bold">end</span> <span style="font-weight:bold;color:#888">%&gt;</span></span> <span style="background:#eee"><span style="font-weight:bold;color:#888">&lt;%</span> <span style="color:#080;font-weight:bold">end</span> <span style="font-weight:bold;color:#888">%&gt;</span></span> -<span style="background:#eee"><span style="font-weight:bold;color:#888">&lt;%</span> hello <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">Snappy</span><span style="color:#710">&quot;</span></span> <span style="color:#080;font-weight:bold">do</span> <span style="font-weight:bold;color:#888">%&gt;</span></span> +<span style="background:#eee"><span style="font-weight:bold;color:#888">&lt;%</span> hello <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">Snappy</span><span style="color:#710">&quot;</span></span> <span style="color:#080;font-weight:bold">do</span> <span style="font-weight:bold;color:#888">%&gt;</span></span> Zip! Zap! Wake up, you sap! _Whoo I'm wild!_ ;-) <span style="background:#eee"><span style="font-weight:bold;color:#888">&lt;%</span> <span style="color:#080;font-weight:bold">end</span> <span style="font-weight:bold;color:#888">%&gt;</span></span> -<span style="background:#eee"><span style="font-weight:bold;color:#888">&lt;%=</span> hello <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">Independent (no block, no parents, I am _free_!)</span><span style="color:#710">&quot;</span></span> <span style="font-weight:bold;color:#888">%&gt;</span></span></pre></p></div> +<span style="background:#eee"><span style="font-weight:bold;color:#888">&lt;%=</span> hello <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">Independent (no block, no parents, I am _free_!)</span><span style="color:#710">&quot;</span></span> <span style="font-weight:bold;color:#888">%&gt;</span></span></pre></p></div> </div> <div class="example"> - <p class="title"><a class="list" title="Return to table of contents" id="HelloWorld.output" href="#rev:HelloWorld.output">Example 3</a>.&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#HelloWorld.output">Output of HelloWorld format</a></p> + <a name="HelloWorld.output"/><div class="nav" id="HelloWorld.output"><a title="Reverse jump to listing" href="#rev:HelloWorld.output">&equiv;</a><a title="Jump to previous segment" href="#HelloWorld.input">&#x25B3;</a><a title="Jump to next segment" href="#Usage">&#x25BD;</a><a title="Jump to this segment" href="#HelloWorld.output">&#x25CE;</a></div> + <p class="title">Example 3.&nbsp;&nbsp;Output of HelloWorld format</p> <div class="content"><p>Welcome to the &#8220;HelloWorld&#8221; format. <h3>hello #1: nil</h3></p> <p>My name is nil and these are my properties:</p> <dl style='border-left: thick dotted LightGrey; padding-left: 1em;'> <dt>args</dt> - <dd><code class="code">[<span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">Pretentious</span><span style="color:#710">&quot;</span></span>, <span style="color:#00D;font-weight:bold">1</span>, <span style="color:#00D;font-weight:bold">2</span>, <span style="color:#00D;font-weight:bold">3</span>]</code></dd> + <dd><code class="code">[<span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">Pretentious</span><span style="color:#710">&quot;</span></span>, <span style="color:#00D;font-weight:bold">1</span>, <span style="color:#00D;font-weight:bold">2</span>, <span style="color:#00D;font-weight:bold">3</span>]</code></dd> <dt>index</dt> - <dd><code class="code"><span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">1</span><span style="color:#710">&quot;</span></span></code></dd> + <dd><code class="code"><span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">1</span><span style="color:#710">&quot;</span></span></code></dd> <dt>number</dt> <dd><code class="code"><span style="color:#00D;font-weight:bold">1</span></code></dd> <dt>trace</dt> - <dd><pre>doc/HelloWorld.input:1 -bin/erbook:307 -bin/erbook:307:in `instance_eval' -bin/erbook:307</pre></dd> + <dd><pre>doc/HelloWorld.input:1:in `initialize'</pre></dd> <dt>content</dt> <dd><big>I'm</big> the very first node, oh _yes_ I am! *sneer* <h3>hello #1.1: nil</h3> My name is nil and these are my properties: <dl style='border-left: thick dotted LightGrey; padding-left: 1em;'> <dt>args</dt> - <dd><code class="code">[<span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">Bashful</span><span style="color:#710">&quot;</span></span>, <span style="color:#00D;font-weight:bold">4</span>, <span style="color:#00D;font-weight:bold">5</span>, <span style="color:#00D;font-weight:bold">6</span>]</code></dd> + <dd><code class="code">[<span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">Bashful</span><span style="color:#710">&quot;</span></span>, <span style="color:#00D;font-weight:bold">4</span>, <span style="color:#00D;font-weight:bold">5</span>, <span style="color:#00D;font-weight:bold">6</span>]</code></dd> <dt>index</dt> - <dd><code class="code"><span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">1.1</span><span style="color:#710">&quot;</span></span></code></dd> + <dd><code class="code"><span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">1.1</span><span style="color:#710">&quot;</span></span></code></dd> <dt>number</dt> <dd><code class="code"><span style="color:#00D;font-weight:bold">2</span></code></dd> <dt>trace</dt> - <dd><pre>doc/HelloWorld.input:3 -bin/erbook:115:in `content_from_block' -bin/erbook:288:in `hello' -doc/HelloWorld.input:1 -bin/erbook:307 -bin/erbook:307:in `instance_eval' -bin/erbook:307</pre></dd> + <dd><pre>doc/HelloWorld.input:3:in `initialize' +doc/HelloWorld.input:1:in `initialize'</pre></dd> <dt>content</dt> <dd>Hi, I... *hide* <h3>hello #1.1.1: nil</h3> My name is nil and these are my properties: <dl style='border-left: thick dotted LightGrey; padding-left: 1em;'> <dt>args</dt> - <dd><code class="code">[<span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">Hopeful</span><span style="color:#710">&quot;</span></span>, <span style="color:#60E;font-weight:bold">0.0790764609144532</span>]</code></dd> + <dd><code class="code">[<span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">Hopeful</span><span style="color:#710">&quot;</span></span>, <span style="color:#60E;font-weight:bold">0.206825122967076</span>]</code></dd> <dt>index</dt> - <dd><code class="code"><span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">1.1.1</span><span style="color:#710">&quot;</span></span></code></dd> + <dd><code class="code"><span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">1.1.1</span><span style="color:#710">&quot;</span></span></code></dd> <dt>number</dt> <dd><code class="code"><span style="color:#00D;font-weight:bold">3</span></code></dd> <dt>trace</dt> - <dd><pre>doc/HelloWorld.input:5 -bin/erbook:115:in `content_from_block' -bin/erbook:288:in `hello' -doc/HelloWorld.input:3 -bin/erbook:115:in `content_from_block' -bin/erbook:288:in `hello' -doc/HelloWorld.input:1 -bin/erbook:307 -bin/erbook:307:in `instance_eval' -bin/erbook:307</pre></dd> + <dd><pre>doc/HelloWorld.input:5:in `initialize' +doc/HelloWorld.input:3:in `initialize' +doc/HelloWorld.input:1:in `initialize'</pre></dd> <dt>content</dt> <dd>*sigh* <h3>hello #1.1.1.1: nil</h3> My name is nil and these are my properties: <dl style='border-left: thick dotted LightGrey; padding-left: 1em;'> <dt>args</dt> - <dd><code class="code">[<span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">Confused</span><span style="color:#710">&quot;</span></span>, <span style="color:#60E;font-weight:bold">0.528769558981025</span>]</code></dd> + <dd><code class="code">[<span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">Confused</span><span style="color:#710">&quot;</span></span>, <span style="color:#60E;font-weight:bold">0.491025424447163</span>]</code></dd> <dt>index</dt> - <dd><code class="code"><span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">1.1.1.1</span><span style="color:#710">&quot;</span></span></code></dd> + <dd><code class="code"><span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">1.1.1.1</span><span style="color:#710">&quot;</span></span></code></dd> <dt>number</dt> <dd><code class="code"><span style="color:#00D;font-weight:bold">4</span></code></dd> <dt>trace</dt> - <dd><pre>doc/HelloWorld.input:7 -bin/erbook:115:in `content_from_block' -bin/erbook:288:in `hello' -doc/HelloWorld.input:5 -bin/erbook:115:in `content_from_block' -bin/erbook:288:in `hello' -doc/HelloWorld.input:3 -bin/erbook:115:in `content_from_block' -bin/erbook:288:in `hello' -doc/HelloWorld.input:1 -bin/erbook:307 -bin/erbook:307:in `instance_eval' -bin/erbook:307</pre></dd> + <dd><pre>doc/HelloWorld.input:7:in `initialize' +doc/HelloWorld.input:5:in `initialize' +doc/HelloWorld.input:3:in `initialize' +doc/HelloWorld.input:1:in `initialize'</pre></dd> <dt>content</dt> <dd>Huh? </dd> </dl></dd> @@ -1318,29 +1360,22 @@ My name is nil and these are my properties: <dl style='border-left: thick dotted LightGrey; padding-left: 1em;'> <dt>args</dt> - <dd><code class="code">[<span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">Raving</span><span style="color:#710">&quot;</span></span>, <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">doc/HelloWorld.input</span><span style="color:#710">&quot;</span></span>]</code></dd> + <dd><code class="code">[<span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">Raving</span><span style="color:#710">&quot;</span></span>, <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">doc/HelloWorld.input</span><span style="color:#710">&quot;</span></span>]</code></dd> <dt>index</dt> - <dd><code class="code"><span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">1.1.2</span><span style="color:#710">&quot;</span></span></code></dd> + <dd><code class="code"><span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">1.1.2</span><span style="color:#710">&quot;</span></span></code></dd> <dt>number</dt> <dd><code class="code"><span style="color:#00D;font-weight:bold">5</span></code></dd> <dt>trace</dt> - <dd><pre>doc/HelloWorld.input:9 -bin/erbook:115:in `content_from_block' -bin/erbook:288:in `hello' -doc/HelloWorld.input:3 -bin/erbook:115:in `content_from_block' -bin/erbook:288:in `hello' -doc/HelloWorld.input:1 -bin/erbook:307 -bin/erbook:307:in `instance_eval' -bin/erbook:307</pre></dd> + <dd><pre>doc/HelloWorld.input:9:in `initialize' +doc/HelloWorld.input:3:in `initialize' +doc/HelloWorld.input:1:in `initialize'</pre></dd> <dt>content</dt> <dd>Oh it's *on* now! You're going *down*! </dd> </dl></dd> @@ -1349,87 +1384,66 @@ My name is nil and these are my properties: <dl style='border-left: thick dotted LightGrey; padding-left: 1em;'> <dt>args</dt> - <dd><code class="code">[<span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">Sleepy</span><span style="color:#710">&quot;</span></span>, <span style="color:#036;font-weight:bold">Sat</span> <span style="color:#036;font-weight:bold">Nov</span> <span style="color:#00D;font-weight:bold">22</span> <span style="color:#00D;font-weight:bold">23</span>:<span style="color:#00D;font-weight:bold">17</span>:<span style="color:#00D;font-weight:bold">11</span> -<span style="color:#00D;font-weight:bold">0800</span> <span style="color:#00D;font-weight:bold">2008</span>]</code></dd> + <dd><code class="code">[<span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">Sleepy</span><span style="color:#710">&quot;</span></span>, <span style="color:#036;font-weight:bold">Mon</span> <span style="color:#036;font-weight:bold">Jan</span> <span style="color:#00D;font-weight:bold">19</span> <span style="color:#00D;font-weight:bold">04</span>:<span style="color:#00D;font-weight:bold">46</span>:<span style="color:#00D;font-weight:bold">00</span> -<span style="color:#00D;font-weight:bold">0800</span> <span style="color:#00D;font-weight:bold">2009</span>]</code></dd> <dt>index</dt> - <dd><code class="code"><span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">1.2</span><span style="color:#710">&quot;</span></span></code></dd> + <dd><code class="code"><span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">1.2</span><span style="color:#710">&quot;</span></span></code></dd> <dt>number</dt> <dd><code class="code"><span style="color:#00D;font-weight:bold">6</span></code></dd> <dt>trace</dt> - <dd><pre>doc/HelloWorld.input:11 -bin/erbook:115:in `content_from_block' -bin/erbook:288:in `hello' -doc/HelloWorld.input:1 -bin/erbook:307 -bin/erbook:307:in `instance_eval' -bin/erbook:307</pre></dd> + <dd><pre>doc/HelloWorld.input:11:in `initialize' +doc/HelloWorld.input:1:in `initialize'</pre></dd> <dt>content</dt> <dd>*yawn* Just five more minutes... <h3>hello #1.2.1: nil</h3> My name is nil and these are my properties: <dl style='border-left: thick dotted LightGrey; padding-left: 1em;'> <dt>args</dt> - <dd><code class="code">[<span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">Peaceful</span><span style="color:#710">&quot;</span></span>, <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">/home/sun/src/erbook</span><span style="color:#710">&quot;</span></span>]</code></dd> + <dd><code class="code">[<span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">Peaceful</span><span style="color:#710">&quot;</span></span>, <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">/home/sun/src/erbook</span><span style="color:#710">&quot;</span></span>]</code></dd> <dt>index</dt> - <dd><code class="code"><span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">1.2.1</span><span style="color:#710">&quot;</span></span></code></dd> + <dd><code class="code"><span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">1.2.1</span><span style="color:#710">&quot;</span></span></code></dd> <dt>number</dt> <dd><code class="code"><span style="color:#00D;font-weight:bold">7</span></code></dd> <dt>trace</dt> - <dd><pre>doc/HelloWorld.input:13 -bin/erbook:115:in `content_from_block' -bin/erbook:288:in `hello' -doc/HelloWorld.input:11 -bin/erbook:115:in `content_from_block' -bin/erbook:288:in `hello' -doc/HelloWorld.input:1 -bin/erbook:307 -bin/erbook:307:in `instance_eval' -bin/erbook:307</pre></dd> + <dd><pre>doc/HelloWorld.input:13:in `initialize' +doc/HelloWorld.input:11:in `initialize' +doc/HelloWorld.input:1:in `initialize'</pre></dd> <dt>content</dt> <dd>So _be_ happy my friend, *happy*! <h3>hello #1.2.1.1: nil</h3> My name is nil and these are my properties: <dl style='border-left: thick dotted LightGrey; padding-left: 1em;'> <dt>args</dt> - <dd><code class="code">[<span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">Lonely (as you can see, I have no block)</span><span style="color:#710">&quot;</span></span>]</code></dd> + <dd><code class="code">[<span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">Lonely (as you can see, I have no block)</span><span style="color:#710">&quot;</span></span>]</code></dd> <dt>index</dt> - <dd><code class="code"><span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">1.2.1.1</span><span style="color:#710">&quot;</span></span></code></dd> + <dd><code class="code"><span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">1.2.1.1</span><span style="color:#710">&quot;</span></span></code></dd> <dt>number</dt> <dd><code class="code"><span style="color:#00D;font-weight:bold">8</span></code></dd> <dt>trace</dt> - <dd><pre>doc/HelloWorld.input:15 -bin/erbook:115:in `content_from_block' -bin/erbook:288:in `hello' -doc/HelloWorld.input:13 -bin/erbook:115:in `content_from_block' -bin/erbook:288:in `hello' -doc/HelloWorld.input:11 -bin/erbook:115:in `content_from_block' -bin/erbook:288:in `hello' -doc/HelloWorld.input:1 -bin/erbook:307 -bin/erbook:307:in `instance_eval' -bin/erbook:307</pre></dd> + <dd><pre>doc/HelloWorld.input:15:in `initialize' +doc/HelloWorld.input:13:in `initialize' +doc/HelloWorld.input:11:in `initialize' +doc/HelloWorld.input:1:in `initialize'</pre></dd> <dt>content</dt> <dd /> </dl> </dd> @@ -1437,181 +1451,164 @@ </dl></dd> </dl><h3>hello #2: nil</h3> <p>My name is nil and these are my properties:</p> <dl style='border-left: thick dotted LightGrey; padding-left: 1em;'> <dt>args</dt> - <dd><code class="code">[<span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">Snappy</span><span style="color:#710">&quot;</span></span>]</code></dd> + <dd><code class="code">[<span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">Snappy</span><span style="color:#710">&quot;</span></span>]</code></dd> <dt>index</dt> - <dd><code class="code"><span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">2</span><span style="color:#710">&quot;</span></span></code></dd> + <dd><code class="code"><span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">2</span><span style="color:#710">&quot;</span></span></code></dd> <dt>number</dt> <dd><code class="code"><span style="color:#00D;font-weight:bold">9</span></code></dd> <dt>trace</dt> - <dd><pre>doc/HelloWorld.input:17 -bin/erbook:307 -bin/erbook:307:in `instance_eval' -bin/erbook:307</pre></dd> + <dd><pre>doc/HelloWorld.input:17:in `initialize'</pre></dd> <dt>content</dt> <dd>Zip! Zap! Wake up, you sap! _Whoo I'm wild!_ ;-) </dd> </dl><h3>hello #3: nil</h3> <p>My name is nil and these are my properties:</p> <dl style='border-left: thick dotted LightGrey; padding-left: 1em;'> <dt>args</dt> - <dd><code class="code">[<span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">Independent (no block, no parents, I am _free_!)</span><span style="color:#710">&quot;</span></span>]</code></dd> + <dd><code class="code">[<span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">Independent (no block, no parents, I am _free_!)</span><span style="color:#710">&quot;</span></span>]</code></dd> <dt>index</dt> - <dd><code class="code"><span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">3</span><span style="color:#710">&quot;</span></span></code></dd> + <dd><code class="code"><span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">3</span><span style="color:#710">&quot;</span></span></code></dd> <dt>number</dt> <dd><code class="code"><span style="color:#00D;font-weight:bold">10</span></code></dd> <dt>trace</dt> - <dd><pre>doc/HelloWorld.input:20 -bin/erbook:307 -bin/erbook:307:in `instance_eval' -bin/erbook:307</pre></dd> + <dd><pre>doc/HelloWorld.input:20:in `initialize'</pre></dd> <dt>content</dt> <dd /> </dl> <p>That&#8217;s all folks!</p></div> </div></p></div> </div></p></div> </div></p></div> </div> <div class="chapter"> + <a name="Usage"/><div class="nav" id="Usage"><a title="Reverse jump to listing" href="#rev:Usage">&equiv;</a><a title="Jump to previous segment" href="#HelloWorld.output">&#x25B3;</a><a title="Jump to next segment" href="#Command-line-interface">&#x25BD;</a><a title="Jump to this segment" href="#Usage">&#x25CE;</a></div> <h1 class="title"> - Chapter&nbsp;<a class="list" title="Return to table of contents" id="Usage" href="#rev:Usage">4</a> + Chapter&nbsp;4 <br/> - <big><a class="here" title="Permanent link to this section" href="#Usage">Usage</a></big> + <big>Usage</big> </h1> <div class="content"><p><div class="section"> + <a name="Command-line-interface"/><div class="nav" id="Command-line-interface"><a title="Reverse jump to listing" href="#rev:Command-line-interface">&equiv;</a><a title="Jump to previous segment" href="#Usage">&#x25B3;</a><a title="Jump to next segment" href="#Saving-the-output-to-a-file">&#x25BD;</a><a title="Jump to this segment" href="#Command-line-interface">&#x25CE;</a></div> <h2 class="title"> - <a class="list" title="Return to table of contents" id="Command-line-invocation" href="#rev:Command-line-invocation">4.1</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#Command-line-invocation">Command-line invocation</a> + 4.1&nbsp;&nbsp;Command-line interface </h2> - <div class="content"><p>erbook is an extensible document processor based on eRuby.</p> + <div class="content"><p><pre>ERBook - Extensible document processor based on eRuby -<ul> -<li> -<p>The standard input stream will be read if an input file is not specified.</p> -</li> +* The standard input stream will be read if an input file is not specified. -<li> -<p>The final output document will be written to the standard output stream.</p> -</li> +* The final output document will be written to the standard output stream. -<li> -<p>If an error occurs, the input document will be written to the standard output stream, so that you can investigate line numbers in the error.</p> -</li> -</ul> -<b>Usage:</b> -<p><pre>erbook [Option...] FormatName [InputFile]</pre> <pre>erbook [Option...] FormatFile [InputFile]</pre></p> -<b>FormatName:</b> -<dl> -<dt>latex</dt> +* If an error occurs, the input document will be written to the standard + output stream, so that you can investigate line numbers in the error. -<dd>high-quality typesetting</dd> +Usage: -<dt>man</dt> + erbook [Option...] FormatName [InputFile] + erbook [Option...] FormatFile [InputFile] -<dd>manual page for UNIX</dd> +FormatName: + latex: high-quality typesetting + man: manual page for UNIX + xhtml: web page for the Internet + text: plain text, nothing fancy -<dt>xhtml</dt> +Option: + --unindent, -u: Unindent node content hierarchically + --manual, -m: Show the user manual + --version, -v: Print version and exit + --help, -h: Show this message</pre></p> -<dd>web page for the Internet</dd> +<p>The first command-line argument to erbook is either the name of a predefined format (FormatName) or the path to a <a class="xref" href="#SpecFile" title="Section 3.2. Format specification file">format specification file</a> (FormatFile).</p> -<dt>text</dt> +<p>Predefined formats are simply short-hand names of format specification files located in the <tt>fmt/</tt> subdirectory of the erbook installation directory (see <a class="xref" href="#Manifest">Section 2.3. Manifest</a>).</p> -<dd>plain text, nothing fancy</dd> -</dl> -<b>Option:</b> -<dl> -<dt><tt>--unindent</tt>, <tt>-u</tt></dt> - -<dd>Unindent node content hierarchically</dd> - -<dt><tt>--version</tt>, <tt>-v</tt></dt> - -<dd>Print version and exit</dd> - -<dt><tt>--help</tt>, <tt>-h</tt></dt> - -<dd>Show this message</dd> -</dl> - -<p><div class="paragraph"> - <p class="title"><a class="here" title="Permanent link to this section" href="#Command-line-arguments">Command-line arguments</a></p> - <div class="content"><p>The first command-line argument to erbook is either the name of a predefined format (FormatName) or the path to a <a class="xref" href="#SpecFile" title="Section 3.2. Format specification file">format specification file</a> (FormatFile).</p> - -<p>Predefined formats are simply short-hand names of format specification files located in the <tt>fmt/</tt> subdirectory of the erbook installation directory (see <a class="xref" href="#Manifest">Section 2.3. Manifest</a>).</p></div> -</div> <div class="paragraph"> - <p class="title"><a class="here" title="Permanent link to this section" href="#Saving-the-output-to-a-file">Saving the output to a file</a></p> +<p><div class="section"> + <a name="Saving-the-output-to-a-file"/><div class="nav" id="Saving-the-output-to-a-file"><a title="Reverse jump to listing" href="#rev:Saving-the-output-to-a-file">&equiv;</a><a title="Jump to previous segment" href="#Command-line-interface">&#x25B3;</a><a title="Jump to next segment" href="#Save-XHTML-output-as-.xhtml">&#x25BD;</a><a title="Jump to this segment" href="#Saving-the-output-to-a-file">&#x25CE;</a></div> + <h3 class="title"> + 4.1.1&nbsp;&nbsp;Saving the output to a file + </h3> <div class="content"><p>Simply redirect the standard ouput stream (STDOUT) to a file like this:</p> <pre>erbook &gt; YOUR_PATH_HERE</pre> <p>In the above example, <strong>YOUR_PATH_HERE</strong> is the path of the file in which the output should be saved.</p> <p><div class="important"> - <p class="title"><a class="list" title="Return to table of contents" id="Save-XHTML-output-as-.xhtml" href="#rev:Save-XHTML-output-as-.xhtml">Important 1</a>.&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#Save-XHTML-output-as-.xhtml">Save XHTML output as <tt>.xhtml</tt></a></p> - <div class="content"><img class="icon" src="&icon_important;" alt="important"/><p>When you use the XHTML format, ensure that the file extension of your saved output document is either <tt>.xhtml</tt> or <tt>.xml</tt>. Alternatively, ensure that your saved output document is served to web browsers under the <tt>application/xhtml+xml</tt> mime type.</p> + <a name="Save-XHTML-output-as-.xhtml"/><div class="nav" id="Save-XHTML-output-as-.xhtml"><a title="Reverse jump to listing" href="#rev:Save-XHTML-output-as-.xhtml">&equiv;</a><a title="Jump to previous segment" href="#Saving-the-output-to-a-file">&#x25B3;</a><a title="Jump to next segment" href="#include">&#x25BD;</a><a title="Jump to this segment" href="#Save-XHTML-output-as-.xhtml">&#x25CE;</a></div> + <p class="title">Important 1.&nbsp;&nbsp;Save XHTML output as <tt>.xhtml</tt></p> + <div class="content"> + <img class="icon" src="&icon_important;" alt="important"/> + <p>When you use the XHTML format, ensure that the file extension of your saved output document is either <tt>.xhtml</tt> or <tt>.xml</tt>. Alternatively, ensure that your saved output document is served to web browsers under the <tt>application/xhtml+xml</tt> mime type.</p> -<p>Otherwise, most web browsers <em>will not display</em> the icons and graphics embedded in the saved XHTML output document because they will treat it as HTML instead of as XML. See this <a href='http://www.quirksmode.org/bugreports/archives/2005/02/custom_dtds_int_1.html'>QuirksMode.org bug report</a> for details.</p></div> +<p>Otherwise, most web browsers <em>will not display</em> the icons and graphics embedded in the saved XHTML output document because they will treat it as HTML instead of as XML. See <a href='http://www.quirksmode.org/bugreports/archives/2005/02/custom_dtds_int_1.html'>this QuirksMode.org bug report</a> for details.</p> + </div> </div></p></div> </div></p></div> </div> <div class="section"> + <a name="include"/><div class="nav" id="include"><a title="Reverse jump to listing" href="#rev:include">&equiv;</a><a title="Jump to previous segment" href="#Save-XHTML-output-as-.xhtml">&#x25B3;</a><a title="Jump to next segment" href="#Unindenting-nodes-hierarchically">&#x25BD;</a><a title="Jump to this segment" href="#include">&#x25CE;</a></div> <h2 class="title"> - <a class="list" title="Return to table of contents" id="include" href="#rev:include">4.2</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#include">Including external documents</a> + 4.2&nbsp;&nbsp;Including external documents </h2> <div class="content"><p>The <strong>include</strong> directive allows you to insert the content of an arbitrary file at a certain place in the input document. It is written like this:</p> <pre>&lt;%# include YOUR_PATH_HERE #%&gt;</pre> <p>In the above example, <strong>YOUR_PATH_HERE</strong> is the path of the file whose content you wish to insert into the input document.</p> <p>You can divide a large document into separate files for easier editing and stitch them together, dynamically, into a single document using the <strong>include</strong> directive.</p></div> </div> <div class="section"> + <a name="Unindenting-nodes-hierarchically"/><div class="nav" id="Unindenting-nodes-hierarchically"><a title="Reverse jump to listing" href="#rev:Unindenting-nodes-hierarchically">&equiv;</a><a title="Jump to previous segment" href="#include">&#x25B3;</a><a title="Jump to next segment" href="#Formats">&#x25BD;</a><a title="Jump to this segment" href="#Unindenting-nodes-hierarchically">&#x25CE;</a></div> <h2 class="title"> - <a class="list" title="Return to table of contents" id="Unindenting-nodes-hierarchically" href="#rev:Unindenting-nodes-hierarchically">4.3</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#Unindenting-nodes-hierarchically">Unindenting nodes hierarchically</a> + 4.3&nbsp;&nbsp;Unindenting nodes hierarchically </h2> - <div class="content"><p>When writing erbook documents, I prefer to indent the content of nodes according to their depth (as can be seen in <a class="xref" href="#See-the-source-of-this-manual" title="Note 1. See the source of this manual">the source of this manual</a>) because my <a href='http://jedit.org'>text editor of choice</a> automatically folds blocks of text based on indentation.</p> + <div class="content"><p>When writing erbook documents, I prefer to indent the content of nodes according to their depth because my <a href='http://jedit.org'>text editor of choice</a> automatically folds blocks of text based on indentation.</p> <p>If you also prefer to write documents in this way, be sure to pass the <tt>--unindent</tt> option to <strong>erbook</strong> so that the indentation will not affect the resulting output.</p></div> </div></p></div> </div> <div class="part"> + <a name="Formats"/><div class="nav" id="Formats"><a title="Reverse jump to listing" href="#rev:Formats">&equiv;</a><a title="Jump to previous segment" href="#Unindenting-nodes-hierarchically">&#x25B3;</a><a title="Jump to next segment" href="#xhtml">&#x25BD;</a><a title="Jump to this segment" href="#Formats">&#x25CE;</a></div> <h1 class="title"> - Part&nbsp;<a class="list" title="Return to table of contents" id="Formats" href="#rev:Formats">5</a> + Part&nbsp;5 <br/> - <big><a class="here" title="Permanent link to this section" href="#Formats">Formats</a></big> + <big>Formats</big> </h1> - <div class="content"><p>This part describes the default formats provided along with erbook. The <a class="xref" href="#SpecFile" title="Section 3.2. Format specification file">format specification files</a> for these formats can be found in the <tt>fmt/</tt> directory of the erbook installation directory (see <a class="xref" href="#Manifest">Section 2.3. Manifest</a>).</p> + <div class="content"><p>This part describes the default formats provided along with ERBook. The <a class="xref" href="#SpecFile" title="Section 3.2. Format specification file">format specification files</a> for these formats can be found in the <tt>fmt/</tt> directory of the ERBook installation directory (see <a class="xref" href="#Manifest">Section 2.3. Manifest</a>).</p> -<p>These formats are meant to serve as working examples. If you require more functionality from one of these formats, simply make a copy of the corresponding format specification file and edit the copy to suit your needs. If you would like to contribute or discuss your enhancements to these default formats, you can <a class="xref" href="#License" title="Section 1.2.2. License">contact the author</a>.</p> +<p>These formats are meant to serve as working examples. If you require more functionality from one of these formats, simply make a copy of the corresponding format specification file and edit the copy to suit your needs. If you would like to contribute or discuss your enhancements to these default formats, you can <a class="xref" href="#License" title="Section 1.2. License">contact the author</a>.</p> <p><div class="chapter"> + <a name="xhtml"/><div class="nav" id="xhtml"><a title="Reverse jump to listing" href="#rev:xhtml">&equiv;</a><a title="Jump to previous segment" href="#Formats">&#x25B3;</a><a title="Jump to next segment" href="#Text-to-XHTML-conversion">&#x25BD;</a><a title="Jump to this segment" href="#xhtml">&#x25CE;</a></div> <h1 class="title"> - Chapter&nbsp;<a class="list" title="Return to table of contents" id="xhtml" href="#rev:xhtml">5.1</a> + Chapter&nbsp;5.1 <br/> - <big><a class="here" title="Permanent link to this section" href="#xhtml">XHTML (web page)</a></big> + <big>XHTML (web page)</big> </h1> <div class="content"><p>This format generates a <em>monolithic</em> XHTML document that allows users to easily search for a particular topic using nothing more than their web browser&#8217;s built-in text search mechanism. This facilitates offline reading, where an Internet search engine is not available.</p> -<p>In the XHTML document, you will notice that the numbers of chapters, sections, figures, admonitions, etc. are hyperlinks that take you back to the corresponding place in the table of contents. These links make it easy to navigate the XHTML document, especially for users of text-only web browsers.</p> +<p>When viewing an XHTML document in a graphical web browser, you will notice navigation menus to the left of chapters, sections, figures, admonitions, and so on. These menus contain hyperlinks that make it easy to navigate the XHTML document, especially for users of text-only web browsers.</p> -<p>Furthermore, the XHTML document comes equipped with a stylesheet that makes it suitable for printing. In particular, users of the <a href='http://mozilla.org'>Mozilla</a> and <a href='http://www.opera.com/'>Opera</a> family of web browsers will be pleasantly surprised to notice that all hyperlinks have been expanded to include their target URL next to the link text. So try using the &#8220;print preview&#8221; function of a graphical web browser to see how the XHTML document will appear when printed.</p> +<p>Furthermore, the XHTML document comes equipped with a stylesheet that makes it suitable for printing. In particular, users of web browsers that support CSS3 selectors will notice that all hyperlinks have been expanded to include their target URL next to them. Try the &#8220;print preview&#8221; function of your web browser to see how the XHTML document would appear when printed.</p> <p><div class="section"> + <a name="Text-to-XHTML-conversion"/><div class="nav" id="Text-to-XHTML-conversion"><a title="Reverse jump to listing" href="#rev:Text-to-XHTML-conversion">&equiv;</a><a title="Jump to previous segment" href="#xhtml">&#x25B3;</a><a title="Jump to next segment" href="#Syntax-coloring-for-source-code">&#x25BD;</a><a title="Jump to this segment" href="#Text-to-XHTML-conversion">&#x25CE;</a></div> <h3 class="title"> - <a class="list" title="Return to table of contents" id="Text-to-XHTML-conversion" href="#rev:Text-to-XHTML-conversion">5.1.1</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#Text-to-XHTML-conversion">Text to XHTML conversion</a> + 5.1.1&nbsp;&nbsp;Text to XHTML conversion </h3> - <div class="content"><p>The <tt>lib/erbook/to_xhtml.rb</tt> file inside erbook&#8217;s installation directory (see <a class="xref" href="#Manifest">Section 2.3. Manifest</a>) defines the following methods:</p> + <div class="content"><p>The <tt>lib/erbook/to_xhtml.rb</tt> file inside ERBook&#8217;s installation directory (see <a class="xref" href="#Manifest">Section 2.3. Manifest</a>) defines the following methods:</p> <ul> <li> <p><code class="code"><span style="color:#036;font-weight:bold">String</span><span style="color:#666">#to_xhtml</span></code> - Transforms this string into XHTML while ensuring that the result contains one or more block-level elements at the root.</p> </li> @@ -1623,16 +1620,15 @@ <p>The default implementation of the <code class="code"><span style="color:#036;font-weight:bold">String</span><span style="color:#666">#to_xhtml</span></code> method employs the <a href='http://daringfireball.net/projects/markdown/'>Markdown</a> markup system. If you do not like Markdown or wish to use a different markup system for text in your documents, then simply edit the <tt>to_xhtml.rb</tt> file and adjust the source code of the default <code class="code"><span style="color:#036;font-weight:bold">String</span><span style="color:#666">#to_xhtml</span></code> and <code class="code"><span style="color:#036;font-weight:bold">String</span>.to_inline_xhtml</code> methods accordingly.</p> <p>For example, if you replace the entire <tt>to_xhtml.rb</tt> file with the following code, then the output of all nodes will appear within red boxes in the final output document.</p> -<p><pre class="code"> -<span style="color:#080;font-weight:bold">class</span> <span style="color:#B06;font-weight:bold">String</span> +<p><pre class="code"><span style="color:#080;font-weight:bold">class</span> <span style="color:#B06;font-weight:bold">String</span> <span style="color:#666"># Transforms this string into XHTML while ensuring that the</span> <span style="color:#666"># result contains one or more block-level elements at the root.</span> <span style="color:#080;font-weight:bold">def</span> <span style="color:#06B;font-weight:bold">to_xhtml</span> - <span style="background-color:#fff0f0"><span style="color:#710">'</span><span style="color:#D20">&lt;p style=&quot;border: thin solid red&quot;&gt;</span><span style="color:#710">'</span></span> + <span style="color:#038;font-weight:bold">self</span> + <span style="background-color:#fff0f0"><span style="color:#710">'</span><span style="color:#D20">&lt;/p&gt;</span><span style="color:#710">'</span></span> + <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">'</span><span style="">&lt;p style=&quot;border: thin solid red&quot;&gt;</span><span style="color:#710">'</span></span> + <span style="color:#038;font-weight:bold">self</span> + <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">'</span><span style="">&lt;/p&gt;</span><span style="color:#710">'</span></span> <span style="color:#080;font-weight:bold">end</span> <span style="color:#666"># Transforms this string into an *inline* XHTML string (one that</span> <span style="color:#666"># does not contain any block-level XHTML elements at the root).</span> <span style="color:#080;font-weight:bold">def</span> <span style="color:#06B;font-weight:bold">to_inline_xhtml</span> @@ -1642,12 +1638,13 @@ </pre></p> <p>In addition to supporting Markdown syntax, the default implementation has some additional features which are described in the following subsections.</p> <p><div class="section"> + <a name="Syntax-coloring-for-source-code"/><div class="nav" id="Syntax-coloring-for-source-code"><a title="Reverse jump to listing" href="#rev:Syntax-coloring-for-source-code">&equiv;</a><a title="Jump to previous segment" href="#Text-to-XHTML-conversion">&#x25B3;</a><a title="Jump to next segment" href="#Specifying-the-programming-language">&#x25BD;</a><a title="Jump to this segment" href="#Syntax-coloring-for-source-code">&#x25CE;</a></div> <h4 class="title"> - <a class="list" title="Return to table of contents" id="Syntax-coloring-for-source-code" href="#rev:Syntax-coloring-for-source-code">5.1.1.1</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#Syntax-coloring-for-source-code">Syntax coloring for source code</a> + 5.1.1.1&nbsp;&nbsp;Syntax coloring for source code </h4> <div class="content"><p>Syntax coloring is <em>automatically added</em> to source code found inside the <strong>&#60;code&#62;</strong> and <strong>&#60;/code&#62;</strong> HTML tags. The syntax coloring library, <a href='http://coderay.rubychan.de'>CodeRay</a>, currently supports the following programming languages:</p> <ul> <li>Ruby</li> @@ -1662,28 +1659,28 @@ <li>Nitro-XHTML</li> </ul> <p><div class="section"> + <a name="Specifying-the-programming-language"/><div class="nav" id="Specifying-the-programming-language"><a title="Reverse jump to listing" href="#rev:Specifying-the-programming-language">&equiv;</a><a title="Jump to previous segment" href="#Syntax-coloring-for-source-code">&#x25B3;</a><a title="Jump to next segment" href="#Smart-sizing-of-source-code">&#x25BD;</a><a title="Jump to this segment" href="#Specifying-the-programming-language">&#x25CE;</a></div> <h5 class="title"> - <a class="list" title="Return to table of contents" id="Specifying-the-programming-language" href="#rev:Specifying-the-programming-language">5.1.1.1.1</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#Specifying-the-programming-language">Specifying the programming language</a> + 5.1.1.1.1&nbsp;&nbsp;Specifying the programming language </h5> <div class="content"><p>Because different programming languages have different syntax coloring schemes, you can specify the language of your source code using the <code class="code">lang</code> attribute to ensure that only the appropriate coloring scheme is used. Note that unless the <code class="code">lang</code> attribute is specified, <em>Ruby</em> is assumed to be the programming language of all source code by default.</p> <p>For example, here is some source code <em>without</em> the <code class="code">lang</code> attribute:</p> -<p><pre class="code"> -<span style="color:#666"># Ruby ###########################</span> +<p><pre class="code"><span style="color:#666"># Ruby ###########################</span> <span style="color:#080;font-weight:bold">def</span> <span style="color:#06B;font-weight:bold">hello</span> - puts <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">Hello world!</span><span style="color:#710">&quot;</span></span> + puts <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">Hello world!</span><span style="color:#710">&quot;</span></span> <span style="color:#080;font-weight:bold">end</span> <span style="background-color:#fff0ff"><span style="color:#404">/</span><span style="color:#808">* C ****************************</span><span style="color:#404">/</span></span> <span style="color:#666">#include &lt;stdio.h&gt;</span> int main(int argc, char **argv) { - printf(<span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">Hello world!</span><span style="color:#b0b">\n</span><span style="color:#710">&quot;</span></span>); + printf(<span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">Hello world!</span><span style="color:#b0b">\n</span><span style="color:#710">&quot;</span></span>); <span style="color:#080;font-weight:bold">return</span> <span style="color:#00D;font-weight:bold">0</span>; } &lt;!-- <span style="color:#036;font-weight:bold">HTML</span> -----------------------&gt; @@ -1692,23 +1689,22 @@ <span style="color:#036;font-weight:bold">Hello</span> world! &lt;body&gt; &lt;<span style="background-color:#fff0ff"><span style="color:#404">/</span><span style="color:#808">html&gt; </span></span></pre></p> -<p>And here is the same source code with a <code class="code">lang=<span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">c</span><span style="color:#710">&quot;</span></span></code> attribute:</p> +<p>And here is the same source code with a <code class="code">lang=<span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">c</span><span style="color:#710">&quot;</span></span></code> attribute:</p> -<p><pre class="code" lang="c"> -<span style="color:#579"># Ruby</span> <span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579"># +<p><pre class="code" lang="c"><span style="color:#579"># Ruby</span> <span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579">#</span><span style="color:#579"># def</span> hello - puts <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">Hello world!</span><span style="color:#710">&quot;</span></span> + puts <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">Hello world!</span><span style="color:#710">&quot;</span></span> end <span style="color:#666">/* C ****************************/</span> <span style="color:#579">#include</span> <span style="color:#B44;font-weight:bold">&lt;stdio.h&gt;</span> <span style="color:#339;font-weight:bold">int</span> main(<span style="color:#339;font-weight:bold">int</span> argc, <span style="color:#339;font-weight:bold">char</span> **argv) { - printf(<span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">Hello world!</span><span style="color:#b0b">\n</span><span style="color:#710">&quot;</span></span>); + printf(<span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">Hello world!</span><span style="color:#b0b">\n</span><span style="color:#710">&quot;</span></span>); <span style="color:#080;font-weight:bold">return</span> <span style="color:#00D;font-weight:bold">0</span>; } &lt;!-- HTML -----------------------&gt; @@ -1717,14 +1713,13 @@ Hello world! &lt;body&gt; &lt;/html&gt; </pre></p> -<p>And here is the same source code with a <code class="code">lang=<span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">html</span><span style="color:#710">&quot;</span></span></code> attribute:</p> +<p>And here is the same source code with a <code class="code">lang=<span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">html</span><span style="color:#710">&quot;</span></span></code> attribute:</p> -<p><pre class="code" lang="html"> -# Ruby ########################### +<p><pre class="code" lang="html"># Ruby ########################### def hello puts &quot;Hello world!&quot; end @@ -1743,192 +1738,209 @@ <span style="color:#070">&lt;body&gt;</span> <span style="color:#070">&lt;/html&gt;</span> </pre></p></div> </div></p></div> </div> <div class="section"> + <a name="Smart-sizing-of-source-code"/><div class="nav" id="Smart-sizing-of-source-code"><a title="Reverse jump to listing" href="#rev:Smart-sizing-of-source-code">&equiv;</a><a title="Jump to previous segment" href="#Specifying-the-programming-language">&#x25B3;</a><a title="Jump to next segment" href="#Protecting-verbatim-text">&#x25BD;</a><a title="Jump to this segment" href="#Smart-sizing-of-source-code">&#x25CE;</a></div> <h4 class="title"> - <a class="list" title="Return to table of contents" id="Smart-sizing-of-source-code" href="#rev:Smart-sizing-of-source-code">5.1.1.2</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#Smart-sizing-of-source-code">Smart sizing of source code</a> + 5.1.1.2&nbsp;&nbsp;Smart sizing of source code </h4> <div class="content"><p>Source code is <em>automatically sized</em> to be displayed as either a line or paragraph of text, depending on whether it contains line breaks.</p> <p>For example, here is a single line <code class="code">life = <span style="color:#038;font-weight:bold">true</span> <span style="color:#080;font-weight:bold">or</span> <span style="color:#038;font-weight:bold">false</span></code> of code. And here is a paragraph <pre class="code">life = <span style="color:#038;font-weight:bold">true</span> <span style="color:#080;font-weight:bold">or</span> <span style="color:#038;font-weight:bold">false</span></pre> of code.</p></div> </div> <div class="section"> + <a name="Protecting-verbatim-text"/><div class="nav" id="Protecting-verbatim-text"><a title="Reverse jump to listing" href="#rev:Protecting-verbatim-text">&equiv;</a><a title="Jump to previous segment" href="#Smart-sizing-of-source-code">&#x25B3;</a><a title="Jump to next segment" href="#Parameters">&#x25BD;</a><a title="Jump to this segment" href="#Protecting-verbatim-text">&#x25CE;</a></div> <h4 class="title"> - <a class="list" title="Return to table of contents" id="Protecting-verbatim-text" href="#rev:Protecting-verbatim-text">5.1.1.3</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#Protecting-verbatim-text">Protecting verbatim text</a> + 5.1.1.3&nbsp;&nbsp;Protecting verbatim text </h4> <div class="content"><p>Sometimes you just need to protect some text from being mangled by the text-to-XHTML conversion process . In such cases, you can wrap the text you want to proctect within <strong>&#60;noformat&#62;</strong> and <strong>&#60;/noformat&#62;</strong> tags.</p></div> </div></p></div> </div> <div class="section"> + <a name="Parameters"/><div class="nav" id="Parameters"><a title="Reverse jump to listing" href="#rev:Parameters">&equiv;</a><a title="Jump to previous segment" href="#Protecting-verbatim-text">&#x25B3;</a><a title="Jump to next segment" href="#Methods">&#x25BD;</a><a title="Jump to this segment" href="#Parameters">&#x25CE;</a></div> <h3 class="title"> - <a class="list" title="Return to table of contents" id="Parameters" href="#rev:Parameters">5.1.2</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#Parameters">Parameters</a> + 5.1.2&nbsp;&nbsp;Parameters </h3> - <div class="content"><p>The XHTML format accepts the following document parameters.</p> -<table border="1"><thead><tr><th>Parameter</th><th>Type</th><th>Default value</th><th>Description</th></tr></thead><tbody><tr><td style='text-align: left;'><code class="code"><span style="color:#d70;font-weight:bold">$title</span></code></td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">String</span></code></td><td style='text-align: left;'><code class="code"><span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">$title</span><span style="color:#710">&quot;</span></span></code></td><td style='text-align: left;'>Title of the document.</td> -</tr><tr><td style='text-align: left;'><code class="code"><span style="color:#d70;font-weight:bold">$authors</span></code></td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">Hash</span></code></td><td style='text-align: left;'><code class="code">{<span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">$authors</span><span style="color:#710">&quot;</span></span> =&gt; <span style="color:#038;font-weight:bold">nil</span>}</code></td><td style='text-align: left;'>A mapping of author name to author URL. You can obfuscate e-mail addresses using the provided <code class="code"><span style="color:#036;font-weight:bold">String</span><span style="color:#666">#to_xml_entities</span></code> method like this: <code class="code">{ <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">Y. Matsumoto</span><span style="color:#710">&quot;</span></span> =&gt; <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">mailto:matz@ruby.invalid</span><span style="color:#710">&quot;</span></span>.to_xml_entities }</code></td> -</tr><tr><td style='text-align: left;'><code class="code"><span style="color:#d70;font-weight:bold">$date</span></code></td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">String</span></code></td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">Time</span>.now.strftime(<span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">%d %B %Y</span><span style="color:#710">&quot;</span></span>)</code></td><td style='text-align: left;'>Date when the document was written.</td> + <div class="content"><p>The XHTML format accepts the following document parameters. To disable the default value for a particular parameter, simply set that parameter to <code class="code"><span style="color:#038;font-weight:bold">nil</span></code>. For example, to disable the <code class="code"><span style="color:#d70;font-weight:bold">$authors</span></code> parameter, you would write <code class="code"><span style="color:#d70;font-weight:bold">$authors</span> = <span style="color:#038;font-weight:bold">nil</span></code> in your input document.</p> +<table border="1"><thead><tr><th>Parameter</th><th>Type</th><th>Default value</th><th>Description</th></tr></thead><tbody><tr><td style='text-align: left;'><code class="code"><span style="color:#d70;font-weight:bold">$title</span></code></td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">String</span></code></td><td style='text-align: left;'><code class="code"><span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">$title</span><span style="color:#710">&quot;</span></span></code></td><td style='text-align: left;'>Title of the document.</td> +</tr><tr><td style='text-align: left;'><code class="code"><span style="color:#d70;font-weight:bold">$subtitle</span></code></td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">String</span></code></td><td style='text-align: left;'><code class="code"><span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">$subtitle</span><span style="color:#710">&quot;</span></span></code></td><td style='text-align: left;'>Secondary title of the document.</td> +</tr><tr><td style='text-align: left;'><code class="code"><span style="color:#d70;font-weight:bold">$authors</span></code></td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">Hash</span></code></td><td style='text-align: left;'><code class="code">{<span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">$authors</span><span style="color:#710">&quot;</span></span> =&gt; <span style="color:#038;font-weight:bold">nil</span>}</code></td><td style='text-align: left;'>A mapping of author name to author URL. You can obfuscate e-mail addresses using the provided <code class="code"><span style="color:#036;font-weight:bold">String</span><span style="color:#666">#to_xml_entities</span></code> method like this: <code class="code">{ <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">Y. Matsumoto</span><span style="color:#710">&quot;</span></span> =&gt; <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">mailto:matz@ruby.invalid</span><span style="color:#710">&quot;</span></span>.to_xml_entities }</code></td> +</tr><tr><td style='text-align: left;'><code class="code"><span style="color:#d70;font-weight:bold">$date</span></code></td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">String</span></code></td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">Time</span>.now.strftime(<span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">%d %B %Y</span><span style="color:#710">&quot;</span></span>)</code></td><td style='text-align: left;'>Date when the document was written.</td> </tr><tr><td style='text-align: left;'><code class="code"><span style="color:#d70;font-weight:bold">$logo</span></code></td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">String</span></code></td><td style='text-align: left;'><code class="code"><span style="color:#038;font-weight:bold">nil</span></code></td><td style='text-align: left;'>Arbitrary content that goes above the document title in the default header.</td> -</tr><tr><td style='text-align: left;'><code class="code"><span style="color:#d70;font-weight:bold">$feeds</span></code></td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">Hash</span></code></td><td style='text-align: left;'><code class="code"><span style="color:#038;font-weight:bold">nil</span></code></td><td style='text-align: left;'>A mapping of feed URL to feed format. Here is an example: <code class="code"><span style="color:#d70;font-weight:bold">$feeds</span> = { <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">my_rss_feed.xml</span><span style="color:#710">&quot;</span></span> =&gt; <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">rss</span><span style="color:#710">&quot;</span></span>, <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">my_atom_feed.xml</span><span style="color:#710">&quot;</span></span> =&gt; <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">atom</span><span style="color:#710">&quot;</span></span> }</code></td> +</tr><tr><td style='text-align: left;'><code class="code"><span style="color:#d70;font-weight:bold">$feeds</span></code></td><td style='text-align: left;'><code class="code"><span style="color:#036;font-weight:bold">Hash</span></code></td><td style='text-align: left;'><code class="code"><span style="color:#038;font-weight:bold">nil</span></code></td><td style='text-align: left;'>A mapping of feed URL to feed format. Here is an example: <code class="code"><span style="color:#d70;font-weight:bold">$feeds</span> = { <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">my_rss_feed.xml</span><span style="color:#710">&quot;</span></span> =&gt; <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">rss</span><span style="color:#710">&quot;</span></span>, <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">my_atom_feed.xml</span><span style="color:#710">&quot;</span></span> =&gt; <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">atom</span><span style="color:#710">&quot;</span></span> }</code></td> </tr></tbody></table></div> </div> <div class="section"> + <a name="Methods"/><div class="nav" id="Methods"><a title="Reverse jump to listing" href="#rev:Methods">&equiv;</a><a title="Jump to previous segment" href="#Parameters">&#x25B3;</a><a title="Jump to next segment" href="#a-ERBook::Document::Node-title">&#x25BD;</a><a title="Jump to this segment" href="#Methods">&#x25CE;</a></div> <h3 class="title"> - <a class="list" title="Return to table of contents" id="Methods" href="#rev:Methods">5.1.3</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#Methods">Methods</a> + 5.1.3&nbsp;&nbsp;Methods </h3> <div class="content"><p>The XHTML format provides the following methods. In the method declarations shown below,</p> <ul> <li>a pound sign (#) indicates that the method is an <em>instance method</em>, meaning that it can only be invoked on instances of a class, not on the classes themselves.</li> <li>a double colon sign (::) indicates that the method is a <em>class method</em>, meaning that it can only be invoked on a class.</li> </ul> -<p><div class="section"> - <h4 class="title"> - <a class="list" title="Return to table of contents" id="a-ERBook::Node-title" href="#rev:a-ERBook::Node-title">5.1.3.1</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#a-ERBook::Node-title"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Node</span><span style="color:#666">#title()</span></code></a> - </h4> +<p><div class="paragraph"> + <a name="a-ERBook::Document::Node-title"/><div class="nav" id="a-ERBook::Document::Node-title"><a title="Reverse jump to listing" href="#rev:a-ERBook::Document::Node-title">&equiv;</a><a title="Jump to previous segment" href="#Methods">&#x25B3;</a><a title="Jump to next segment" href="#a-ERBook::Document::Node-id">&#x25BD;</a><a title="Jump to this segment" href="#a-ERBook::Document::Node-title">&#x25CE;</a></div> + <p class="title"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Document</span>::<span style="color:#036;font-weight:bold">Node</span><span style="color:#666">#title()</span></code></p> <div class="content"><p> Returns the user-defined title for this node&#8216;s content. </p></div> -</div><div class="section"> - <h4 class="title"> - <a class="list" title="Return to table of contents" id="a-ERBook::Node-id" href="#rev:a-ERBook::Node-id">5.1.3.2</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#a-ERBook::Node-id"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Node</span><span style="color:#666">#id()</span></code></a> - </h4> +</div><div class="paragraph"> + <a name="a-ERBook::Document::Node-id"/><div class="nav" id="a-ERBook::Document::Node-id"><a title="Reverse jump to listing" href="#rev:a-ERBook::Document::Node-id">&equiv;</a><a title="Jump to previous segment" href="#a-ERBook::Document::Node-title">&#x25B3;</a><a title="Jump to next segment" href="#a-ERBook::Document::Node-title_xhtml">&#x25BD;</a><a title="Jump to this segment" href="#a-ERBook::Document::Node-id">&#x25CE;</a></div> + <p class="title"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Document</span>::<span style="color:#036;font-weight:bold">Node</span><span style="color:#666">#id()</span></code></p> <div class="content"><p> Returns the user-defined indentifer for this node. </p></div> -</div><div class="section"> - <h4 class="title"> - <a class="list" title="Return to table of contents" id="a-ERBook::Node-title_xhtml" href="#rev:a-ERBook::Node-title_xhtml">5.1.3.3</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#a-ERBook::Node-title_xhtml"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Node</span><span style="color:#666">#title_xhtml()</span></code></a> - </h4> +</div><div class="paragraph"> + <a name="a-ERBook::Document::Node-title_xhtml"/><div class="nav" id="a-ERBook::Document::Node-title_xhtml"><a title="Reverse jump to listing" href="#rev:a-ERBook::Document::Node-title_xhtml">&equiv;</a><a title="Jump to previous segment" href="#a-ERBook::Document::Node-id">&#x25B3;</a><a title="Jump to next segment" href="#a-ERBook::Document::Node-content_xhtml">&#x25BD;</a><a title="Jump to this segment" href="#a-ERBook::Document::Node-title_xhtml">&#x25CE;</a></div> + <p class="title"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Document</span>::<span style="color:#036;font-weight:bold">Node</span><span style="color:#666">#title_xhtml()</span></code></p> <div class="content"><p> Returns the title of this node as XHTML. </p></div> -</div><div class="section"> - <h4 class="title"> - <a class="list" title="Return to table of contents" id="a-ERBook::Node-content_xhtml" href="#rev:a-ERBook::Node-content_xhtml">5.1.3.4</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#a-ERBook::Node-content_xhtml"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Node</span><span style="color:#666">#content_xhtml()</span></code></a> - </h4> +</div><div class="paragraph"> + <a name="a-ERBook::Document::Node-content_xhtml"/><div class="nav" id="a-ERBook::Document::Node-content_xhtml"><a title="Reverse jump to listing" href="#rev:a-ERBook::Document::Node-content_xhtml">&equiv;</a><a title="Jump to previous segment" href="#a-ERBook::Document::Node-title_xhtml">&#x25B3;</a><a title="Jump to next segment" href="#a-ERBook::Document::Node-title_link-title-nil">&#x25BD;</a><a title="Jump to this segment" href="#a-ERBook::Document::Node-content_xhtml">&#x25CE;</a></div> + <p class="title"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Document</span>::<span style="color:#036;font-weight:bold">Node</span><span style="color:#666">#content_xhtml()</span></code></p> <div class="content"><p> Returns the content of this node as XHTML. </p></div> -</div><div class="section"> - <h4 class="title"> - <a class="list" title="Return to table of contents" id="a-ERBook::Node-title_link-aTitle-nil" href="#rev:a-ERBook::Node-title_link-aTitle-nil">5.1.3.5</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#a-ERBook::Node-title_link-aTitle-nil"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Node</span><span style="color:#666">#title_link(aTitle = nil)</span></code></a> - </h4> +</div><div class="paragraph"> + <a name="a-ERBook::Document::Node-title_link-title-nil"/><div class="nav" id="a-ERBook::Document::Node-title_link-title-nil"><a title="Reverse jump to listing" href="#rev:a-ERBook::Document::Node-title_link-title-nil">&equiv;</a><a title="Jump to previous segment" href="#a-ERBook::Document::Node-content_xhtml">&#x25B3;</a><a title="Jump to next segment" href="#a-ERBook::Document::Node-index_link">&#x25BD;</a><a title="Jump to this segment" href="#a-ERBook::Document::Node-title_link-title-nil">&#x25CE;</a></div> + <p class="title"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Document</span>::<span style="color:#036;font-weight:bold">Node</span><span style="color:#666">#title_link(title = nil)</span></code></p> <div class="content"><p> Returns a hyperlink to this node containing its title. </p></div> -</div><div class="section"> - <h4 class="title"> - <a class="list" title="Return to table of contents" id="a-ERBook::Node-index_link" href="#rev:a-ERBook::Node-index_link">5.1.3.6</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#a-ERBook::Node-index_link"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Node</span><span style="color:#666">#index_link()</span></code></a> - </h4> +</div><div class="paragraph"> + <a name="a-ERBook::Document::Node-index_link"/><div class="nav" id="a-ERBook::Document::Node-index_link"><a title="Reverse jump to listing" href="#rev:a-ERBook::Document::Node-index_link">&equiv;</a><a title="Jump to previous segment" href="#a-ERBook::Document::Node-title_link-title-nil">&#x25B3;</a><a title="Jump to next segment" href="#a-ERBook::Document::Node-number_link">&#x25BD;</a><a title="Jump to this segment" href="#a-ERBook::Document::Node-index_link">&#x25CE;</a></div> + <p class="title"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Document</span>::<span style="color:#036;font-weight:bold">Node</span><span style="color:#666">#index_link()</span></code></p> <div class="content"><p> Returns a hyperlink to this node containing its LaTeX-style index number. </p></div> -</div><div class="section"> - <h4 class="title"> - <a class="list" title="Return to table of contents" id="a-ERBook::Node-number_link" href="#rev:a-ERBook::Node-number_link">5.1.3.7</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#a-ERBook::Node-number_link"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Node</span><span style="color:#666">#number_link()</span></code></a> - </h4> +</div><div class="paragraph"> + <a name="a-ERBook::Document::Node-number_link"/><div class="nav" id="a-ERBook::Document::Node-number_link"><a title="Reverse jump to listing" href="#rev:a-ERBook::Document::Node-number_link">&equiv;</a><a title="Jump to previous segment" href="#a-ERBook::Document::Node-index_link">&#x25B3;</a><a title="Jump to next segment" href="#a-ERBook::Document::Node-navigation">&#x25BD;</a><a title="Jump to this segment" href="#a-ERBook::Document::Node-number_link">&#x25CE;</a></div> + <p class="title"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Document</span>::<span style="color:#036;font-weight:bold">Node</span><span style="color:#666">#number_link()</span></code></p> <div class="content"><p> Returns a hyperlink to this node containing its occurrence number. </p></div> -</div><div class="section"> - <h4 class="title"> - <a class="list" title="Return to table of contents" id="a-Hash-to_xml_atts" href="#rev:a-Hash-to_xml_atts">5.1.3.8</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#a-Hash-to_xml_atts"><code class="code"><span style="color:#036;font-weight:bold">Hash</span><span style="color:#666">#to_xml_atts()</span></code></a> - </h4> +</div><div class="paragraph"> + <a name="a-ERBook::Document::Node-navigation"/><div class="nav" id="a-ERBook::Document::Node-navigation"><a title="Reverse jump to listing" href="#rev:a-ERBook::Document::Node-navigation">&equiv;</a><a title="Jump to previous segment" href="#a-ERBook::Document::Node-number_link">&#x25B3;</a><a title="Jump to next segment" href="#a-ERBook::Document::Node::navigation-here_frag-list_frag-prev_frag-next_frag">&#x25BD;</a><a title="Jump to this segment" href="#a-ERBook::Document::Node-navigation">&#x25CE;</a></div> + <p class="title"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Document</span>::<span style="color:#036;font-weight:bold">Node</span><span style="color:#666">#navigation()</span></code></p> <div class="content"><p> +Returns a navigation menu relative to this node. +</p></div> +</div><div class="paragraph"> + <a name="a-ERBook::Document::Node::navigation-here_frag-list_frag-prev_frag-next_frag"/><div class="nav" id="a-ERBook::Document::Node::navigation-here_frag-list_frag-prev_frag-next_frag"><a title="Reverse jump to listing" href="#rev:a-ERBook::Document::Node::navigation-here_frag-list_frag-prev_frag-next_frag">&equiv;</a><a title="Jump to previous segment" href="#a-ERBook::Document::Node-navigation">&#x25B3;</a><a title="Jump to next segment" href="#a-ERBook::Document::Node-xref_link-label-nil">&#x25BD;</a><a title="Jump to this segment" href="#a-ERBook::Document::Node::navigation-here_frag-list_frag-prev_frag-next_frag">&#x25CE;</a></div> + <p class="title"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Document</span>::<span style="color:#036;font-weight:bold">Node</span>::navigation(here_frag, list_frag, prev_frag, next_frag)</code></p> + <div class="content"><p> +Calculates a local navigation menu containing links to the given URI +fragments (which can be nil). +</p></div> +</div><div class="paragraph"> + <a name="a-ERBook::Document::Node-xref_link-label-nil"/><div class="nav" id="a-ERBook::Document::Node-xref_link-label-nil"><a title="Reverse jump to listing" href="#rev:a-ERBook::Document::Node-xref_link-label-nil">&equiv;</a><a title="Jump to previous segment" href="#a-ERBook::Document::Node::navigation-here_frag-list_frag-prev_frag-next_frag">&#x25B3;</a><a title="Jump to next segment" href="#a-Hash-to_xml_atts">&#x25BD;</a><a title="Jump to this segment" href="#a-ERBook::Document::Node-xref_link-label-nil">&#x25CE;</a></div> + <p class="title"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Document</span>::<span style="color:#036;font-weight:bold">Node</span><span style="color:#666">#xref_link(label = nil)</span></code></p> + <div class="content"><p> +Returns a hyperlink to this node. +</p><p> +@param [String] label +</p> +<p><pre> Optional label (may contain XHTML) for the hyperlink. + + If not specified, the title and designation of + this node will be used as the label instead.</pre></p></div> +</div><div class="paragraph"> + <a name="a-Hash-to_xml_atts"/><div class="nav" id="a-Hash-to_xml_atts"><a title="Reverse jump to listing" href="#rev:a-Hash-to_xml_atts">&equiv;</a><a title="Jump to previous segment" href="#a-ERBook::Document::Node-xref_link-label-nil">&#x25B3;</a><a title="Jump to next segment" href="#a-ERBook::Template-verbatim-content">&#x25BD;</a><a title="Jump to this segment" href="#a-Hash-to_xml_atts">&#x25CE;</a></div> + <p class="title"><code class="code"><span style="color:#036;font-weight:bold">Hash</span><span style="color:#666">#to_xml_atts()</span></code></p> + <div class="content"><p> Transforms this hash into a string of XML attribute key=&quot;value&quot; pairs. </p></div> -</div><div class="section"> - <h4 class="title"> - <a class="list" title="Return to table of contents" id="a-ERBook::Template-verbatim-aContent" href="#rev:a-ERBook::Template-verbatim-aContent">5.1.3.9</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#a-ERBook::Template-verbatim-aContent"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Template</span><span style="color:#666">#verbatim(aContent)</span></code></a> - </h4> +</div><div class="paragraph"> + <a name="a-ERBook::Template-verbatim-content"/><div class="nav" id="a-ERBook::Template-verbatim-content"><a title="Reverse jump to listing" href="#rev:a-ERBook::Template-verbatim-content">&equiv;</a><a title="Jump to previous segment" href="#a-Hash-to_xml_atts">&#x25B3;</a><a title="Jump to next segment" href="#a-ERBook::Template-hyperlink-url-label-url-title-nil">&#x25BD;</a><a title="Jump to this segment" href="#a-ERBook::Template-verbatim-content">&#x25CE;</a></div> + <p class="title"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Template</span><span style="color:#666">#verbatim(content)</span></code></p> <div class="content"><p> Protects the given content from the text-to-XHTML conversion process. </p></div> -</div><div class="section"> - <h4 class="title"> - <a class="list" title="Return to table of contents" id="a-ERBook::Template-hyperlink-aUrl-aLabel-aUrl-aTitle-nil" href="#rev:a-ERBook::Template-hyperlink-aUrl-aLabel-aUrl-aTitle-nil">5.1.3.10</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#a-ERBook::Template-hyperlink-aUrl-aLabel-aUrl-aTitle-nil"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Template</span><span style="color:#666">#hyperlink(aUrl, aLabel = aUrl, aTitle = nil)</span></code></a> - </h4> +</div><div class="paragraph"> + <a name="a-ERBook::Template-hyperlink-url-label-url-title-nil"/><div class="nav" id="a-ERBook::Template-hyperlink-url-label-url-title-nil"><a title="Reverse jump to listing" href="#rev:a-ERBook::Template-hyperlink-url-label-url-title-nil">&equiv;</a><a title="Jump to previous segment" href="#a-ERBook::Template-verbatim-content">&#x25B3;</a><a title="Jump to next segment" href="#a-ERBook::Template-embed_image_file-path-format-path-w-atts">&#x25BD;</a><a title="Jump to this segment" href="#a-ERBook::Template-hyperlink-url-label-url-title-nil">&#x25CE;</a></div> + <p class="title"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Template</span><span style="color:#666">#hyperlink(url, label = url, title = nil)</span></code></p> <div class="content"><p> Returns XHTML for a hyperlink to the given URL of the given label and mouse-hover title. </p></div> -</div><div class="section"> - <h4 class="title"> - <a class="list" title="Return to table of contents" id="a-ERBook::Template-embed_image_file-aPath-aFormat-aPath-w-aAtts" href="#rev:a-ERBook::Template-embed_image_file-aPath-aFormat-aPath-w-aAtts">5.1.3.11</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#a-ERBook::Template-embed_image_file-aPath-aFormat-aPath-w-aAtts"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Template</span><span style="color:#666">#embed_image_file(aPath, aFormat = aPath[/\w+/], aAtts = {})</span></code></a> - </h4> +</div><div class="paragraph"> + <a name="a-ERBook::Template-embed_image_file-path-format-path-w-atts"/><div class="nav" id="a-ERBook::Template-embed_image_file-path-format-path-w-atts"><a title="Reverse jump to listing" href="#rev:a-ERBook::Template-embed_image_file-path-format-path-w-atts">&equiv;</a><a title="Jump to previous segment" href="#a-ERBook::Template-hyperlink-url-label-url-title-nil">&#x25B3;</a><a title="Jump to next segment" href="#a-ERBook::Template-embed_image_data-data-format-atts">&#x25BD;</a><a title="Jump to this segment" href="#a-ERBook::Template-embed_image_file-path-format-path-w-atts">&#x25CE;</a></div> + <p class="title"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Template</span><span style="color:#666">#embed_image_file(path, format = path[/\w+/], atts = {})</span></code></p> <div class="content"><p> Returns an &lt;img/&gt; tag that embeds the given image file. </p><table border="1"> -<tr><td valign='top'>aPath:</td><td>path to the image file +<tr><td valign='top'>path:</td><td>path to the image file </td></tr> -<tr><td valign='top'>aFormat:</td><td>format of the image file (e.g. PNG, JPEG, GIF, etc.) +<tr><td valign='top'>format:</td><td>format of the image file (e.g. PNG, JPEG, GIF, etc.) </td></tr> -<tr><td valign='top'>aAtts:</td><td>additional attributes for the &lt;img&gt; tag +<tr><td valign='top'>atts:</td><td>additional attributes for the &lt;img&gt; tag </td></tr> </table></div> -</div><div class="section"> - <h4 class="title"> - <a class="list" title="Return to table of contents" id="a-ERBook::Template-embed_image_data-aData-aFormat-aAtts" href="#rev:a-ERBook::Template-embed_image_data-aData-aFormat-aAtts">5.1.3.12</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#a-ERBook::Template-embed_image_data-aData-aFormat-aAtts"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Template</span><span style="color:#666">#embed_image_data(aData, aFormat, aAtts = {})</span></code></a> - </h4> +</div><div class="paragraph"> + <a name="a-ERBook::Template-embed_image_data-data-format-atts"/><div class="nav" id="a-ERBook::Template-embed_image_data-data-format-atts"><a title="Reverse jump to listing" href="#rev:a-ERBook::Template-embed_image_data-data-format-atts">&equiv;</a><a title="Jump to previous segment" href="#a-ERBook::Template-embed_image_file-path-format-path-w-atts">&#x25B3;</a><a title="Jump to next segment" href="#a-String-to_xml_entities">&#x25BD;</a><a title="Jump to this segment" href="#a-ERBook::Template-embed_image_data-data-format-atts">&#x25CE;</a></div> + <p class="title"><code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Template</span><span style="color:#666">#embed_image_data(data, format, atts = {})</span></code></p> <div class="content"><p> Returns an &lt;img/&gt; tag that embeds the given raw image data. </p><table border="1"> -<tr><td valign='top'>aData:</td><td>raw image data +<tr><td valign='top'>data:</td><td>raw image data </td></tr> -<tr><td valign='top'>aFormat:</td><td>format of the image file (e.g. PNG, JPEG, GIF, etc.) +<tr><td valign='top'>format:</td><td>format of the image file (e.g. PNG, JPEG, GIF, etc.) </td></tr> -<tr><td valign='top'>aAtts:</td><td>additional attributes for the &lt;img&gt; tag +<tr><td valign='top'>atts:</td><td>additional attributes for the &lt;img&gt; tag </td></tr> </table></div> -</div><div class="section"> - <h4 class="title"> - <a class="list" title="Return to table of contents" id="a-String-to_xml_entities" href="#rev:a-String-to_xml_entities">5.1.3.13</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#a-String-to_xml_entities"><code class="code"><span style="color:#036;font-weight:bold">String</span><span style="color:#666">#to_xml_entities()</span></code></a> - </h4> +</div><div class="paragraph"> + <a name="a-String-to_xml_entities"/><div class="nav" id="a-String-to_xml_entities"><a title="Reverse jump to listing" href="#rev:a-String-to_xml_entities">&equiv;</a><a title="Jump to previous segment" href="#a-ERBook::Template-embed_image_data-data-format-atts">&#x25B3;</a><a title="Jump to next segment" href="#a-String-to_uri_fragment">&#x25BD;</a><a title="Jump to this segment" href="#a-String-to_xml_entities">&#x25CE;</a></div> + <p class="title"><code class="code"><span style="color:#036;font-weight:bold">String</span><span style="color:#666">#to_xml_entities()</span></code></p> <div class="content"><p> Transforms this UTF-8 string into XML entities. </p></div> -</div><div class="section"> - <h4 class="title"> - <a class="list" title="Return to table of contents" id="a-String-to_uri_fragment" href="#rev:a-String-to_uri_fragment">5.1.3.14</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#a-String-to_uri_fragment"><code class="code"><span style="color:#036;font-weight:bold">String</span><span style="color:#666">#to_uri_fragment()</span></code></a> - </h4> +</div><div class="paragraph"> + <a name="a-String-to_uri_fragment"/><div class="nav" id="a-String-to_uri_fragment"><a title="Reverse jump to listing" href="#rev:a-String-to_uri_fragment">&equiv;</a><a title="Jump to previous segment" href="#a-String-to_xml_entities">&#x25B3;</a><a title="Jump to next segment" href="#a-String-to_inline_xhtml">&#x25BD;</a><a title="Jump to this segment" href="#a-String-to_uri_fragment">&#x25CE;</a></div> + <p class="title"><code class="code"><span style="color:#036;font-weight:bold">String</span><span style="color:#666">#to_uri_fragment()</span></code></p> <div class="content"><p> Transforms this string into a valid URI fragment. See <a href='http://www.nmt.edu/tcc/help/pubs/xhtml/id-type.html'>www.nmt.edu/tcc/help/pubs/xhtml/id-type.html</a> </p></div> -</div><div class="section"> - <h4 class="title"> - <a class="list" title="Return to table of contents" id="a-String-to_inline_xhtml" href="#rev:a-String-to_inline_xhtml">5.1.3.15</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#a-String-to_inline_xhtml"><code class="code"><span style="color:#036;font-weight:bold">String</span><span style="color:#666">#to_inline_xhtml()</span></code></a> - </h4> +</div><div class="paragraph"> + <a name="a-String-to_inline_xhtml"/><div class="nav" id="a-String-to_inline_xhtml"><a title="Reverse jump to listing" href="#rev:a-String-to_inline_xhtml">&equiv;</a><a title="Jump to previous segment" href="#a-String-to_uri_fragment">&#x25B3;</a><a title="Jump to next segment" href="#a-String-to_xhtml-inline-false">&#x25BD;</a><a title="Jump to this segment" href="#a-String-to_inline_xhtml">&#x25CE;</a></div> + <p class="title"><code class="code"><span style="color:#036;font-weight:bold">String</span><span style="color:#666">#to_inline_xhtml()</span></code></p> <div class="content"><p> Transforms this string into an <b>inline</b> XHTML string (one that does not contain any block-level XHTML elements at the root). </p></div> -</div><div class="section"> - <h4 class="title"> - <a class="list" title="Return to table of contents" id="a-String-to_xhtml-aInline-false" href="#rev:a-String-to_xhtml-aInline-false">5.1.3.16</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#a-String-to_xhtml-aInline-false"><code class="code"><span style="color:#036;font-weight:bold">String</span><span style="color:#666">#to_xhtml(aInline = false)</span></code></a> - </h4> +</div><div class="paragraph"> + <a name="a-String-to_xhtml-inline-false"/><div class="nav" id="a-String-to_xhtml-inline-false"><a title="Reverse jump to listing" href="#rev:a-String-to_xhtml-inline-false">&equiv;</a><a title="Jump to previous segment" href="#a-String-to_inline_xhtml">&#x25B3;</a><a title="Jump to next segment" href="#xhtml.nodes">&#x25BD;</a><a title="Jump to this segment" href="#a-String-to_xhtml-inline-false">&#x25CE;</a></div> + <p class="title"><code class="code"><span style="color:#036;font-weight:bold">String</span><span style="color:#666">#to_xhtml(inline = false)</span></code></p> <div class="content"><p> Transforms this string into XHTML while ensuring that the result contains one or more block-level elements at the root. -</p><p> -If aInline is true, then the resulting XHTML will be an <b>inline</b> -string. -</p></div> +</p><table border="1"> +<tr><td valign='top'>inline:</td><td>If true, the resulting XHTML will <b>not</b> contain a block-level element +at the root. + +</td></tr> +</table></div> </div></p></div> </div> <div class="chapter"> + <a name="xhtml.nodes"/><div class="nav" id="xhtml.nodes"><a title="Reverse jump to listing" href="#rev:xhtml.nodes">&equiv;</a><a title="Jump to previous segment" href="#a-String-to_xhtml-inline-false">&#x25B3;</a><a title="Jump to next segment" href="#Structural-nodes">&#x25BD;</a><a title="Jump to this segment" href="#xhtml.nodes">&#x25CE;</a></div> <h1 class="title"> - Chapter&nbsp;<a class="list" title="Return to table of contents" id="xhtml.nodes" href="#rev:xhtml.nodes">5.1.4</a> + Chapter&nbsp;5.1.4 <br/> - <big><a class="here" title="Permanent link to this section" href="#xhtml.nodes">Nodes</a></big> + <big>Nodes</big> </h1> <div class="content"><p>Unless otherwise noted, all nodes defined by the XHTML format accept two arguments, in this order:</p> <ol> <li>a required <em>title</em> for the node</li> @@ -1941,33 +1953,38 @@ <p>Furthermore, <a class="xref" href="#SpecFile.nodes" title="Section 3.2.1. Node definition">node definitions</a> in the XHTML format have two additional parameters:</p> <table border="1"><thead><tr><th>Parameter</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td style='text-align: left;'>toc</td><td style='text-align: left;'>Boolean</td><td style='text-align: left;'>Include this node in the <strong>Table of Contents</strong> (TOC)?</td> </tr><tr><td style='text-align: left;'>lof</td><td style='text-align: left;'>Boolean</td><td style='text-align: left;'>Include this node in the <strong>List of Figures</strong> (LOF)?</td> </tr></tbody></table> <p><div class="section"> + <a name="Structural-nodes"/><div class="nav" id="Structural-nodes"><a title="Reverse jump to listing" href="#rev:Structural-nodes">&equiv;</a><a title="Jump to previous segment" href="#xhtml.nodes">&#x25B3;</a><a title="Jump to next segment" href="#xhtml.nodes.header">&#x25BD;</a><a title="Jump to this segment" href="#Structural-nodes">&#x25CE;</a></div> <h4 class="title"> - <a class="list" title="Return to table of contents" id="Structural-nodes" href="#rev:Structural-nodes">5.1.4.1</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#Structural-nodes">Structural nodes</a> + 5.1.4.1&nbsp;&nbsp;Structural nodes </h4> <div class="content"><p>The nodes described in this section form the overall structure of the output document.</p> <p><div class="section"> + <a name="xhtml.nodes.header"/><div class="nav" id="xhtml.nodes.header"><a title="Reverse jump to listing" href="#rev:xhtml.nodes.header">&equiv;</a><a title="Jump to previous segment" href="#Structural-nodes">&#x25B3;</a><a title="Jump to next segment" href="#xhtml.nodes.footer">&#x25BD;</a><a title="Jump to this segment" href="#xhtml.nodes.header">&#x25CE;</a></div> <h5 class="title"> - <a class="list" title="Return to table of contents" id="xhtml.nodes.header" href="#rev:xhtml.nodes.header">5.1.4.1.1</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#xhtml.nodes.header">header</a> + 5.1.4.1.1&nbsp;&nbsp;header </h5> <div class="content"><p>This node overrides the logo, title, list of authors, and date when the document was written, all of which are shown at the top of the document.</p></div> </div> <div class="section"> + <a name="xhtml.nodes.footer"/><div class="nav" id="xhtml.nodes.footer"><a title="Reverse jump to listing" href="#rev:xhtml.nodes.footer">&equiv;</a><a title="Jump to previous segment" href="#xhtml.nodes.header">&#x25B3;</a><a title="Jump to next segment" href="#xhtml.nodes.abstract">&#x25BD;</a><a title="Jump to this segment" href="#xhtml.nodes.footer">&#x25CE;</a></div> <h5 class="title"> - <a class="list" title="Return to table of contents" id="xhtml.nodes.footer" href="#rev:xhtml.nodes.footer">5.1.4.1.2</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#xhtml.nodes.footer">footer</a> + 5.1.4.1.2&nbsp;&nbsp;footer </h5> - <div class="content"><p>This node overrides (1) the date when this document was generated and (2) the hyperlink to the erbook website, shown at the bottom of the document. The hyperlink is there as a way of saying thanks for erbook, the <em>wonderful</em> little utility you have grown so fond of! ;-)</p></div> + <div class="content"><p>This node overrides (1) the date when this document was generated and (2) the hyperlink to the ERBook website, shown at the bottom of the document. The hyperlink is there as a way of saying thanks for ERBook, the <em>wonderful</em> little utility you have grown so fond of! ;-)</p></div> </div> <div class="section"> + <a name="xhtml.nodes.abstract"/><div class="nav" id="xhtml.nodes.abstract"><a title="Reverse jump to listing" href="#rev:xhtml.nodes.abstract">&equiv;</a><a title="Jump to previous segment" href="#xhtml.nodes.footer">&#x25B3;</a><a title="Jump to next segment" href="#xhtml.nodes.xref">&#x25BD;</a><a title="Jump to this segment" href="#xhtml.nodes.abstract">&#x25CE;</a></div> <h5 class="title"> - <a class="list" title="Return to table of contents" id="xhtml.nodes.abstract" href="#rev:xhtml.nodes.abstract">5.1.4.1.3</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#xhtml.nodes.abstract">abstract</a> + 5.1.4.1.3&nbsp;&nbsp;abstract </h5> <div class="content"><p>A summary of the entire document. This is what most readers will <em>skim</em> through, if you are lucky. Alas, nobody reads entire documents these days! :-(</p></div> </div> <div class="section"> + <a name="xhtml.nodes.xref"/><div class="nav" id="xhtml.nodes.xref"><a title="Reverse jump to listing" href="#rev:xhtml.nodes.xref">&equiv;</a><a title="Jump to previous segment" href="#xhtml.nodes.abstract">&#x25B3;</a><a title="Jump to next segment" href="#Organizational-nodes">&#x25BD;</a><a title="Jump to this segment" href="#xhtml.nodes.xref">&#x25CE;</a></div> <h5 class="title"> - <a class="list" title="Return to table of contents" id="xhtml.nodes.xref" href="#rev:xhtml.nodes.xref">5.1.4.1.4</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#xhtml.nodes.xref">xref</a> + 5.1.4.1.4&nbsp;&nbsp;xref </h5> <div class="content"><p>A cross-reference; a hyperlink that takes you to any node in the document.</p> <p>The first argument of this node is either the unique identifier or the user-defined title of the node you wish to cross-reference. If no nodes in the document have the given identifier or user-defined title, then an error will be raised.</p> @@ -1984,207 +2001,267 @@ <pre>&lt;%= xref &quot;SpecFile&quot;, &quot;custom link text&quot; %&gt;</pre> <p>appears in the output document like this: <a class="xref" href="#SpecFile" title="Section 3.2. Format specification file">custom link text</a>.</p></div> </div></p></div> </div> <div class="section"> + <a name="Organizational-nodes"/><div class="nav" id="Organizational-nodes"><a title="Reverse jump to listing" href="#rev:Organizational-nodes">&equiv;</a><a title="Jump to previous segment" href="#xhtml.nodes.xref">&#x25B3;</a><a title="Jump to next segment" href="#xhtml.nodes.node">&#x25BD;</a><a title="Jump to this segment" href="#Organizational-nodes">&#x25CE;</a></div> <h4 class="title"> - <a class="list" title="Return to table of contents" id="Organizational-nodes" href="#rev:Organizational-nodes">5.1.4.2</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#Organizational-nodes">Organizational nodes</a> + 5.1.4.2&nbsp;&nbsp;Organizational nodes </h4> <div class="content"><p>The nodes described in this section are meant to help organize the document&#8217;s content logically. Based on how deeply these nodes are nested in the document, their heading will be larger (shallow depth) or smaller (deep depth).</p> <p><div class="section"> + <a name="xhtml.nodes.node"/><div class="nav" id="xhtml.nodes.node"><a title="Reverse jump to listing" href="#rev:xhtml.nodes.node">&equiv;</a><a title="Jump to previous segment" href="#Organizational-nodes">&#x25B3;</a><a title="Jump to next segment" href="#xhtml.nodes.part">&#x25BD;</a><a title="Jump to this segment" href="#xhtml.nodes.node">&#x25CE;</a></div> <h5 class="title"> - <a class="list" title="Return to table of contents" id="xhtml.nodes.part" href="#rev:xhtml.nodes.part">5.1.4.2.1</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#xhtml.nodes.part">part</a> + 5.1.4.2.1&nbsp;&nbsp;node </h5> + <div class="content"><p>A placeholder that simply passes its content to the output.</p> + +<p>This node has no real use in the writing of a document. It mainly helps programmers define &#8220;virtual&#8221; nodes that simply wrap some user-provided content. Programmers can then manipluate the content of those virtual nodes when processing the document.</p> + +<p><p>This is how a <strong>node</strong> node appears.</p></p></div> +</div> <div class="section"> + <a name="xhtml.nodes.part"/><div class="nav" id="xhtml.nodes.part"><a title="Reverse jump to listing" href="#rev:xhtml.nodes.part">&equiv;</a><a title="Jump to previous segment" href="#xhtml.nodes.node">&#x25B3;</a><a title="Jump to next segment" href="#An-example">&#x25BD;</a><a title="Jump to this segment" href="#xhtml.nodes.part">&#x25CE;</a></div> + <h5 class="title"> + 5.1.4.2.2&nbsp;&nbsp;part + </h5> <div class="content"><p>A collection of chapters.</p> <p><div class="part"> + <a name="An-example"/><div class="nav" id="An-example"><a title="Reverse jump to listing" href="#rev:An-example">&equiv;</a><a title="Jump to previous segment" href="#xhtml.nodes.part">&#x25B3;</a><a title="Jump to next segment" href="#xhtml.nodes.chapter">&#x25BD;</a><a title="Jump to this segment" href="#An-example">&#x25CE;</a></div> <h1 class="title"> - Part&nbsp;<a class="list" title="Return to table of contents" id="An-example" href="#rev:An-example">5.1.4.2.1.1</a> + Part&nbsp;5.1.4.2.2.1 <br/> - <big><a class="here" title="Permanent link to this section" href="#An-example">An example</a></big> + <big>An example</big> </h1> <div class="content"><p>This is how a <strong>part</strong> node appears.</p></div> </div></p></div> </div> <div class="section"> + <a name="xhtml.nodes.chapter"/><div class="nav" id="xhtml.nodes.chapter"><a title="Reverse jump to listing" href="#rev:xhtml.nodes.chapter">&equiv;</a><a title="Jump to previous segment" href="#An-example">&#x25B3;</a><a title="Jump to next segment" href="#An-example-5.1.4.2.3.1">&#x25BD;</a><a title="Jump to this segment" href="#xhtml.nodes.chapter">&#x25CE;</a></div> <h5 class="title"> - <a class="list" title="Return to table of contents" id="xhtml.nodes.chapter" href="#rev:xhtml.nodes.chapter">5.1.4.2.2</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#xhtml.nodes.chapter">chapter</a> + 5.1.4.2.3&nbsp;&nbsp;chapter </h5> <div class="content"><p>A collection of sections.</p> <p><div class="chapter"> + <a name="An-example-5.1.4.2.3.1"/><div class="nav" id="An-example-5.1.4.2.3.1"><a title="Reverse jump to listing" href="#rev:An-example-5.1.4.2.3.1">&equiv;</a><a title="Jump to previous segment" href="#xhtml.nodes.chapter">&#x25B3;</a><a title="Jump to next segment" href="#xhtml.nodes.section">&#x25BD;</a><a title="Jump to this segment" href="#An-example-5.1.4.2.3.1">&#x25CE;</a></div> <h1 class="title"> - Chapter&nbsp;<a class="list" title="Return to table of contents" id="An-example-5.1.4.2.2.1" href="#rev:An-example-5.1.4.2.2.1">5.1.4.2.2.1</a> + Chapter&nbsp;5.1.4.2.3.1 <br/> - <big><a class="here" title="Permanent link to this section" href="#An-example-5.1.4.2.2.1">An example</a></big> + <big>An example</big> </h1> <div class="content"><p>This is how a <strong>chapter</strong> node appears.</p></div> </div></p></div> </div> <div class="section"> + <a name="xhtml.nodes.section"/><div class="nav" id="xhtml.nodes.section"><a title="Reverse jump to listing" href="#rev:xhtml.nodes.section">&equiv;</a><a title="Jump to previous segment" href="#An-example-5.1.4.2.3.1">&#x25B3;</a><a title="Jump to next segment" href="#An-example-5.1.4.2.4.1">&#x25BD;</a><a title="Jump to this segment" href="#xhtml.nodes.section">&#x25CE;</a></div> <h5 class="title"> - <a class="list" title="Return to table of contents" id="xhtml.nodes.section" href="#rev:xhtml.nodes.section">5.1.4.2.3</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#xhtml.nodes.section">section</a> + 5.1.4.2.4&nbsp;&nbsp;section </h5> <div class="content"><p>A collection of paragraphs about a particular topic.</p> <p><div class="section"> + <a name="An-example-5.1.4.2.4.1"/><div class="nav" id="An-example-5.1.4.2.4.1"><a title="Reverse jump to listing" href="#rev:An-example-5.1.4.2.4.1">&equiv;</a><a title="Jump to previous segment" href="#xhtml.nodes.section">&#x25B3;</a><a title="Jump to next segment" href="#xhtml.nodes.paragraph">&#x25BD;</a><a title="Jump to this segment" href="#An-example-5.1.4.2.4.1">&#x25CE;</a></div> <h6 class="title"> - <a class="list" title="Return to table of contents" id="An-example-5.1.4.2.3.1" href="#rev:An-example-5.1.4.2.3.1">5.1.4.2.3.1</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#An-example-5.1.4.2.3.1">An example</a> + 5.1.4.2.4.1&nbsp;&nbsp;An example </h6> <div class="content"><p>This is how a <strong>section</strong> node appears.</p></div> </div></p></div> </div> <div class="section"> + <a name="xhtml.nodes.paragraph"/><div class="nav" id="xhtml.nodes.paragraph"><a title="Reverse jump to listing" href="#rev:xhtml.nodes.paragraph">&equiv;</a><a title="Jump to previous segment" href="#An-example-5.1.4.2.4.1">&#x25B3;</a><a title="Jump to next segment" href="#An-example-608866148">&#x25BD;</a><a title="Jump to this segment" href="#xhtml.nodes.paragraph">&#x25CE;</a></div> <h5 class="title"> - <a class="list" title="Return to table of contents" id="xhtml.nodes.paragraph" href="#rev:xhtml.nodes.paragraph">5.1.4.2.4</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#xhtml.nodes.paragraph">paragraph</a> + 5.1.4.2.5&nbsp;&nbsp;paragraph </h5> <div class="content"><p>A collection of sentences about a particular idea.</p> <p><div class="paragraph"> - <p class="title"><a class="here" title="Permanent link to this section" href="#An-example-609202208">An example</a></p> + <a name="An-example-608866148"/><div class="nav" id="An-example-608866148"><a title="Reverse jump to listing" href="#rev:An-example-608866148">&equiv;</a><a title="Jump to previous segment" href="#xhtml.nodes.paragraph">&#x25B3;</a><a title="Jump to next segment" href="#Admonition-nodes">&#x25BD;</a><a title="Jump to this segment" href="#An-example-608866148">&#x25CE;</a></div> + <p class="title">An example</p> <div class="content"><p>This is how a <strong>paragraph</strong> node appears. Notice that there is no LaTeX-style index number in the heading of this <strong>paragraph</strong> node.</p></div> </div></p></div> </div></p></div> </div> <div class="section"> + <a name="Admonition-nodes"/><div class="nav" id="Admonition-nodes"><a title="Reverse jump to listing" href="#rev:Admonition-nodes">&equiv;</a><a title="Jump to previous segment" href="#An-example-608866148">&#x25B3;</a><a title="Jump to next segment" href="#xhtml.nodes.warning">&#x25BD;</a><a title="Jump to this segment" href="#Admonition-nodes">&#x25CE;</a></div> <h4 class="title"> - <a class="list" title="Return to table of contents" id="Admonition-nodes" href="#rev:Admonition-nodes">5.1.4.3</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#Admonition-nodes">Admonition nodes</a> + 5.1.4.3&nbsp;&nbsp;Admonition nodes </h4> <div class="content"><p>An admonition is basically a box that is indented more deeply than the text surrounding it. It is typically used to convey extraneous or pertinent information about the application of ideas discussed in the surrounding text.</p> <p>I like to follow the KDE guidelines<sup>[<a class="cite" href="#KDE.admonitions">1</a>]</sup> when determining which admonition to use in my documents.</p> <p> <div class="section"> + <a name="xhtml.nodes.warning"/><div class="nav" id="xhtml.nodes.warning"><a title="Reverse jump to listing" href="#rev:xhtml.nodes.warning">&equiv;</a><a title="Jump to previous segment" href="#Admonition-nodes">&#x25B3;</a><a title="Jump to next segment" href="#An-example-1">&#x25BD;</a><a title="Jump to this segment" href="#xhtml.nodes.warning">&#x25CE;</a></div> <h5 class="title"> - <a class="list" title="Return to table of contents" id="xhtml.nodes.warning" href="#rev:xhtml.nodes.warning">5.1.4.3.1</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#xhtml.nodes.warning">warning</a> + 5.1.4.3.1&nbsp;&nbsp;warning </h5> <div class="content"><p>Use a <strong>warning</strong> node when &#8220;data loss could occur if you follow the procedure being described.&#8221; <sup>[<a class="cite" href="#KDE.admonitions">1</a>]</sup></p> <p><div class="warning"> - <p class="title"><a class="list" title="Return to table of contents" id="An-example-1" href="#rev:An-example-1">Warning 1</a>.&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#An-example-1">An example</a></p> - <div class="content"><img class="icon" src="&icon_warning;" alt="warning"/><p>This is how a <strong>warning</strong> node appears.</p></div> + <a name="An-example-1"/><div class="nav" id="An-example-1"><a title="Reverse jump to listing" href="#rev:An-example-1">&equiv;</a><a title="Jump to previous segment" href="#xhtml.nodes.warning">&#x25B3;</a><a title="Jump to next segment" href="#xhtml.nodes.caution">&#x25BD;</a><a title="Jump to this segment" href="#An-example-1">&#x25CE;</a></div> + <p class="title">Warning 1.&nbsp;&nbsp;An example</p> + <div class="content"> + <img class="icon" src="&icon_warning;" alt="warning"/> + <p>This is how a <strong>warning</strong> node appears.</p> + </div> </div></p></div> </div> <div class="section"> + <a name="xhtml.nodes.caution"/><div class="nav" id="xhtml.nodes.caution"><a title="Reverse jump to listing" href="#rev:xhtml.nodes.caution">&equiv;</a><a title="Jump to previous segment" href="#An-example-1">&#x25B3;</a><a title="Jump to next segment" href="#An-example-1-1">&#x25BD;</a><a title="Jump to this segment" href="#xhtml.nodes.caution">&#x25CE;</a></div> <h5 class="title"> - <a class="list" title="Return to table of contents" id="xhtml.nodes.caution" href="#rev:xhtml.nodes.caution">5.1.4.3.2</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#xhtml.nodes.caution">caution</a> + 5.1.4.3.2&nbsp;&nbsp;caution </h5> <div class="content"><p>bq. A note of caution. Use this for example when the reader may lose easily recovered or replaceable information (e.g. user settings), or when they could cause data loss if they don&#8217;t correctly follow the procedure being outlined. <sup>[<a class="cite" href="#KDE.admonitions">1</a>]</sup></p> <p><div class="caution"> - <p class="title"><a class="list" title="Return to table of contents" id="An-example-1-1" href="#rev:An-example-1-1">Caution 1</a>.&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#An-example-1-1">An example</a></p> - <div class="content"><img class="icon" src="&icon_caution;" alt="caution"/><p>This is how a <strong>caution</strong> node appears.</p></div> + <a name="An-example-1-1"/><div class="nav" id="An-example-1-1"><a title="Reverse jump to listing" href="#rev:An-example-1-1">&equiv;</a><a title="Jump to previous segment" href="#xhtml.nodes.caution">&#x25B3;</a><a title="Jump to next segment" href="#xhtml.nodes.important">&#x25BD;</a><a title="Jump to this segment" href="#An-example-1-1">&#x25CE;</a></div> + <p class="title">Caution 1.&nbsp;&nbsp;An example</p> + <div class="content"> + <img class="icon" src="&icon_caution;" alt="caution"/> + <p>This is how a <strong>caution</strong> node appears.</p> + </div> </div></p></div> </div> <div class="section"> + <a name="xhtml.nodes.important"/><div class="nav" id="xhtml.nodes.important"><a title="Reverse jump to listing" href="#rev:xhtml.nodes.important">&equiv;</a><a title="Jump to previous segment" href="#An-example-1-1">&#x25B3;</a><a title="Jump to next segment" href="#An-example-2">&#x25BD;</a><a title="Jump to this segment" href="#xhtml.nodes.important">&#x25CE;</a></div> <h5 class="title"> - <a class="list" title="Return to table of contents" id="xhtml.nodes.important" href="#rev:xhtml.nodes.important">5.1.4.3.3</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#xhtml.nodes.important">important</a> + 5.1.4.3.3&nbsp;&nbsp;important </h5> <div class="content"><p>Use an <strong>important</strong> node when:</p> <p>bq. When there is no danger of data loss, but you wish to make clear to the reader a consequence that isn&#8217;t immediately obvious (e.g. when changing the font for one instance of a program also changes the default setting, and this isn&#8217;t clear from the GUI.) <sup>[<a class="cite" href="#KDE.admonitions">1</a>]</sup></p> <p><div class="important"> - <p class="title"><a class="list" title="Return to table of contents" id="An-example-2" href="#rev:An-example-2">Important 2</a>.&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#An-example-2">An example</a></p> - <div class="content"><img class="icon" src="&icon_important;" alt="important"/><p>This is how a <strong>important</strong> node appears.</p></div> + <a name="An-example-2"/><div class="nav" id="An-example-2"><a title="Reverse jump to listing" href="#rev:An-example-2">&equiv;</a><a title="Jump to previous segment" href="#xhtml.nodes.important">&#x25B3;</a><a title="Jump to next segment" href="#xhtml.nodes.note">&#x25BD;</a><a title="Jump to this segment" href="#An-example-2">&#x25CE;</a></div> + <p class="title">Important 2.&nbsp;&nbsp;An example</p> + <div class="content"> + <img class="icon" src="&icon_important;" alt="important"/> + <p>This is how a <strong>important</strong> node appears.</p> + </div> </div></p></div> </div> <div class="section"> + <a name="xhtml.nodes.note"/><div class="nav" id="xhtml.nodes.note"><a title="Reverse jump to listing" href="#rev:xhtml.nodes.note">&equiv;</a><a title="Jump to previous segment" href="#An-example-2">&#x25B3;</a><a title="Jump to next segment" href="#An-example-1-1-1">&#x25BD;</a><a title="Jump to this segment" href="#xhtml.nodes.note">&#x25CE;</a></div> <h5 class="title"> - <a class="list" title="Return to table of contents" id="xhtml.nodes.note" href="#rev:xhtml.nodes.note">5.1.4.3.4</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#xhtml.nodes.note">note</a> + 5.1.4.3.4&nbsp;&nbsp;note </h5> <div class="content"><p>Use a <strong>note</strong> node to convey:</p> <p>bq. Information the user should be aware of, but is peripheral to the actual task being described. <sup>[<a class="cite" href="#KDE.admonitions">1</a>]</sup></p> <p><div class="note"> - <p class="title"><a class="list" title="Return to table of contents" id="An-example-2-2" href="#rev:An-example-2-2">Note 2</a>.&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#An-example-2-2">An example</a></p> - <div class="content"><img class="icon" src="&icon_note;" alt="note"/><p>This is how a <strong>note</strong> node appears.</p></div> + <a name="An-example-1-1-1"/><div class="nav" id="An-example-1-1-1"><a title="Reverse jump to listing" href="#rev:An-example-1-1-1">&equiv;</a><a title="Jump to previous segment" href="#xhtml.nodes.note">&#x25B3;</a><a title="Jump to next segment" href="#xhtml.nodes.tip">&#x25BD;</a><a title="Jump to this segment" href="#An-example-1-1-1">&#x25CE;</a></div> + <p class="title">Note 1.&nbsp;&nbsp;An example</p> + <div class="content"> + <img class="icon" src="&icon_note;" alt="note"/> + <p>This is how a <strong>note</strong> node appears.</p> + </div> </div></p></div> </div> <div class="section"> + <a name="xhtml.nodes.tip"/><div class="nav" id="xhtml.nodes.tip"><a title="Reverse jump to listing" href="#rev:xhtml.nodes.tip">&equiv;</a><a title="Jump to previous segment" href="#An-example-1-1-1">&#x25B3;</a><a title="Jump to next segment" href="#An-example-1-1-1-1">&#x25BD;</a><a title="Jump to this segment" href="#xhtml.nodes.tip">&#x25CE;</a></div> <h5 class="title"> - <a class="list" title="Return to table of contents" id="xhtml.nodes.tip" href="#rev:xhtml.nodes.tip">5.1.4.3.5</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#xhtml.nodes.tip">tip</a> + 5.1.4.3.5&nbsp;&nbsp;tip </h5> <div class="content"><p>Use a <strong>tip</strong> node when:</p> <p>bq. When you&#8217;re giving a hint to make things easier or more productive for the reader. <sup>[<a class="cite" href="#KDE.admonitions">1</a>]</sup></p> <p><div class="tip"> - <p class="title"><a class="list" title="Return to table of contents" id="An-example-1-1-1" href="#rev:An-example-1-1-1">Tip 1</a>.&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#An-example-1-1-1">An example</a></p> - <div class="content"><img class="icon" src="&icon_tip;" alt="tip"/><p>This is how a <strong>tip</strong> node appears.</p></div> + <a name="An-example-1-1-1-1"/><div class="nav" id="An-example-1-1-1-1"><a title="Reverse jump to listing" href="#rev:An-example-1-1-1-1">&equiv;</a><a title="Jump to previous segment" href="#xhtml.nodes.tip">&#x25B3;</a><a title="Jump to next segment" href="#Auxilary-materials">&#x25BD;</a><a title="Jump to this segment" href="#An-example-1-1-1-1">&#x25CE;</a></div> + <p class="title">Tip 1.&nbsp;&nbsp;An example</p> + <div class="content"> + <img class="icon" src="&icon_tip;" alt="tip"/> + <p>This is how a <strong>tip</strong> node appears.</p> + </div> </div></p></div> </div></p></div> </div> <div class="section"> + <a name="Auxilary-materials"/><div class="nav" id="Auxilary-materials"><a title="Reverse jump to listing" href="#rev:Auxilary-materials">&equiv;</a><a title="Jump to previous segment" href="#An-example-1-1-1-1">&#x25B3;</a><a title="Jump to next segment" href="#xhtml.nodes.figure">&#x25BD;</a><a title="Jump to this segment" href="#Auxilary-materials">&#x25CE;</a></div> <h4 class="title"> - <a class="list" title="Return to table of contents" id="Auxilary-materials" href="#rev:Auxilary-materials">5.1.4.4</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#Auxilary-materials">Auxilary materials</a> + 5.1.4.4&nbsp;&nbsp;Auxilary materials </h4> <div class="content"><p><div class="section"> + <a name="xhtml.nodes.figure"/><div class="nav" id="xhtml.nodes.figure"><a title="Reverse jump to listing" href="#rev:xhtml.nodes.figure">&equiv;</a><a title="Jump to previous segment" href="#Auxilary-materials">&#x25B3;</a><a title="Jump to next segment" href="#An-example-1-1-1-1-1">&#x25BD;</a><a title="Jump to this segment" href="#xhtml.nodes.figure">&#x25CE;</a></div> <h5 class="title"> - <a class="list" title="Return to table of contents" id="xhtml.nodes.figure" href="#rev:xhtml.nodes.figure">5.1.4.4.1</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#xhtml.nodes.figure">figure</a> + 5.1.4.4.1&nbsp;&nbsp;figure </h5> <div class="content"><p>A diagram, sketch, image, or illustration; something that visually depicts an idea or thought.</p> <p><div class="figure"> - <p class="title"><a class="list" title="Return to table of contents" id="An-example-1-1-1-1" href="#rev:An-example-1-1-1-1">Figure 1</a>.&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#An-example-1-1-1-1">An example</a></p> + <a name="An-example-1-1-1-1-1"/><div class="nav" id="An-example-1-1-1-1-1"><a title="Reverse jump to listing" href="#rev:An-example-1-1-1-1-1">&equiv;</a><a title="Jump to previous segment" href="#xhtml.nodes.figure">&#x25B3;</a><a title="Jump to next segment" href="#xhtml.nodes.table">&#x25BD;</a><a title="Jump to this segment" href="#An-example-1-1-1-1-1">&#x25CE;</a></div> + <p class="title">Figure 1.&nbsp;&nbsp;An example</p> <div class="content"><p>This is how a <strong>figure</strong> node appears.</p></div> </div></p></div> </div> <div class="section"> + <a name="xhtml.nodes.table"/><div class="nav" id="xhtml.nodes.table"><a title="Reverse jump to listing" href="#rev:xhtml.nodes.table">&equiv;</a><a title="Jump to previous segment" href="#An-example-1-1-1-1-1">&#x25B3;</a><a title="Jump to next segment" href="#An-example-1-1-1-1-1-1">&#x25BD;</a><a title="Jump to this segment" href="#xhtml.nodes.table">&#x25CE;</a></div> <h5 class="title"> - <a class="list" title="Return to table of contents" id="xhtml.nodes.table" href="#rev:xhtml.nodes.table">5.1.4.4.2</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#xhtml.nodes.table">table</a> + 5.1.4.4.2&nbsp;&nbsp;table </h5> <div class="content"><p>Information (typically measurement data) represented in tabular form for easy reading, comparison, and analysis.</p> <p><div class="table"> - <p class="title"><a class="list" title="Return to table of contents" id="An-example-1-1-1-1-1" href="#rev:An-example-1-1-1-1-1">Table 1</a>.&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#An-example-1-1-1-1-1">An example</a></p> + <a name="An-example-1-1-1-1-1-1"/><div class="nav" id="An-example-1-1-1-1-1-1"><a title="Reverse jump to listing" href="#rev:An-example-1-1-1-1-1-1">&equiv;</a><a title="Jump to previous segment" href="#xhtml.nodes.table">&#x25B3;</a><a title="Jump to next segment" href="#xhtml.nodes.example">&#x25BD;</a><a title="Jump to this segment" href="#An-example-1-1-1-1-1-1">&#x25CE;</a></div> + <p class="title">Table 1.&nbsp;&nbsp;An example</p> <div class="content"><p>This is how a <strong>table</strong> node appears.</p></div> </div></p></div> </div> <div class="section"> + <a name="xhtml.nodes.example"/><div class="nav" id="xhtml.nodes.example"><a title="Reverse jump to listing" href="#rev:xhtml.nodes.example">&equiv;</a><a title="Jump to previous segment" href="#An-example-1-1-1-1-1-1">&#x25B3;</a><a title="Jump to next segment" href="#An-example-4">&#x25BD;</a><a title="Jump to this segment" href="#xhtml.nodes.example">&#x25CE;</a></div> <h5 class="title"> - <a class="list" title="Return to table of contents" id="xhtml.nodes.example" href="#rev:xhtml.nodes.example">5.1.4.4.3</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#xhtml.nodes.example">example</a> + 5.1.4.4.3&nbsp;&nbsp;example </h5> <div class="content"><p>A sample application of an idea or thought.</p> <p><div class="example"> - <p class="title"><a class="list" title="Return to table of contents" id="An-example-4" href="#rev:An-example-4">Example 4</a>.&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#An-example-4">An example</a></p> + <a name="An-example-4"/><div class="nav" id="An-example-4"><a title="Reverse jump to listing" href="#rev:An-example-4">&equiv;</a><a title="Jump to previous segment" href="#xhtml.nodes.example">&#x25B3;</a><a title="Jump to next segment" href="#xhtml.nodes.equation">&#x25BD;</a><a title="Jump to this segment" href="#An-example-4">&#x25CE;</a></div> + <p class="title">Example 4.&nbsp;&nbsp;An example</p> <div class="content"><p>This is how a <strong>example</strong> node appears.</p></div> </div></p></div> </div> <div class="section"> + <a name="xhtml.nodes.equation"/><div class="nav" id="xhtml.nodes.equation"><a title="Reverse jump to listing" href="#rev:xhtml.nodes.equation">&equiv;</a><a title="Jump to previous segment" href="#An-example-4">&#x25B3;</a><a title="Jump to next segment" href="#An-example-1-1-1-1-1-1-1">&#x25BD;</a><a title="Jump to this segment" href="#xhtml.nodes.equation">&#x25CE;</a></div> <h5 class="title"> - <a class="list" title="Return to table of contents" id="xhtml.nodes.equation" href="#rev:xhtml.nodes.equation">5.1.4.4.4</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#xhtml.nodes.equation">equation</a> + 5.1.4.4.4&nbsp;&nbsp;equation </h5> <div class="content"><p>A mathematical equation or formula.</p> <p><div class="equation"> - <p class="title"><a class="list" title="Return to table of contents" id="An-example-1-1-1-1-1-1" href="#rev:An-example-1-1-1-1-1-1">Equation 1</a>.&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#An-example-1-1-1-1-1-1">An example</a></p> + <a name="An-example-1-1-1-1-1-1-1"/><div class="nav" id="An-example-1-1-1-1-1-1-1"><a title="Reverse jump to listing" href="#rev:An-example-1-1-1-1-1-1-1">&equiv;</a><a title="Jump to previous segment" href="#xhtml.nodes.equation">&#x25B3;</a><a title="Jump to next segment" href="#xhtml.nodes.procedure">&#x25BD;</a><a title="Jump to this segment" href="#An-example-1-1-1-1-1-1-1">&#x25CE;</a></div> + <p class="title">Equation 1.&nbsp;&nbsp;An example</p> <div class="content"><p>This is how a <strong>equation</strong> node appears.</p></div> </div></p></div> </div> <div class="section"> + <a name="xhtml.nodes.procedure"/><div class="nav" id="xhtml.nodes.procedure"><a title="Reverse jump to listing" href="#rev:xhtml.nodes.procedure">&equiv;</a><a title="Jump to previous segment" href="#An-example-1-1-1-1-1-1-1">&#x25B3;</a><a title="Jump to next segment" href="#An-example-1-1-1-1-1-1-1-1">&#x25BD;</a><a title="Jump to this segment" href="#xhtml.nodes.procedure">&#x25CE;</a></div> <h5 class="title"> - <a class="list" title="Return to table of contents" id="xhtml.nodes.procedure" href="#rev:xhtml.nodes.procedure">5.1.4.4.5</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#xhtml.nodes.procedure">procedure</a> + 5.1.4.4.5&nbsp;&nbsp;procedure </h5> <div class="content"><p>An outline; a series of steps outlining some kind of process.</p> <p><div class="procedure"> - <p class="title"><a class="list" title="Return to table of contents" id="An-example-1-1-1-1-1-1-1" href="#rev:An-example-1-1-1-1-1-1-1">Procedure 1</a>.&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#An-example-1-1-1-1-1-1-1">An example</a></p> + <a name="An-example-1-1-1-1-1-1-1-1"/><div class="nav" id="An-example-1-1-1-1-1-1-1-1"><a title="Reverse jump to listing" href="#rev:An-example-1-1-1-1-1-1-1-1">&equiv;</a><a title="Jump to previous segment" href="#xhtml.nodes.procedure">&#x25B3;</a><a title="Jump to next segment" href="#Bibliographical-nodes">&#x25BD;</a><a title="Jump to this segment" href="#An-example-1-1-1-1-1-1-1-1">&#x25CE;</a></div> + <p class="title">Procedure 1.&nbsp;&nbsp;An example</p> <div class="content"><p>This is how a <strong>procedure</strong> node appears.</p></div> </div></p></div> </div></p></div> </div> <div class="section"> + <a name="Bibliographical-nodes"/><div class="nav" id="Bibliographical-nodes"><a title="Reverse jump to listing" href="#rev:Bibliographical-nodes">&equiv;</a><a title="Jump to previous segment" href="#An-example-1-1-1-1-1-1-1-1">&#x25B3;</a><a title="Jump to next segment" href="#xhtml.nodes.reference">&#x25BD;</a><a title="Jump to this segment" href="#Bibliographical-nodes">&#x25CE;</a></div> <h4 class="title"> - <a class="list" title="Return to table of contents" id="Bibliographical-nodes" href="#rev:Bibliographical-nodes">5.1.4.5</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#Bibliographical-nodes">Bibliographical nodes</a> + 5.1.4.5&nbsp;&nbsp;Bibliographical nodes </h4> <div class="content"><p>The nodes in this section deal with attribution of ideas&#8212;an important weapon against plagiarism.</p> <p><div class="section"> + <a name="xhtml.nodes.reference"/><div class="nav" id="xhtml.nodes.reference"><a title="Reverse jump to listing" href="#rev:xhtml.nodes.reference">&equiv;</a><a title="Jump to previous segment" href="#Bibliographical-nodes">&#x25B3;</a><a title="Jump to next segment" href="#An-example-609181648">&#x25BD;</a><a title="Jump to this segment" href="#xhtml.nodes.reference">&#x25CE;</a></div> <h5 class="title"> - <a class="list" title="Return to table of contents" id="xhtml.nodes.reference" href="#rev:xhtml.nodes.reference">5.1.4.5.1</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#xhtml.nodes.reference">reference</a> + 5.1.4.5.1&nbsp;&nbsp;reference </h5> <div class="content"><p>This node stores bibliography information about an information source that is relevant to your document.</p> <p>If you wish to cite a certain source in several places in your document, start by creating a <strong>reference</strong> node first and then use a <strong>cite</strong> node (see <a class="xref" href="#xhtml.nodes.cite">Section 5.1.4.5.2. cite</a>) to perform the citation.</p> <p><div class="paragraph"> - <p class="title"><a class="here" title="Permanent link to this section" href="#An-example-609275168">An example</a></p> + <a name="An-example-609181648"/><div class="nav" id="An-example-609181648"><a title="Reverse jump to listing" href="#rev:An-example-609181648">&equiv;</a><a title="Jump to previous segment" href="#xhtml.nodes.reference">&#x25B3;</a><a title="Jump to next segment" href="#xhtml.nodes.cite">&#x25BD;</a><a title="Jump to this segment" href="#An-example-609181648">&#x25CE;</a></div> + <p class="title">An example</p> <div class="content"><p>See <a class="xref" href="#xhtml.nodes.reference.example">Reference 2</a> for an example of how a <strong>reference</strong> node appears.</p></div> </div> </p></div> </div> <div class="section"> + <a name="xhtml.nodes.cite"/><div class="nav" id="xhtml.nodes.cite"><a title="Reverse jump to listing" href="#rev:xhtml.nodes.cite">&equiv;</a><a title="Jump to previous segment" href="#An-example-609181648">&#x25B3;</a><a title="Jump to next segment" href="#text">&#x25BD;</a><a title="Jump to this segment" href="#xhtml.nodes.cite">&#x25CE;</a></div> <h5 class="title"> - <a class="list" title="Return to table of contents" id="xhtml.nodes.cite" href="#rev:xhtml.nodes.cite">5.1.4.5.2</a>&nbsp;&nbsp;<a class="here" title="Permanent link to this section" href="#xhtml.nodes.cite">cite</a> + 5.1.4.5.2&nbsp;&nbsp;cite </h5> <div class="content"><p>A citation to a <strong>reference</strong> node (see <a class="xref" href="#xhtml.nodes.reference">Section 5.1.4.5.1. reference</a>) in the document&#8217;s bibliography.</p> <p>The first argument of this node is the unique identifier of the reference node you wish to cite. You can specify additional arguments to give more detail about the citation.</p> @@ -2203,38 +2280,152 @@ </div></p></div> </div></p></div> </div></p> <p><div class="chapter"> + <a name="text"/><div class="nav" id="text"><a title="Reverse jump to listing" href="#rev:text">&equiv;</a><a title="Jump to previous segment" href="#xhtml.nodes.cite">&#x25B3;</a><a title="Jump to next segment" href="#latex">&#x25BD;</a><a title="Jump to this segment" href="#text">&#x25CE;</a></div> <h1 class="title"> - Chapter&nbsp;<a class="list" title="Return to table of contents" id="text" href="#rev:text">5.2</a> + Chapter&nbsp;5.2 <br/> - <big><a class="here" title="Permanent link to this section" href="#text">Plain text</a></big> + <big>Plain text</big> </h1> - <div class="content"><p>This format is not yet implemented. I will do this evenually, but until then, <strong>patches are welcome!</strong> :-)</p> + <div class="content"><p>This format is not yet implemented. Patches are welcome! :-)</p> <a href='http://en.wikipedia.org/wiki/Plain_text'>http://en.wikipedia.org/wiki/Plain_text</a></div> </div> <div class="chapter"> + <a name="latex"/><div class="nav" id="latex"><a title="Reverse jump to listing" href="#rev:latex">&equiv;</a><a title="Jump to previous segment" href="#text">&#x25B3;</a><a title="Jump to next segment" href="#man">&#x25BD;</a><a title="Jump to this segment" href="#latex">&#x25CE;</a></div> <h1 class="title"> - Chapter&nbsp;<a class="list" title="Return to table of contents" id="latex" href="#rev:latex">5.3</a> + Chapter&nbsp;5.3 <br/> - <big><a class="here" title="Permanent link to this section" href="#latex">LaTeX (PDF)</a></big> + <big>LaTeX (PDF)</big> </h1> - <div class="content"><p>This format is not yet implemented. I will do this evenually, but until then, <strong>patches are welcome!</strong> :-)</p> + <div class="content"><p>This format is not yet implemented. Patches are welcome! :-)</p> <a href='http://www.latex-project.org'>http://www.latex-project.org</a></div> </div> <div class="chapter"> + <a name="man"/><div class="nav" id="man"><a title="Reverse jump to listing" href="#rev:man">&equiv;</a><a title="Jump to previous segment" href="#latex">&#x25B3;</a><a title="Jump to next segment" href="#history">&#x25BD;</a><a title="Jump to this segment" href="#man">&#x25CE;</a></div> <h1 class="title"> - Chapter&nbsp;<a class="list" title="Return to table of contents" id="man" href="#rev:man">5.4</a> + Chapter&nbsp;5.4 <br/> - <big><a class="here" title="Permanent link to this section" href="#man">man (UNIX manual page)</a></big> + <big>UNIX manual page</big> </h1> - <div class="content"><p>This format is not yet implemented. I will do this evenually, but until then, <strong>patches are welcome!</strong> :-)</p> + <div class="content"><p>This format is not yet implemented. Patches are welcome! :-)</p> <a href='http://en.wikipedia.org/wiki/Man_page'>http://en.wikipedia.org/wiki/Man_page</a></div> </div></p></div> +</div><div class="chapter"> + <a name="history"/><div class="nav" id="history"><a title="Reverse jump to listing" href="#rev:history">&equiv;</a><a title="Jump to previous segment" href="#man">&#x25B3;</a><a title="Jump to next segment" href="#Version-6.0.0-2009-01-19">&#x25BD;</a><a title="Jump to this segment" href="#history">&#x25CE;</a></div> + <h1 class="title"> + Chapter&nbsp;6 + <br/> + <big>Project history</big> + </h1> + <div class="content"><p><p><div class="section"> + <a name="Version-6.0.0-2009-01-19"/><div class="nav" id="Version-6.0.0-2009-01-19"><a title="Reverse jump to listing" href="#rev:Version-6.0.0-2009-01-19">&equiv;</a><a title="Jump to previous segment" href="#history">&#x25B3;</a><a title="Jump to next segment" href="#Incompatible-changes">&#x25BD;</a><a title="Jump to this segment" href="#Version-6.0.0-2009-01-19">&#x25CE;</a></div> + <h2 class="title"> + 6.1&nbsp;&nbsp;Version 6.0.0 (2009-01-19) + </h2> + <div class="content"><p>This release improves the appearance &amp; usability of the XHTML format, refactors the core logic into reusable libraries, fixes some bugs and improves variable names.</p> + +<p><div class="paragraph"> + <a name="Incompatible-changes"/><div class="nav" id="Incompatible-changes"><a title="Reverse jump to listing" href="#rev:Incompatible-changes">&equiv;</a><a title="Jump to previous segment" href="#Version-6.0.0-2009-01-19">&#x25B3;</a><a title="Jump to next segment" href="#New-features">&#x25BD;</a><a title="Jump to this segment" href="#Incompatible-changes">&#x25CE;</a></div> + <p class="title">Incompatible changes</p> + <div class="content"><ul> +<li> +<p>Renamed <code class="code"><span style="color:#33B">@types</span></code> to <code class="code"><span style="color:#33B">@nodes_by_type</span></code> and <code class="code"><span style="color:#33B">@spec</span></code> to <code class="code"><span style="color:#33B">@format</span></code> in XHTML format.</p> +</li> + +<li> +<p>Moved the core logic of the <strong>erbook</strong> executable into the <code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Document</span></code> and <code class="code"><span style="color:#036;font-weight:bold">ERBook</span>::<span style="color:#036;font-weight:bold">Document</span>::<span style="color:#036;font-weight:bold">Template</span></code> classes.</p> +</li> +</ul></div> +</div> <div class="paragraph"> + <a name="New-features"/><div class="nav" id="New-features"><a title="Reverse jump to listing" href="#rev:New-features">&equiv;</a><a title="Jump to previous segment" href="#Incompatible-changes">&#x25B3;</a><a title="Jump to next segment" href="#Bug-fixes">&#x25BD;</a><a title="Jump to this segment" href="#New-features">&#x25CE;</a></div> + <p class="title">New features</p> + <div class="content"><ul> +<li> +<p>Addded navigation menus beside every segment in the user manual. These menus allow you to jump to the next/previous segment, whereas previously you always had to go back to the table of contents and select a new segment.</p> +</li> + +<li> +<p>A star is drawn beside a reverse jump target in the table of contents, so the user can continue where they left off.</p> +</li> + +<li> +<p>Added &#8220;inline&#8221; node definition parameter (see <a class="xref" href="#SpecFile.nodes">Section 3.2.1. Node definition</a>).</p> +</li> + +<li> +<p>Added <code class="code"><span style="color:#d70;font-weight:bold">$subtitle</span></code> parameter to XHTML format.</p> +</li> + +<li> +<p>Document parameters for the XHTML format, such as <code class="code"><span style="color:#d70;font-weight:bold">$title</span></code>, can now be disabled by setting them to <code class="code"><span style="color:#038;font-weight:bold">nil</span></code>.</p> +</li> + +<li> +<p>Relative file paths can now be specified in &lt;%#include#%&gt; directives.</p> +</li> + +<li> +<p>Added a &#8220;node&#8221; node (see <a class="xref" href="#xhtml.nodes.node">Section 5.1.4.2.1. node</a>), which serves as a pass-through container, in the XHTML format.</p> +</li> + +<li> +<p>Allow user to type <code class="code">&lt;pre&gt;</code> blocks on single lines without affecting the display of their content.</p> +</li> + +<li> +<p>Initial newline in the body of <code class="code">&lt;code&gt;</code> is now stripped. This allows users to write their code blocks normally:</p> + +<p>&#60;code&#62;<br /> foo<br /> bar<br /> &#60;/code&#62;<br /></p> + +<p>Instead of abnormally to avoid an extra leading newline:</p> + +<p>&#60;code&#62;foo<br /> bar<br /> &#60;/code&#62;<br /></p> +</li> + +<li> +<p>Paragraph nodes are now included in the table of contents.</p> +</li> +</ul></div> +</div> <div class="paragraph"> + <a name="Bug-fixes"/><div class="nav" id="Bug-fixes"><a title="Reverse jump to listing" href="#rev:Bug-fixes">&equiv;</a><a title="Jump to previous segment" href="#New-features">&#x25B3;</a><a title="Jump to next segment" href="#Housekeeping">&#x25BD;</a><a title="Jump to this segment" href="#Bug-fixes">&#x25CE;</a></div> + <p class="title">Bug fixes</p> + <div class="content"><ul> +<li> +<p>Input to unindentation algorithm was being partially unindented beforehand by the logic that silences code-only eRuby directives. This corrupted the unindentation algorithm&#8217;s output in some cases.</p> +</li> + +<li> +<p><code class="code">&lt;pre&gt;</code> blocks now expand to fit their content in the XHTML format. No more scrollbars!</p> +</li> + +<li> +<p><code class="code">&lt;a/&gt;</code> without href was treated as external hyperlink.</p> +</li> +</ul></div> +</div> <div class="paragraph"> + <a name="Housekeeping"/><div class="nav" id="Housekeeping"><a title="Reverse jump to listing" href="#rev:Housekeeping">&equiv;</a><a title="Jump to previous segment" href="#Bug-fixes">&#x25B3;</a>&#x25BD;<a title="Jump to this segment" href="#Housekeeping">&#x25CE;</a></div> + <p class="title">Housekeeping</p> + <div class="content"><ul> +<li> +<p>Revised the project logo to emphasize the owl mascot.</p> +</li> + +<li> +<p>Replaced dull MediaWiki hyperlink colors with more lively colors in XHTML format.</p> +</li> + +<li> +<p>Wrote more API documentation and use <a href='http://snk.tuxfamily.org/lib/inochi'>Inochi</a> to simplify project maintenance.</p> +</li> +</ul></div> +</div></p></div> +</div></p></p></div> </div></div> <div id="bib"> - <h1 class="title" id="References"><a class="here" href="#References">References</a></h1> + <a name="References"/><div class="nav" id="References"><a title="Reverse jump to listing" href="#rev:References">&equiv;</a>&#x25B3;&#x25BD;<a title="Jump to this segment" href="#References">&#x25CE;</a></div> + <h1 class="title" >References</h1> <ol> <li id="KDE.admonitions"><p>L. Watts, &#8220;Admonitions: Tips, hints, and Warnings&#8221;, in <em>The KDE DocBook Authors guide</em>, Chapter 13, [Online document], 22 September 2004 (Revision 1.00.00), [cited 8 December 2007], Available at <a href='http://l10n.kde.org/docs/markup/tips-hints-etc.html'>http://l10n.kde.org/docs/markup/tips-hints-etc.html</a></p></li> <li id="xhtml.nodes.reference.example"><p>This is how a <strong>reference</strong> node appears.</p></li> </ol> </div> @@ -2244,11 +2435,11 @@ <br style="display: none"/> <div id="footer"> - Generated by <a href="http://snk.tuxfamily.org/lib/erbook">erbook 5.0.0</a> on Sat Nov 22 23:17:15 -0800 2008. + Generated by <a href="http://snk.tuxfamily.org/lib/erbook/">ERBook 6.0.0</a> on Mon Jan 19 04:46:04 -0800 2009. <div id="footer-credits"> <p> <img class="icon" src="&icon_caution;" alt="caution"/> <img class="icon" src="&icon_tip;" alt="tip"/> @@ -2271,7 +2462,8 @@ </p> </div> </div> + </div> </body> </html>