◊(Local Yarn Code "Check-in [c8598882]")

Overview
Comment:Use new init script & revise makefile to ensure series info is accurate after a clean rebuild
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: c859888259093b5fb3ec1a25f9d5489f6c559bc8fc8895b30391a5bd789024d6
User & Date: joel on 2020-02-20 03:00:14
Other Links: manifest | tags
Context
2020-02-20
03:16
Make cache db connection thread-safe check-in: 37240160 user: joel tags: trunk
03:00
Use new init script & revise makefile to ensure series info is accurate after a clean rebuild check-in: c8598882 user: joel tags: trunk
02:58
CSS for new short-list markup check-in: 6b04a07f user: joel tags: trunk
Changes

Modified code-docs/cache.scrbl from [821a1577] to [379418fa].

    38     38   
    39     39   @defproc[(init-cache-db!) void?]{
    40     40   
    41     41   Creates and initializes the SQLite database cache file (named @filepath{vitreous.sqlite} and located
    42     42   in the project root folder) by running queries to create tables in the database if they do not
    43     43   exist.
    44     44   
    45         -This function is called automatically in @seclink["pollen-rkt"]{@filepath{pollen.rkt}} whenever HTML
    46         -is the target output.
    47         -
    48     45   }
    49     46   
    50     47   @defparam[current-plain-title title-plain non-empty-string? #:value "void"]{
    51     48   
    52     49   Contains (or sets) the “plain” title (i.e., with no HTML markup) for the current article based on
    53     50   analysis done by @racket[parse-and-cache-article!]. If the article did not specify a title,
    54     51   a default title is supplied. If the article contained a @racket[note] that used the

Modified code-docs/main.scrbl from [662fc0af] to [ddb962d8].

    53     53   @include-section["tour.scrbl"]
    54     54   @include-section["design.scrbl"]
    55     55   @include-section["pollen.scrbl"]  @; pollen.rkt
    56     56   @include-section["dust.scrbl"]    @; dust.rkt
    57     57   @include-section["snippets-html.scrbl"] @; you get the idea
    58     58   @include-section["cache.scrbl"]
    59     59   @include-section["crystalize.scrbl"]
           60  +@include-section["other-files.scrbl"]

Added code-docs/other-files.scrbl version [e6f91e53].

            1  +#lang scribble/manual
            2  +
            3  +@; SPDX-License-Identifier: BlueOak-1.0.0
            4  +@; This file is licensed under the Blue Oak Model License 1.0.0.
            5  +
            6  +@(require "scribble-helpers.rkt")
            7  +
            8  +@(require (for-label racket/base "../cache.rkt"))
            9  +
           10  +@title[#:tag "other-files"]{Other files}
           11  +
           12  +@section{Home page (@filepath{index.html.pp})}
           13  +
           14  +Simple Pollen preprocessor file that generates the home page.
           15  +
           16  +@section{Keyword Index (@filepath{keyword-index.rkt})}
           17  +
           18  +Through its provided @tt{main} function, builds the keyword index page by pulling all the index
           19  +entries directly from the SQLite cache and sorting them by first letter.
           20  +
           21  +@section{Blog (@filepath{blog.rkt})}
           22  +
           23  +Through its provided @tt{main} function, creates a paginated listing of all @tech{articles} and
           24  +@tech{notes}.
           25  +
           26  +@section{RSS Feed (@filepath{rss-feed.rkt})}
           27  +
           28  +Through its provided @tt{main} function, creates the RSS feed in the file @filepath{feed.xml}. Both
           29  +articles and notes are included. Any article or note with either @racket["all"] or @racket["feed"]
           30  +in its @racket['conceal] meta is excluded.
           31  +
           32  +@section{Cache initialization (@filepath{util/init.rkt})}
           33  +
           34  +Creates and initializes the cache database with @racket[init-cache-db!] and
           35  +@racket[preheat-series!].
           36  +
           37  +@section{New article template (@filepath{util/newpost.rkt})}
           38  +
           39  +Prompts for a title, creates an article with a normalized version of the filename and today’s date,
           40  +and opens the article in an editor.
           41  +
           42  +

Modified index.html.pp from [511f6fe5] to [5d60b9a7].

    66     66   (almost) is ◊link[1]{arranged in time order, newest first}. There are also a few arranged into named
    67     67   collections:
    68     68   
    69     69   ◊url[1]{/blog-pg1.html}
    70     70   
    71     71   }) 
    72     72   ◊; stop for now: (crystalize-index-entries! '|index.html| front-page-body)
    73         -◊(display-to-file (html$-page-footer) "scribbled/site-footer.html" #:exists 'replace)
    74     73   
    75     74   <main> 
    76     75     ◊(->html front-page-body #:splice? #t)
    77     76     ◊(html$-series-list)
    78     77   </main> 
    79     78   </body>
    80     79   </html>

Modified makefile from [ffa5dcb1] to [fae17d31].

    23     23   web: vitreous.sqlite $(articles-html) $(series-html) 
    24     24   web: index.html blog-pg1.html keyword-index.html web-extra/martin.css feed.xml
    25     25   web: ## Rebuild all web content (not PDFs)
    26     26   
    27     27   # The file vitreous.sqlite is a cache of the rendered HTML and metadata. If it is older than any of
    28     28   # its dependencies (or missing) all of the articles will be rebuilt. Its dependencies are also on
    29     29   # the Pollen cache watchlist (see pollen.rkt)
           30  +#
           31  +# After articles are rendered in this way, all the series pages are "touched", to trick Pollen into
           32  +# re-rendering those pages without relying on its cache. Without this step, it seems those pages
           33  +# are rendered “transitively” during the article render, and the listings are incomplete.
    30     34   vitreous.sqlite: $(core-files) $(html-deps) template.html.p
           35  +	racket -tm util/init.rkt
    31     36   	raco pollen setup -p articles/
    32     37   	raco pollen render -p -t html articles/*.poly.pm
           38  +	touch series/*.poly.pm
    33     39   	raco pollen setup -p series/
    34     40   	raco pollen render -p -t html series/*.poly.pm
    35     41   	rm -f template.html series/template.html
    36     42   	tidy -quiet -modify -indent --wrap 100 --wrap-attributes no --tidy-mark no articles/*.html || true
    37     43   	tidy -quiet -modify -indent --wrap 100 --wrap-attributes no --tidy-mark no series/*.html || true
    38     44   
    39     45   # If the rule for vitreous.sqlite was triggered, all the article HTML files will already have been

Modified pollen.rkt from [5f7205ca] to [19ce46ba].

    38     38       (map resolve-module-path
    39     39            (list tags-html.rkt
    40     40                  snippets-html.rkt
    41     41                  dust.rkt
    42     42                  cache.rkt
    43     43                  crystalize.rkt))))
    44     44   
    45         -(case (current-poly-target)
    46         -  [(html) (init-cache-db!)])
    47         -
    48     45   ;; Macro for defining tag functions that automatically branch based on the 
    49     46   ;; current output format and the list of poly-targets in the setup module.
    50     47   ;; Use this macro when you know you will need keyword arguments.
    51     48   ;;
    52     49   (define-syntax (poly-branch-kwargs-tag stx)
    53     50     (syntax-parse stx
    54     51       [(_ TAG:id)

Added util/init.rkt version [41c57f81].

            1  +#lang racket/base
            2  +
            3  +(require racket/file
            4  +         pollen/setup
            5  +         "../cache.rkt"
            6  +         "../snippets-html.rkt")
            7  +
            8  +(provide main)
            9  +
           10  +(define (main)
           11  +  (init-cache-db!)
           12  +  (preheat-series!)
           13  +  
           14  +  (display-to-file (html$-page-footer)
           15  +                   (build-path (current-project-root) "scribbled" "site-footer.html")
           16  +                   #:exists 'replace))