On this page:
Local Yarn:   Source Code Notes

Local Yarn: Source Code Notes

Joel Dueck

These are my notes about the internals of the Local Yarn source code. In other words, a personal reference, rather than a tutorial.

You’ll get the most out of these notes if you have read Pollen: the book is a program, and worked through the tutorials there by hand.

Note that these pages are heavily interlinked with the central Racket documentation at docs.racket-lang.org, which are written and maintained by others.

Some links from those pages will not work unless you open this page in its own tab.

Here’s a rough diagram showing how the .rkt modules in this project relate to each other, and to the Pollen source documents. This is the least complex system I could devise that would A) implement everything I want in my Design Goals, B) cleanly separate dependencies for print and web output, and C) organize an ever-growing collection of hundreds of individual notes and articles without noticable loss of speed.

The modules are arranged vertically: those on the upper rows provide bindings which are used by those on the lower rows. The bottom row are the .poly.pm files that make up articles and series.

Individual articles, while they are being rendered to HTML pages, save copies of their metadata and HTML to the SQLite cache. This is done by calling parse-and-cache-article! from within their template.

Any pages that gather content from multiple articles, such as Series pages and the RSS feed, pull this content directly from the SQLite cache. This is much faster than trawling through Pollen’s cached metas of every article looking for matching articles.

    1 How I Publish: A Quick Tour

      1.1 Creating an article

      1.2 Adding notes to an article

      1.3 What’s not here yet

    2 Basic Notions

      2.1 Design Goals

      2.2 Names for things and how they fit together

        2.2.1 Articles

        2.2.2 Notes

 Notes vs. blog “comments”

        2.2.3 Series

 Series vs. blog “categories”

    3 Pollen

      3.1 Markup reference

      3.2 Convenience macros

      3.3 Defining new tags

    4 Defining Series

      4.1 Series list

    5 Dust

      5.1 Constants

      5.2 Metas and txexprs

      5.3 Article parsers and helpers

      5.4 Date formatters

    6 HTML snippets

      6.1 Using pollen/mode

      6.2 HTML Snippet functions

    7 Cache

      7.1 Cache database

      7.2 Retrieving cached data

      7.3 Modifying the cache

      7.4 Schema

    8 Crystalize

    9 Other files

      9.1 Home page ("index.html.pp")

      9.2 Keyword Index ("keyword-index.rkt")

      9.3 Blog ("blog.rkt")

      9.4 RSS Feed ("rss-feed.rkt")

      9.5 Cache initialization ("util/init.rkt")

      9.6 New article template ("util/newpost.rkt")