Jim's Depository

this code is not yet written

48 hours in and I’ve crossed the 1000 line mark for combined HTML and PHP. I will soon need to add a ‘next page’ function to the front page as we go past the 10 article cutoff. I think I’ll take that opportunity to shrink the code somewhat.

I’m not happy with the

getting duplicated in all the primary files, but sometimes I want to tweak it and I’m not sure how to best do that. Maybe I can leave some expandable markers in the standard , and when the primary page calls the WriteHead() function it could pass in a dictionary of marker expansions.

Likewise the DIV structure to make the left and right columns on the pages is replicated in all the primary pages. I’d like to make that go away, but somehow the WritePageFront()…writemystuff…WritePageBack() does not appeal. I dislike having the front code and back code split apart like that. Pasting up the inside as a string is ugly. Passing in a function to write the middle might be the way to go. Perhaps as an entry in a dictionary like WriteHead(). It would be much nicer in a language with continuations.

I pulled the boilerplate html into a NormalPageTop() and NormalPageBottom() function. It looks gross, but it gets it all together in one spot. Each of these takes a dictionary argument to supply non-standard values for various pieces of the boilerplate.

This gets femtoblogger back to right at 1000 lines of code with the RSS feed added.

Update: and right back over 1000. I changed things around so clicking on an article title takes you to a page with just that article. There is now a little edit pencil on the articles to edit them, like on the comments.