◊(Local Yarn Code "Tech-note b50fa1f3")

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 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!

Next up

I’m using the wish list as my to-do list, and next up is [ccce11], “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, crystalize.rkt, that is used from within templates to save and retrieve articles. This will work similarly to the 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 out.

Templates

On another note, I am pretty stoked about the use of #lang pollen/mode for building “template functions”. Check out template-html.rkt 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 template.html.p (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 on.

“Code docs”

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 #lang scribble/lp2. 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 #lang pollen/mode inside a scribble/lp2 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 scribble/manual styles. Besides the fact that they look good and are available under a permissive license, it’s an issue of continuity. The Local Yarn 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 scribble/manual styles fit much more nicely.