ViEmu 1.2 Release Candidate out, & html macro language

I have finished implementing and packaging ViEmu 1.2, and sent out an initial release to current customers and interested users. It includes folding support and window-command support as in vim (I think none of these was in the original vi). By the way, it is already using the C++ string class I talked about in the last post – not heavy use yet, but already using it. After a bit of testing of this release candidate (as the version has already been released), I will be announcing it and putting it up for download on the main page.

The main web site is built with simple, static html files. There is quite a lot of repetition, both for common elements like the navigation bar and for common parts such as general layout. I guess that must be the case with many sites. I’ve been wanting to add two new sections to the web site during the last weeks, but having to update those elements on all pages was not something I wanted to do. I am going to set up a sensible framework such that those elements don’t have to be updated in many places.

I think many sites use a dynamic mechanism, such as ASP or PHP, to avoid replicating such elements. This blog, for example, which is based in WordPress, does such things. But I do not want to switch the whole site to a dynamic system – it seems absurd to evaluate code in each page-request when it can be a one-time-off that generates the proper html files.

I do the html and css by hand, using vim, and I like to have that kind of control. I don’t know of any system that provides what I want – some kind of “macro preprocessor” for html pages. My idea is that I will be writing “.hs” (“html source”) files, and a preprocessor will be preprocessing them to generate the actual html files. There will be a “.hi” (“html include”) file with the common element definitions.

It’s not that I like to do stuff from scratch, but I’ve never heard of tools to do such a thing. I’ve checked the “m4” macro preprocessor, but the main problem I see is that it is leant towards single-line macros – and most definitions that I’d be using will be multi-line. It need be comfortable to use in such a case.

Unless I find out about a tool that does this, I will be writing it myself. It should only take a couple of hours to get it working. If you know of such a tool, I’d be very grateful if you leave a comment here.

It’s good to see how, as months pass, I’m getting to automate common tasks and the general “work environment” is better every week. Starting from scratch, you have to live with many cumbersome methodologies for some time, but if you are patient it’s very satisfying to improve each part little by little: I can already develop text-encoding-independent text-processing code, I will be able to restructure the web site easily, … I’m dying to develop a dual installer for Visual Studio 2003 / Visual Studio 2005 (for ViEmu) and take out another thorn!

10 Responses to “ViEmu 1.2 Release Candidate out, & html macro language”

  1. Ritesh Nadhani Says:

    You can use Dreamweavers library option to do that. Even Webyog.com serves static pages (they are better indexed by Google) and we use Libraries with Dreamweaver.

  2. Dimitris Giannitsaros Says:

    CityDesk also works this way. Check it out (it’s free for 50 pages, but costs $300 for more pages)

  3. J Says:

    Thanks for your comments. Dreamweaver’s price tag is probably way too much for my purpose, and from my knowledge of CityDesk, it is also probably way too much. I’ll probably have a look at CityDesk just in case.

    The deal is that I don’t want to lose the control I have when doing the html and css directly.

  4. Christian Sauer Says:

    Why not just use regular server side include statements?
    a simple should do the trick without any complications…

  5. Christian Sauer Says:

    doh … it swallowed the code is what I had (remove spaces where appropriate)

  6. Christian Sauer Says:

    doh times two!! http://hoohoo.ncsa.uiuc.edu/docs/tutorials/includes.html

  7. J Says:

    Thanks for the pointer, Christian. I’ve had a looked at both the NCSA httpd SSI documentation and the Apache one (as that is what my hosting service provides). I’m not much of a web administrator, so server-side stuff is a bit scary for me.

    OTOH, I still think a static solution is simpler, and I also prefer to have all common sections in one or just a handful of files, instead of having one file per reusable sequence (that way I can comfortably include the latest-version downloadable filename, etc…).

    I find it hard to believe nobody’s done or made available a simple stand-alone preprocessor like this before… (I could also use the C/C++ preprocessor! but it’s so kludgy for multiline macros…)

  8. Henrik Jernevad Says:

    CityDesk (http://www.fogcreek.com/citydesk/) might be a solution to the dynamic/static HTML problem. It’s not a preprocessor but a CMS, but it does what you want.

  9. lena Says:

    Couldn’t you just use any template language? I used to use cheetah for this (http://www.cheetahtemplate.org/). A template language can do much more than this, of course (don’t let the documentation overwhelm you), but they are usually pretty easy to use for simple tasks.

  10. J Says:

    lena: Thanks thanks thanks thanks!

    I’ve had a very brief look at it and it looks exactly like what I was asking for! (Only on steroids, but that’s no problem)

    I’m off to download it.

Leave a Reply