\title{Textweb mini-server} \include{header.txt} \include{geekstuff/navbar.txt} Textweb ======= Sick of HTML? Want to write your web pages with a plain-text like markup language? Here's a not-too-big Perl script that rewrites simple text formatting on the fly to generate HTML. Ideas stolen blatantly from [[http://c2.com/wiki][Wiki]], LaTeX, [[http://www.zope.org/Documentation/Articles/STX][Zope structured text]], [[http://www.robertmuench.de/makedocpro.html][make-doc-pro]], [[http://www.maplefish.com/todd/aft.html][Almost Free Text]] etc. Nevertheless all of those are too heavyweight or have other drawbacks (like the markup is not enough like plain-text for my taste). The implementation is pretty crummy at the moment, but it's already usable and serving my immediate purposes. Philosophy ========== * Use old skool Usenet/email-style .txt markup to make your web pages. Borrow a few handy things from Wiki and LaTeX. * .txt source documents should look as much like actual plain text as possible, and be usable as .txt. * Allow fancy markup via direct use of HTML, if you really want/need to. * Don't interfere with your existing content & scripts. * Do it all with minimal fuss (no wacky permissions setups, complex distros, or templates to set up, just one Perl script and a little mod_rewrite). * Automatically generate Atom feeds of blog-like content, with minimal fuss. Code ==== Here is [[http://tulrich.com/textweb.pl?show_source=1][the textweb.pl script source]], including installation notes and markup description. ---------------------------------------------------- Markup ====== Here are some examples of markup. You can see the source for this page [[textweb.txt][here]]. You can view the .txt source for many of the pages on this site (i.e. the ones processed with Textweb) by just replacing the ".html" extension in the URL with ".txt". \nomarkup{
source | marked up |
---|---|
} ---- A bare link to some web page: http://tulrich.com. ---- \nomarkup{ | } A bare link to some web page: http://tulrich.com. \nomarkup{ |
} ---- Some inline [[http://tulrich.com][linked text]]. ---- \nomarkup{ | } Some inline [[http://tulrich.com][linked text]]. \nomarkup{ |
} ---- A bulleted list: * Item 1 * Item 2 * Another item, let's call it 3 ---- \nomarkup{ | } A bulleted list: * Item 1 * Item 2 * Another item, let's call it 3 \nomarkup{ |
} ---- ``some curly quotes'' ---- \nomarkup{ | } ``some curly quotes'' \nomarkup{ |
} ---- *some emphasis* ---- \nomarkup{ | } *some emphasis* \nomarkup{ |
} ---- _some underlining_ ---- \nomarkup{ | } _some underlining_ \nomarkup{ |
} ---- How about /some italics./ ---- \nomarkup{ | } How about /some italics./ \nomarkup{ |
} ---- A horizontal rule ------------------- Line above. ---- \nomarkup{ | } A horizontal rule ------------------- Line above. \nomarkup{ |
} ---- Heading ======= ---- \nomarkup{ | } Heading ======= \nomarkup{ |
} ---- Some paragraph text. Some symbols: A > B & C < D ---- \nomarkup{ | } Some paragraph text. Some symbols: A > B & C < D \nomarkup{ |
} ---- some inline code ---- for (int i = 0; i < 10; i++) { printf("the number %d\n", i); } ---- end inline code ---- \nomarkup{ | } ---- some inline code ---- for (int i = 0; i < 10; i++) { printf("the number %d\n", i); } ---- end inline code ---- \nomarkup{ |