\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{
sourcemarked 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{
} ---------------------------------------------------- How To Blog =========== You can blog with Textweb any way you feel like, but if you want to get an Atom feed for free, format your posts like so: ---- [... anything; header formatting, etc ...] \atom_author{Your Name Here} ---------------------------------------------------------------------- 5 May 2003 *Post Title Here* Type your post text here, use whatever formatting you like, etc. End your post and start the next one with a horizontal bar. ---------------------------------------------------------------------- 10 April 2003 *And So On* More hot blog here. ---------------------------------------------------------------------- [... any footer junk that doesn't have an obvious date line won't generate entries...] ---- Link to your Atom feed by replacing your ".html" extension with ".xml". For an example, peek at my blog source at http://tulrich.com/index.txt and http://tulrich.com/rants-2005.txt, and the resulting Atom feed, http://tulrich.com/index.xml . \include{footer.txt}