Estax v1.0
Jan 25 2009
Estax (Easy Static XML) is a minimalist tool for generating static websites. It is
especially useful if you want to write a static website containing only a few pages,
but don't want to copy and paste menu HTML, and also don't want to use PHP or a full-blown
CMS. You write your site content in a single, simple XML file and Estax generates the individual
pages from it. Use it for seldomly updated and/or private sites, documentation, or when
you have a restrictive web host.Use Estax if you just want to keep it simple.
Advantages
- You don't need CGI or any scripting language installed on your web host
- You don't need a webserver (with scripting languages) installed on your desktop to preview your page
- Static pages mean high performance, no security issues with scripting bugs
- No special software or web interface for editing content, just use your favourite text editor to edit the content
- Apart from the Estax-specific tags, you can still use normal HTML
- If you ever want to move your site, it's just a matter of copying files - no database dumping etc.
- Automatically generates menu, supports syntax-highlighting (via SHJS), can generate tag cloud
- No dynamic content (comments, forums, calendars or similar)
- Static pages mean slight size overhead on the server
- You have to write your own style sheet, but you probably have one anyways which you can tweak to work with Estax. Or, you can use and/or modify the stylesheet of this web site.
You actually see how the output of Estax can look like right now, as this website was generated using Estax. A simple example for your site content could look like this:
<site version="1.0" stylesheet="style.css" codestyle="vim-dark" title="My Homepage" favicon="favicon.ico" author="Andreas Textor"> <menu> <!-- Each link leads to a page that contains all boxes that contain the tag --> <link tag="home"/> <link tag="code"/> </menu> <box date="2009-01-24" title="Welcome to my Homepage"> <!-- This tag makes this box appear on the "home"-page --> <tag tag="home"/> <!-- Use a special tag to create a separate site containing only this box --> <tag tag="welcome-to-my-homepage"/> <content> Hello World! I added a new program on the <link tag="downloads"/> section! <!-- Write your regular HTML here --> </content> </box> <box date="2009-01-23" title="Hello World"> <tag tag="code"/> <content> This is how Hello World is written in C:<br/> <listing language="c"> #include<stdio.h> int main() { println("Hello World\n"); return 0; } </listing> </content> </box> </site>Using this XML, Estax creates three pages: home.xhtml, welcome-to-my-homepage.xhtml (each containing the menu and the first box) and code.xhtml which contains the menu and the second box with the listing. You would extend this page by adding more boxes tagged as "home" or "code". With one more box tagged as "code", code.xhtml would then contain the menu and the two boxes. Therefore, the tags are no(t only) fancy Web-2.0-stuff but are actually used to create the structure of the website. If one page contains more than one box, the date attribute determines the order of the boxes.
Documentation
See Estax-documentation for details.
Download
Estax Documentation
Jan 25 2009
Estax transforms a single XML file with a certain format into a number
of XHTML pages. The pages can contain a menu with links to other pages,
headers and footers, and a number of "boxes" that represent the content.
Each box can have a title and a date and a number of tags that serve two
purposes: They describe the content of that box, and they are used to
determine which boxes should form a page. Every box with tag XYZ will be
included on page XZY, which will be created by Estax as XYZ.xhtml (it is
encouraged to always write all tags in lower case though, to avoid problems
with broken links).Your content XML has the following structure:
<site> <header><!-- HTML --></header> <footer><!-- HTML --></header> <menu> <link tag="sometag"/> <link tag="category"> <menu> <link tag="subcategory"/> <!-- more links --> </menu> </link> <!-- more links --> </menu> <box> <tag tag="sometag"/> <!-- more tags --> <content> <!-- HTML --> </content> </box> <!-- more boxes --> </site>menu, header and footer are optional, as are the tags in boxes.
You write your page in this format, e.g. site.xml (the name is up to you, it just has to end with .xml), then type "make". Estax generates a directory "site" which contains the generated HTML.
Tag descriptions
XML-Tag | Description |
---|---|
site |
The outermost ("root") tag of the site. This has the following attributes:
|
header | Optional. Has no attributes. Fill this with HTML; it is displayed above the menu. |
footer | Optional. Has no attributes. Fill this with HTML; it is displayed below the boxes. |
menu | Optional. Has no attributes. Contains <link>s. |
link |
This has the following attributes:
|
box |
The box is used to represent a unit of content, or a section; boxes can not be nested though.
Each box has title and date, some content and an automatically generated tag list. It has
the following attributes:
|
tag |
This has the following attributes:
|
tagcloud | Has no attributes. Creates a cloud of tags that link to the respective pages. If you want a separate tags page, create a box with a content that contains only <tagcloud>. |
listing |
This has the following attributes:
|
space | Has no attributes. Generates a single nonbreakable space in the resulting HTML. Note that if you use a &bsp; directly, this will be not appear as an entity in the HTML but will be evaluated by Estax. |
Syntax Highlighting
To get nice syntax highlighting you have to do the following:
- Go to http://shjs.sourceforge.net/ and select a theme you like. Download sh_main.js, the theme css (from here) and the language definition files you like to use from here.
- Put the files (say, sh_main.js, sh_vim-dark.css and sh_scala.js) in the directory where your content XML is.
- In <site> set the codestyle attribute to "vim-dark", then write <listing language="scala"> ... <listing>.
Estax Stylesheets
The easiest way to generate a CSS for an Estax-generated page is to look at the page source. Basically, a <box> becomes a <div>, the <menu> becomes a <div> with the "menu" class and the <link>s within become a <ul>. You can look at the stylesheet of this page to see how it can be written.