<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:xhtml="http://www.w3.org/1999/xhtml">
  <title>webdev | Two 〈Foo〉s Walk into a 〈Bar〉</title>
  
  <updated>2007-09-13T23:03:03-05:00</updated>
  <author>
    <name>Chris Povirk</name>
    <email>beigetangerine@gmail.com</email>
    <uri>http://twofoos.org/</uri>
  </author>
  <link rel="alternate" type="application/xhtml+xml" hreflang="en" href="http://twofoos.org/tag/webdev/"/>
  <link rel="self" type="application/atom+xml" href="http://twofoos.org/tag/webdev/feed/"/>
  <rights>Copyright © 2003–2015 Chris Povirk.  All Rights Reserved.</rights>
  <id>http://twofoos.org/</id>
  <generator uri="http://twofoos.org/content/splat/" version="1.0">SPLAT</generator>
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
<entry>
    <updated>2007-09-13T23:03:03-05:00</updated>
    <summary>
            New: The program used to generate this web site.</summary>
    <title type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">SPLAT</div>
    </title>
    <link rel="alternate" type="application/xhtml+xml" href="http://twofoos.org/content/splat/#update_2007-09-13T23:03:03-05:00"/>
    <id>http://twofoos.org/content/splat/#update_2007-09-13T23:03:03-05:00</id>
    <category term="webdev"/>
    <content type="xhtml" xml:base="http://twofoos.org/">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <strong>initial posting</strong>
        <div>

    <xhtml:h3>Description</xhtml:h3>
    <div>
      <p>I use <acronym>SPLAT</acronym> to generate this web site.  The name stands for Stylesheet Processing Lives on After <acronym>THLOP</acronym>.  As the name suggests, <acronym>SPLAT</acronym> is the follow‐up to <acronym>THLOP</acronym>, the program I used to use to generate my web site when it was located at pitt.edu.  <acronym>THLOP</acronym> stands for Three Hundred Lines of Perl, which accurately describes the original code with about ten percent error.  Additionally, the acronym accurately suggests the elegance and dynamism of the code, which was perfectly well behaved but not very flexible.</p>
      <p>This page exists mainly so that I have something to put in the <code>&lt;generator&gt;</code> element of my Atom feeds; I don't have promotional materials to explain why it's so great, and really, for most people, it probably isn't.  It turns <acronym>XML</acronym> files that I write in Vim into web pages, using <acronym>XSLT</acronym> (<a href="http://xmlsoft.org/XSLT/"><code>xsltproc</code></a>, specifically) and a little shell scripting to do the work.  A major feature, in my view, is that it doesn't generate pages dynamically like most blogging packages do.  Instead, when I make a change, I run one script, and it generates the whole site and uploads it to the server, from which it is served as static <acronym>HTML</acronym>.  Another feature is that, when I edit a page, I can choose whether or not it should show up as updated.  This feature may well be widespread, for all I know, but if so, it's wildly underutilized.</p>
    </div>

    <xhtml:h3>Download</xhtml:h3>
    <div>
    <p>As noted above, <acronym>SPLAT</acronym> has an unusual feature set, so it's probably not of general interest.  Further, it has virtually no documentation, and code specific to my web site is peppered throughout.  This download is available mainly to justify the existence of this page, which, as you'll recall from earlier, exists so that I have something to stick in the <code>&lt;generator&gt;</code> element of my Atom feeds.  So yeah, don't click here:</p>
    <ul>
      <li><a href="/resources/splat_twofoos.tar.gz"><acronym>SPLAT</acronym> code and Two 〈Foo〉s Walk into a 〈Bar〉 stylesheets</a></li>
    </ul>
    <p>Available under version 2 of <a href="http://www.gnu.org/copyleft/gpl.html">the <acronym>GNU</acronym> General Public License</a>.</p>
    </div>

  </div>
      </div>
    </content>
  </entry><entry>
    <updated>2005-06-30T00:00:00-05:00</updated>
    <summary>
            New: There is no shortage of HTML/CSS/JavaScript/Java/Flash menus available for your web page.  There are fewer that use only HTML and CSS, fewer still that look decent in browsers without CSS support, and even fewer that don't look funny when a menu item's text is too long.  Well, you can still make this one look a little odd if you try, but in my biased opinion, it's the best I've seen.  Check out the feature list.  (Fully functional in Firefox and Opera; appears as nested lists in IE and Lynx.)</summary>
    <title type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">Auto‐Sizing Pure CSS Menus</div>
    </title>
    <link rel="alternate" type="application/xhtml+xml" href="http://twofoos.org/content/cssmenus/#update_2005-06-30T00:00:00-05:00"/>
    <id>http://twofoos.org/content/cssmenus/#update_2005-06-30T00:00:00-05:00</id>
    <category term="webdev"/>
    <content type="xhtml" xml:base="http://twofoos.org/">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <strong>initial posting</strong>
        <div>

    <xhtml:h3>Download</xhtml:h3>
    <div>
    <p>If you want to use the <acronym>CSS</acronym> menu stylesheet, you will probably want to right‐click and save this link.  It includes nearly everything from this page in text format in the comments, as well as the actual <acronym>CSS</acronym>.  <a href="/resources/menu-stylesheet.css">Menu Stylesheet</a></p>
    </div>

    <xhtml:h3>Features</xhtml:h3>
    <div>
    <ul>
      <li>Arbitrarily nested submenus</li>
      <li>Menu separators</li>
      <li>No JavaScript (will function even if the user has turned scripting off)</li>
      <li>Plain <acronym>HTML</acronym> list syntax (no new, complex format to learn)</li>
      <li>Accessible (since it is just a list)</li>
      <li>Degrades gracefully in the absence of sufficient <acronym>CSS</acronym> support (plain nested lists in Lynx, <acronym>IE</acronym>)</li>
      <li>Fully functional in Firefox 1.0, Opera 8.0</li>
      <li>Menus widen to handle long menu item labels</li>
      <li>Automatically adds arrows for submenus</li>
      <li>Documentation to aid in usage and customization</li>
    </ul>
    </div>

    <xhtml:h3>Example Menu Output</xhtml:h3>
    <div>
    <ul class="menu">

      <li class="submenu">
      File
      <ul>
        <li><a href="http://www.google.com/">Open</a></li>
        <li><a href="http://www.google.com/">Save</a></li>
        <li class="submenu">
        More
        <ul>
          <li><a href="http://www.google.com/">Import</a></li>
          <li><a href="http://www.google.com/">Export</a></li>
        </ul>
        </li>
        <li class="separator"> </li>
        <li><a href="http://www.google.com/">Exit</a></li>
      </ul>
      </li>

      <li class="submenu">
      Edit
      <ul>
        <li><a href="http://www.google.com/">Cut</a></li>
        <li><a href="http://www.google.com/">Copy</a></li>
        <li><a href="http://www.google.com/">Paste</a></li>
      </ul>
      </li>

      <li class="submenu">
      Search
      <ul>
        <li><a href="http://www.google.com/">Find</a></li>
        <li><a href="http://www.google.com/">Replace</a></li>
      </ul>
      </li>

      <li class="submenu">
      Help
      <ul>
        <li><a href="http://www.google.com/">About</a></li>
        <li><a href="http://www.google.com/">Index</a></li>
      </ul>
      </li>

    </ul>
    </div>

    <xhtml:h3>Example Menu Source</xhtml:h3>
    <div>
    <pre>&lt;ul class="menu"&gt;

      &lt;li class="submenu"&gt;
      File
      &lt;ul&gt;
        &lt;li&gt;&lt;a href="http://www.google.com/"&gt;Open&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://www.google.com/"&gt;Save&lt;/a&gt;&lt;/li&gt;
        &lt;li class="submenu"&gt;
        More
        &lt;ul&gt;
          &lt;li&gt;&lt;a href="http://www.google.com/"&gt;Import&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="http://www.google.com/"&gt;Export&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
        &lt;/li&gt;
        &lt;li class="separator"&gt;&amp;#xa0;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://www.google.com/"&gt;Exit&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
      &lt;/li&gt;

      &lt;li class="submenu"&gt;
      Edit
      &lt;ul&gt;
        &lt;li&gt;&lt;a href="http://www.google.com/"&gt;Cut&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://www.google.com/"&gt;Copy&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://www.google.com/"&gt;Paste&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
      &lt;/li&gt;

      &lt;li class="submenu"&gt;
      Search
      &lt;ul&gt;
        &lt;li&gt;&lt;a href="http://www.google.com/"&gt;Find&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://www.google.com/"&gt;Replace&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
      &lt;/li&gt;

      &lt;li class="submenu"&gt;
      Help
      &lt;ul&gt;
        &lt;li&gt;&lt;a href="http://www.google.com/"&gt;About&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="http://www.google.com/"&gt;Index&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
      &lt;/li&gt;

    &lt;/ul&gt;</pre>
    </div>

    <xhtml:h3>Usage</xhtml:h3>
    <div>

    <p>First, of course, you must put some code in your <acronym>HTML</acronym> file to tell browsers to use this stylesheet.  If this stylesheet is located in the same directory as the <acronym>HTML</acronym> file that you want to use it, it is sufficient to put this line in the &lt;head&gt; section of your <acronym>HTML</acronym> file:<br/>
    <code>&lt;link rel="stylesheet" type="text/css" href="menu-stylesheet.css" /&gt;</code></p>

    <p>Build your menu like the one shown above.</p>

    <xhtml:h4>Main Points</xhtml:h4>
    <div>
    <ul>
      <li>Menus (including the menu bar, which I'm considering to be a menu) are ul's.</li>
      <li>The top‐level ul should have class 'menu'.</li>
      <li>Submenu ul's should use neither 'menu' nor 'submenu' as classes.</li>
      <li>Menu items are li's.</li>
      <li>li's with child menus should have class 'submenu' and should have no other children except some text before the ul child.  This text will be the menu label, and it should NOT be a link, nor should it contain any links.</li>
      <li>li's without children should have a link containing a text label as their only child.</li>
      <li>Menu separators can be created with the following code:<br/>
        <code>&lt;li class="separator"&gt;&amp;#xa0;&lt;/li&gt;</code></li>
    </ul>
    </div>

    <xhtml:h4>Customization</xhtml:h4>
    <div>

    <p>You can, of course, safely fiddle with fonts and colors without breaking anything.
    The same goes for borders.
    The other changes you may be interested in are those relating to menu size.
    Because <acronym>CSS</acronym> does not support constants, these changes are not as easy to make as I would like.
    To simplify the process, I have labeled the places where I would have used constants.
    At the time of this writing, the "constants" are:</p>
    <ul>
      <li><strong><code>menu_line_spacing</code></strong>: line height of menu items (not to be confused with font size, which you can set by adding an appropriate rule in the '<code>ul.menu, ul.menu ul</code>' section)</li>
      <li><strong><code>menu_padding_left</code></strong>: padding on the left side of the menu items</li>
      <li><strong><code>menu_padding_right</code></strong>: padding on the right side of the menu items</li>
      <li><strong><code>min_menu_width</code></strong>: minimum width of menu items, NOT including padding.  Note that menus WILL widen to accomodate larger menu item labels; HOWEVER, submenus from any of their menu items will not appear to their far right (as they would if each menu item fit into <code>min_menu_width</code>) but instead somewhere toward the middle of the menu item</li>
    </ul>

    <p>Thus, the code contains lines like these:<br/>
    <code>margin-left: 5.1em; /* min_menu_width + menu_padding_right */</code><br/>

    The above line indicates that if you want <code>min_menu_width</code> to be 5em and <code>menu_padding_right</code> to be .6em, you should change 5.1em to 5.6em, since 5em + .6em = 5.6em.</p>
    </div>
    </div>

    <xhtml:h3>Legal</xhtml:h3>
    <div>
    <p>Auto‐sizing pure <acronym>CSS</acronym>/list menus.</p>
    <p>Copyright (C) 2005  Chris Povirk</p>

    <p>I place this page and the <acronym>CSS</acronym> menu stylesheet in the public domain.  You may use, modify, and distribute them for whatever purposes you wish, with or without this notice.  No further permission is required.</p>

    <p>Disclaimer (adapted from the <a href="http://www.gnu.org/licenses/gpl-faq.html"><acronym>GNU</acronym> <acronym>GPL</acronym> <acronym>FAQ</acronym></a>):</p>
    <p>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</p>
    </div>

  </div>
      </div>
    </content>
  </entry></feed>
