Hacks to comments

Hacked Vellum a bit to be a bit faster, not that anyone will notice. Whole thing needs a boot in the arse to shape up, but it might stop the problem with pages timing out when people submit comments.

I’ve also changed the comments plugin so that it parses people’s comments with Mark’s PyTextile, which should suppress the problems with comments not having any formatting or carriage returns. Oh, and we then strip all tags except A, STRONG, EM, CODE, and PRE from comments, and only allow HREF attributes, using Itamar Shtull-Trauring’s StrippingParser.

And just for the hell of it, since I had a JavaScript implementation of Textile lying around anyway for something else that I wrote, I threw in a “Preview” button for comments that doesn’t submit back to the server but does do the Textile parsing. Minor hacks all round.

Next, I need to boot Vellum’s DB up the arse, and stop it being a DB at all. (My idea is: a blogging system relies on a big DB listing all the entries, and that’s what an RSS feed is, so why not just have all your entries stored in one big RSS file? XML parsers are fast, you can pick out one entry easily, you can store all the stuff that your blogging system cares about specially by inventing your own elements in the RSS with a specific Vellum (or whatever) namespace. In the dim future you should also be able to XSLT the database file directly into output with no code processing on the way, which would be Damned Cool.)

I also ned to redesign this place again, although that might just be Zen Garden envy…

6 Responses to “Hacks to comments”

  1. I used a pile of XML files for my personal blog system, with basically a lot of XSLT to produce the HTML. There’s a bit of python in there to get all the XML into one giant input tree to feed to the XSLT transform engine.

    If I were going to start over, I don’t think I’d go this way. XSLT is cool in that it is declarative, but eventually you just want to be able to use the imperative voice with your programs. XSLT eventually runs out of gas, and the coding style begins to feel like a limiting quirk than a brave new paradigm.

    Ned Batchelder
  2. In Opera 7.20 the layout breaks horribly, the divs are jumping all over and it was hard just to click here to post this!

    KO
  3. That was much the same as my initial thought: “not that fast, they’re not“.

    Might be able to sidestep it a bit by doing SAX parsing—catching elements as they fly out of the parser rather than building a big ol’ DOM representation—but that’s harder to work with. (Probably need a DOM to run XPath queries against, and AIUI XSLT essentially boils down to a bunch of XPath…)

    James Kew
  4. XML is a dangerous route to go down, especially when shoving everything into one file.

    My own developing CMS uses individual XML files in the file system (i.e. no DB). After a lot of testing to perfect this system, I discovered that once your XML file hits a few thousand entries (not unheard of in the blogosphere) most XML parsers eat memory. Gigabytes of memory can be consumed in the process of picking individual entries.

    Gary F
  5. Actually, at this point I think I’d settle for no talent but the ability to copy.
    Not that I’d ever do that. Not that web design is 95% plagiarism and 5% disguise. The people to whom this does not apply go on to be Douglas Bowman or Jeff Zeldman and make a ton of money…

    sil
  6. Argh, agony, why can’t I design as well as the damned CSS Zen Garden people? It isn’t fair!Wish I had one nugget of talent.

    sil