Marathon coding session
I finally decided on a back end format for this site, and set about implementing it. As I don’t need concurrent updating or anything like that, I’ve decided not to use a database. This is a lightweight site builder.
In fact, I’ve done it through a directory mirroring system. The system consists of nodes and documents whereby each directory represents a node in the hierarchy. The navigation toolbar on the right follows the hierarchy down, expanding at each level. It’s hard to explain (especially at this time of night!) but a quick click around will make it clear. Basically, if you open a node, the next level down is also visible.
The text size and formatting of the navigation toolbar needs tweaking, but I’ll have a look at that later.
At each node, there are a number of documents. I just create files in the directory in some kind of order (0001, 0002, 0003 etc. seems to work) which is then presented on the screen. There’s a limit to how many pages are shown on one screen, so it’s possible to go on to successive pages.
I also implemented a function to do bold and italic formatting, paragraphs etc. without typing HTML. It’s very basic, and I’ll have a look at the Scoop code to see how they did it to see how to improve the operation. Gotta love Perl, though—it makes this kind of stuff very easy. The only thing I really miss is complex data structures...
I’ve done some cool replication stuff with the document formatting that pulls the design out of the template and then stuffs it back multiple times for each page. It is easier to maintain as everything is one one page, formatting-wise.
This page is generated from the program itself, but as it is only a static mirror, the links don’t work...yet. Next step is to get a proper hosting account, and put it to the test! Tomorrow, perhaps.
Time for bed.