SmartHTML 1.7 - yet another markup language

A while ago I stumbled upon the Latte homepage - Latte is a Latex-like (or at least I think it is) language that allows easier creation of webpages - it has features like macros that make it easier to achieve consistant layout.

It was a very interesting idea, but I didn't like the syntax. Also, Latte did not compile on my machine (too old Flex libraries). So, I made my own similar, but simpler program using Perl.

SmartHTML looks a lot like texinfo (I found out after I got a bit into it). Tags look like this:

@tag { Stuff inside the tag }

or this:

@tag Works until the end of line

That makes it somewhat less cumbersome to use than normal HTML. Most tags are named the same as in normal HTML, so e.g. bold is @b.

In addition, SmartHTML has some other features that make life easier:

  • It treats two or more consecutive newlines as <P>
  • It automatically escapes all special characters (i.e. & < > ")
  • It allows creation of macros (e.g. my footer is now called just @footer in my webpages, and is just defined in one config file)
  • The source easier to read than normal HTML - the @tag style tag are less invasive
  • Easy creation of URLs - @url{www.andreasen.org} becomes www.andreasen.org.
  • Easy expansion of tags. For example, it took 2 lines of Perl code to add support for onMouseOver events to the @url tag : @url (desc=This link leads to somewhere good) {http://www.andreasen.org} generates the complete JavaScript code.
  • Automatic table-of-contents creation and NAME tag validation (like the one used in my MERC Programming FAQ)
  • Style is controlled centrally - recently (April 99) I changed the way that headings look on these pages. With smartHTML, I had to change code in only one place!
  • It automatically find WIDTH= and HEIGHT= on images using the Image::Size module
  • It includes a small Perl template module which allows for some nifty things like automatic fillout of forms from submitted data and easy form validation with visual feedback

I have since changed all my pages to use SmartHTML (there is a HTML -> SL conversion program).

How to...

This section deals with how I, and other people, have implemented various things using SmartHTML.

Download

Source, example pages and setup: smart.tar.gz - 44K.

[New!] RPM now available - SmartHTML.rpm - 48K.

This is version 1.7 (see Changes file) - now with documentation!

SmartHTML is Public Domain. Commercial support is available, contact me.

What's new
Nov 16 A few user contributions to LeakTracer
Sep 19 The wonderful world of CSS
Feb 13 New XEmacs elisp -- C/C++ utilities

Site navigation


External links for this page