<?xml version="1.0" encoding="utf8"?>
<!DOCTYPE eolas SYSTEM "DTD">
<eolas xmlns:xlink="http://www.w3.org/1999/xlink" xml:lang="en-US">
  <summary>
    <title>Eolas Markup Example</title>
    <description>Examples and recommended usage of XML documents following the eolas format.</description>
    <rights>The author disclaims all copyrights and releases this document into the public domain.</rights>
    <version>$Id: example.xml,v 1.24 2009/05/24 21:47:50 jmates Exp $</version>
  </summary>
  <section>
    <info>Eolas is a simple <acronym xlink:href="http://www.xml.com/"><abbr>XML</abbr><name>Extensible Markup Language</name></acronym> format used to generate narrative-centric documentation and presentations.  This document provides an overview of the various features of the specification and their usage, plus additional recommendations on style where <acronym xlink:href="http://www.xml.com/"><abbr>XML</abbr><name>Extensible Markup Language</name></acronym> does not apply.</info>
  </section>
  <section>
    <title>Basics</title>
    <info>Eolas documents should be created from a pre-built template, which should contain all the extra cruft required by <acronym><abbr>XML</abbr><name>Extensible Markup Language</name></acronym> documents.  Use UTF-8 encoding where possible.  Eolas documents consist of a leading <code>&lt;summary&gt;</code> element, which contains relevant overview details, followed by at least on <code>&lt;section&gt;</code> element containing the meat of the document.  <code>&lt;section&gt;</code> may be nested to produce subsections.  Consult the <acronym><abbr>DTD</abbr><name>Document Type Description</name></acronym> file for the final word on how things are laid out.</info>
    <info><acronym><abbr>XSLT</abbr><name>Extensible Stylesheet Language Transformations</name></acronym> and <acronym><abbr>CSS</abbr><name>Cascading Style Sheets</name></acronym> can be used to control the rendition and display of the <acronym><abbr>XML</abbr><name>Extensible Markup Language</name></acronym> in web browsers—consult the <file xlink:href=".">stylesheets</file> directory for more details on that process.</info>
  </section>
  <section>
    <title>Sections</title>
    <info>The following is a depth check on subsection support.</info>
    <section>
      <title>Three</title>
      <section>
        <title>Four</title>
        <section>
          <title>Five</title>
          <section>
            <title>Six</title>
            <section>
              <title>Seven</title>
              <section>
                <title>Eight</title>
              </section>
            </section>
          </section>
        </section>
      </section>
    </section>
  </section>
  <section>
    <title>Markup</title>
    <info>There are various text markup elements, ranging from HTML-compatible to computer system related ones.</info>
    <list>
      <li><input>&lt;input&gt;</input> - text the user will input into a computer, e.g. textfield values: <input>foo</input><input>bar</input>.</li>
      <li><em>&lt;em&gt;</em> - from HTML, for <em>emphasis</em> to the reader.</li>
      <li><code>&lt;code&gt;</code> - catch-all element for computer-related markup.</li>
      <li><cmd>&lt;cmd&gt;</cmd> - inline shell commands, like <cmd>ls -al</cmd>.</li>
      <li><cmd-arg>&lt;cmd-arg&gt;</cmd-arg> - arguments to inline shell commands (use <cmd-arg>-ali</cmd-arg> for inode display).</li>
      <li><gui>&lt;gui&gt;</gui> - catch-all for user interaction with captive user interface elements.  (From the <gui>File</gui> menu, select <gui>Save As...</gui>.)</li>
      <li><file>&lt;file&gt;</file> - filenames of all sorts and kinds, like <file>/etc/mail</file>.</li>
      <li><file-glob>&lt;file-glob&gt;</file-glob> - for (Unix) shell-style globbing of filenames, e.g. <file-glob>*html</file-glob>.</li>
      <li><host>&lt;host&gt;</host> - system hostnames, <host>example.org</host>.</li>
      <li><code>&lt;perl-func&gt;</code> - perl functions: <perl-func>-X</perl-func>.</li>
      <li><code>&lt;perl-module&gt;</code> - perl modules, with auto-links to documentation: <perl-module>File::Temp</perl-module>.</li>
      <li><code>&lt;perl-pod&gt;</code> - perl POD: <perl-pod>perlre</perl-pod>.</li>
      <li><code>&lt;man&gt;</code> - Unix manuals (<man section="1">ls</man>, <man section="8" system="OpenBSD">pfctl</man>).</li>
      <li><code>&lt;rfc&gt;</code> - Requests for Comments: <rfc>1234</rfc>, <rfc xlink:href="http://www.example.org/">99999</rfc>.</li>
      <li><code>&lt;acronym&gt;</code> - acronyms, like <acronym><abbr>MTA</abbr><name>Mail Transport Agent</name></acronym></li>
      <li><code>&lt;link&gt;</code> - HTML <code>&lt;a href=""&gt;</code> using <code>xlink:href</code> instead.  Note that certain elements accept the <code>xlink:href</code> attribute, which is usually preferable to doing <code>&lt;link xlink:href=""&gt;&lt;foo&gt;bar&lt;/foo&gt;&lt;/link&gt;</code> nesting.</li>
      <li><code>&lt;book&gt;</code> - books, for example <book isbn="0596007647" xlink:href="http://www.oreilly.com/catalog/xmlnut3/">XML in a Nutshell: A Desktop Quick Reference</book> or <book isbn="0596005423">Amazon Hacks: 100 Industrial-Strength Tips and Tools</book>.</li>
      <li><code>&lt;script&gt;</code> - Sial.org scripts, such as <script>pbotutil</script>.</li>
    </list>
    <info>Images too, if you really need them.</info>
    <info>
      <image width="39" height="18" xlink:href="xml.png"/>
    </info>
    <info>And <acronym xlink:href="http://www.w3.org/TR/SVG/"><abbr>SVG</abbr><name>Scalable Vector Graphics</name></acronym> images, which get handled slightly differently than bitmaps.</info>
    <info>
      <image-svg xlink:href="xml.svg"/>
    </info>
  </section>
  <section>
    <title>Text Blocks</title>
    <info>There are three general text blocks, <code>&lt;info&gt;</code>, <code>&lt;note&gt;</code>, and <code>&lt;warn&gt;</code>.  <code>&lt;info&gt;</code> should be used where possible, and is the equivalent of a paragraph block in HTML.  The other two block styles allow one to tag data as more important or critical— computer documentation often contains many noteworthy pitfalls.</info>
    <note>This is the <code>&lt;note&gt;</code> block style, with some filler text to hopefully get in a line or two.  There is no style guide whether a block such as this should really be a standard paragraph, or just a quick sentence.</note>
    <warn>This is the <code>&lt;warn&gt;</code> block style.</warn>
  </section>
  <section>
    <title>Data Blocks</title>
    <info>Display of data from computers (shell commands, output thereof, contents of configuration files) is handled by <code>&lt;data&gt;</code> blocks, which contain either <code>&lt;line&gt;</code> or <code>&lt;shell&gt;</code> elements.  User input may be indicated inside <code>&lt;line&gt;</code> elements via the <code>&lt;input&gt;</code> element.  Use the <code>&lt;em&gt;</code> element to bring a reader’s attention to something, and <code>&lt;comment&gt;</code> to denote things the shell or reader will generally ignore.</info>
    <section>
      <title>Examples</title>
      <info>Lines without <code>&lt;shell&gt;</code> elements are placed into a different CSS class, which allows the denotation of the shell examples differently from those just containing data.</info>
      <data>
        <line>
          <comment># how long priv. allowance lasts</comment>
        </line>
        <line>Defaults        timestamp_timeout=15</line>
        <line/>
        <line>
          <comment># only allow on single terminal</comment>
        </line>
        <line>Defaults       tty_tickets</line>
        <line>
          <comment># require a tty to prevent clever hacks</comment>
        </line>
        <line>Defaults       requiretty</line>
        <line/>
        <line>
          <comment># do not lecture those who presumably know</comment>
        </line>
        <line>Defaults:%wheel !lecture</line>
      </data>
      <info>The <code>prefix</code> attribute for <code>&lt;shell&gt;</code> can be used to specify a custom shell prompt, which indicates shell commands to the reader.  The <code>prefix</code> can also be used to denote different shells (<code>$</code> for a bourne-based shell or <code>%</code> for a C-ish shell), users (<code>#</code> for the superuser), or other metadata related to the commands being run.</info>
      <data>
        <shell prefix="$ ">sudo -s</shell>
        <line>Password: <input><em>your password</em></input><comment>        # will not echo</comment></line>
        <shell prefix="# ">uptime</shell>
        <line>2:29PM  up 1 day, 22:30, 5 users, load averages: 0.46, 0.36, 0.37</line>
        <line/>
        <shell prefix="client$ ">scp ~/.ssh/id_dsa.pub server.example.com:</shell>
        <shell prefix="server$ ">cat id_dsa.pub &gt;&gt; ~/.ssh/authorized_keys</shell>
      </data>
    </section>
    <section>
      <title>Wrapping</title>
      <info>Text wrapping in data blocks poses problems, as either one loses the initial (and often important) whitespace on each line of text, or the text runs long off the right-hand side of the browser display.  This was solved by setting preformatted text for data blocks (to preserve initial whitespace) and then allowing the author to insert <code>&lt;rbr/&gt;</code> to tell the XSLT engine where to insert line breaks.  This will need to be a browser-specific alteration, and means to get at the unaltered data should be provided where relevant.</info>
      <data>
        <shell prefix="$ ">echo test of a very long line that would otherwise run off the right hand side<rbr/> of a browser window</shell>
        <line>test of a very long line that would otherwise run off the right hand side of a b<rbr/>rowser window</line>
      </data>
      <info>Generally, data in <code>&lt;line&gt;</code> elements should be broken down as an 80-column terminal would display it.  <code>&lt;shell&gt;</code> element contents will need to be broken down where appropriate or by logical groups.  For example, a perl script can be presented on two lines, one for each <cmd-arg>-e</cmd-arg> argument.</info>
      <data>
        <shell prefix="# ">perl -ple 'BEGIN { $n=0; select $fh }' <rbr/>-e 'open $fh, "&gt;card$n.vcf" and $n++ if /^BEGIN:VCARD$/' all.vcf</shell>
      </data>
    </section>
  </section>
  <section>
    <title>Lists</title>
    <info>At present, two forms of lists are supported— ordered (<code>&lt;enum&gt;</code>) and unordered (<code>&lt;list&gt;</code>).  Lists and list elements (<code>&lt;li&gt;</code>) accept the standard HTML CSS attributes for fancier markup in resulting browsers, if required.</info>
    <list>
      <li>Unordered list item 1.</li>
      <li>Unordered list item 2.</li>
    </list>
    <enum>
      <li>First.</li>
      <li>Second.</li>
    </enum>
    <info>A more complex nested example.</info>
    <list>
      <li>Foo</li>
      <info>Not much to say about Foo.</info>
      <li>Bar</li>
      <enum>
        <li>First.</li>
        <warn>Just a test.</warn>
        <li>Second.</li>
      </enum>
      <li>Some data, described in a run-on sentence as we need to see sometimes how very long <code>&lt;li&gt;</code> content is displayed under the browser in question.  Had this been a real run-on, the system would have caught on fire.</li>
      <data>
        <shell prefix="$ ">xsltproc test.xsl test.xml &gt; test.html</shell>
        <shell prefix="$ ">open -a OmniWeb test.html</shell>
      </data>
      <li xml:lang="es">¡Ése es todo, gente!</li>
    </list>
    <info>Post list text block to confirm post-list spacing.</info>
  </section>
  <section>
    <title>Tests for <code xlink:href="test">link</code> <perl-module>File::AtomicWrite</perl-module> <man section="1">ls</man> <perl-pod>perlfunc</perl-pod> <perl-func>unlink</perl-func></title>
    <!-- TODO despite xsl now handling whitespace properly, xmllint messes up the spacing :( -->
    <info><link xlink:href="anothertest">Inside this link, <code>xlink:href</code> or auto-generated <link xlink:href="shouldnotappear">links</link> should not replace the parent link: <perl-module>File::AtomicWrite</perl-module> <man section="1">ls</man> <perl-pod>perlfunc</perl-pod> <perl-func>unlink</perl-func></link>. And, to check up on whitespace handling: <perl-module>File::AtomicWrite</perl-module><man section="1">ls</man><perl-pod>perlfunc</perl-pod><perl-func>unlink</perl-func>.</info>
  </section>
</eolas>
