geekstuff | gameswf | Textweb | Chunked LOD | dumbuild |
Cheat sheets: CVS | cygwin | Debian | Emacs | MythTV |
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 Wiki, LaTeX, Zope structured text, make-doc-pro, 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.
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.
Here is the textweb.pl script source, including installation notes and markup description.
Here are some examples of markup. You can see the source for this page 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".
source | marked up |
---|---|
A bare link to some web page: http://tulrich.com. | A bare link to some web page: http://tulrich.com. |
Some inline [[http://tulrich.com][linked text]]. | Some inline linked text. |
A bulleted list: * Item 1 * Item 2 * Another item, let's call it 3 | A bulleted list:
|
``some curly quotes'' |
“some curly quotes” |
*some emphasis* | some emphasis |
_some underlining_ | some underlining |
How about /some italics./ | How about some italics. |
A horizontal rule ------------------- Line above. |
A horizontal ruleLine above. |
Heading ======= |
Heading |
Some paragraph text. Some symbols: A > B & C < D | Some paragraph text. Some symbols: A > B & C < D |
---- some inline code ---- for (int i = 0; i < 10; i++) { printf("the number %d\n", i); } ---- end inline code ---- | ---- some inline code ---- for (int i = 0; i < 10; i++) { printf("the number %d\n", i); } ---- end inline code ---- |
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 .