Index: code-docs/cache.scrbl ================================================================== --- code-docs/cache.scrbl +++ code-docs/cache.scrbl @@ -162,15 +162,22 @@ } @section{Schema} -The cache database has four tables: @tt{articles}, @tt{notes}, @tt{index_entries} and @tt{series}. Each of these has a corresponding schema, shown below. In addition, there is a “virtual” schema, @tt{listing}, for use with queries which may or may not combine articles and notes intermingled. +The cache database has four tables: @tt{articles}, @tt{notes}, @tt{index_entries} and @tt{series}. +Each of these has a corresponding schema, shown below. In addition, there is a “virtual” schema, +@tt{listing}, for use with queries which may or may not combine articles and notes intermingled. -The work of picking apart an article’s exported @tt{doc} and @tt{metas} into rows in these tables is done by @racket[parse-and-cache-article!]. +The work of picking apart an article’s exported @tt{doc} and @tt{metas} into rows in these tables is +done by @racket[parse-and-cache-article!]. -The below are shown as @code{struct} forms but are actually defined with deta’s @racket[define-schema]. Each schema has an associated struct with the same name and a smart constructor called @tt{make-@emph{id}}. The struct’s “dumb” constructor is hidden so that invalid entities cannot be created. For every defined field there is an associated functional setter and updater named @tt{set-@emph{id}-field} and @tt{update-@emph{id}-field}, respectively. +The below are shown as @code{struct} forms but are actually defined with deta’s +@racket[define-schema]. Each schema has an associated struct with the same name and a smart +constructor called @tt{make-@emph{id}}. The struct’s “dumb” constructor is hidden so that invalid +entities cannot be created. For every defined field there is an associated functional setter and +updater named @tt{set-@emph{id}-field} and @tt{update-@emph{id}-field}, respectively. @defstruct*[cache:article ([id id/f] [page symbol/f] [title-plain string/f] [title-html-flow string/f] @@ -245,9 +252,10 @@ [updated string/f] [html string/f]) #:constructor-name make-listing]{ This is a “virtual” schema targeted by @racket[articles] and @racket[articles+notes] using deta’s -@racket[project-onto]. It supplies the minimum set of fields needed to build the RSS feed; most -times (e.g., on @tech{series} pages) only the @tt{html} field is used, via @racket[fenced-listing]. +@racket[project-onto]. It supplies the minimum set of fields needed to build the RSS feed, and which +are common to both articles and notes; most times (e.g., on @tech{series} pages) only the @tt{html} +field is used, via @racket[fenced-listing] or @racket[listing-htmls]. }