Getting started

I was able to get things to a good start over vacation. The repo is set up, some code is checked in, and I'm able to use the most common tags to generate pages for individual&nbsp;articles.

Most of the heavy thinking about this project has been done. I’ve spent spare and stolen hours over the last four years slowly prototyping various pieces of it, using other projects as scaffolding. All that remains is to put in the time to do it correctly. In other words, this is the fun part!

<h2>Next up</h2>

I’m using the [/wishlist|wish list] as my to-do list, and next up is <tt>[ccce11]</tt>, “Cache metas and HTML with SQLite”, which is kind of a big one. Because it will eventually involve all the logic for Series and Notes, I may as well start laying that all out right now, so this step will take a bit more time.

What I have started is a single module, <code>crystalize.rkt</code>, that is used from within templates to save and retrieve articles. This will work similarly to one in use at The Notepad], and is being implemented for similar reasons: it’s the fastest way I’ve found to cache HTML that depends on relationships between different Pollen documents. This will be the only module that knows anything about SQL. Posts and metas go in, and strings (mostly HTML) come&nbsp;out.

<h2>Templates</h2>

On another note, I am pretty stoked about the use of for building “template functions”. Check out and how it uses the splicing operator in “Pollen mode” to return a value that is basically a reusable, parameterized snippet of HTML. Compare with (the actual template) that contains almost no HTML, just calls to these template functions. This centralizes the page-level markup and makes it easy to change everywhere if I want to later&nbsp;on.

<h2>“Code docs”</h2>

The “code docs” link in the header of this repo doesn’t work yet. Eventually this will link to Scribble documentation for the source code itself.

I am toying with the idea of generating these docs by writing all my Racket code as I want to test to make sure I can do it without too big of a performance penalty when rendering the site, however. I’m also not sure I can use the reader from <code>#lang inside a document, so even if I do go this route I’ll likely still have to mix in some plain Scribble documentation and leave some files as plain Racket.

Incidentally, this feature of the repo is a big reason I lifted fonts and styles from Racket’s styles. Besides the fact that they look good and are available under a permissive license, it’s an issue of continuity. <i>The Local Yarn</i> will have three distinct areas or levels: the main site (main floor and upper stories), this repo (the basement), and the Scribble docs (sub-basement). I’d rather avoid having three drastically different designs to confuse people, and the middle one is the easiest to customize. I tried at first to make it look more like the main site, but results were rough since the repo needs to present very different kinds of information than the main site. The styles fit much more nicely.