◊(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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
38
39
40
41
42
43
44



45
46
47
48
49
50
51







-
-
-








@defproc[(init-cache-db!) void?]{

Creates and initializes the SQLite database cache file (named @filepath{vitreous.sqlite} and located
in the project root folder) by running queries to create tables in the database if they do not
exist.

This function is called automatically in @seclink["pollen-rkt"]{@filepath{pollen.rkt}} whenever HTML
is the target output.

}

@defparam[current-plain-title title-plain non-empty-string? #:value "void"]{

Contains (or sets) the “plain” title (i.e., with no HTML markup) for the current article based on
analysis done by @racket[parse-and-cache-article!]. If the article did not specify a title,
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
54
55
56
57
58
59

53
54
55
56
57
58
59
60







+
@include-section["tour.scrbl"]
@include-section["design.scrbl"]
@include-section["pollen.scrbl"]  @; pollen.rkt
@include-section["dust.scrbl"]    @; dust.rkt
@include-section["snippets-html.scrbl"] @; you get the idea
@include-section["cache.scrbl"]
@include-section["crystalize.scrbl"]
@include-section["other-files.scrbl"]

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











































1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
#lang scribble/manual

@; SPDX-License-Identifier: BlueOak-1.0.0
@; This file is licensed under the Blue Oak Model License 1.0.0.

@(require "scribble-helpers.rkt")

@(require (for-label racket/base "../cache.rkt"))

@title[#:tag "other-files"]{Other files}

@section{Home page (@filepath{index.html.pp})}

Simple Pollen preprocessor file that generates the home page.

@section{Keyword Index (@filepath{keyword-index.rkt})}

Through its provided @tt{main} function, builds the keyword index page by pulling all the index
entries directly from the SQLite cache and sorting them by first letter.

@section{Blog (@filepath{blog.rkt})}

Through its provided @tt{main} function, creates a paginated listing of all @tech{articles} and
@tech{notes}.

@section{RSS Feed (@filepath{rss-feed.rkt})}

Through its provided @tt{main} function, creates the RSS feed in the file @filepath{feed.xml}. Both
articles and notes are included. Any article or note with either @racket["all"] or @racket["feed"]
in its @racket['conceal] meta is excluded.

@section{Cache initialization (@filepath{util/init.rkt})}

Creates and initializes the cache database with @racket[init-cache-db!] and
@racket[preheat-series!].

@section{New article template (@filepath{util/newpost.rkt})}

Prompts for a title, creates an article with a normalized version of the filename and today’s date,
and opens the article in an editor.


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

66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
66
67
68
69
70
71
72

73
74
75
76
77
78
79







-







(almost) is ◊link[1]{arranged in time order, newest first}. There are also a few arranged into named
collections:

◊url[1]{/blog-pg1.html}

}) 
◊; stop for now: (crystalize-index-entries! '|index.html| front-page-body)
◊(display-to-file (html$-page-footer) "scribbled/site-footer.html" #:exists 'replace)

<main> 
  ◊(->html front-page-body #:splice? #t)
  ◊(html$-series-list)
</main> 
</body>
</html>

Modified makefile from [ffa5dcb1] to [fae17d31].

23
24
25
26
27
28
29




30

31
32

33
34
35
36
37
38
39
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45







+
+
+
+

+


+







web: vitreous.sqlite $(articles-html) $(series-html) 
web: index.html blog-pg1.html keyword-index.html web-extra/martin.css feed.xml
web: ## Rebuild all web content (not PDFs)

# The file vitreous.sqlite is a cache of the rendered HTML and metadata. If it is older than any of
# its dependencies (or missing) all of the articles will be rebuilt. Its dependencies are also on
# the Pollen cache watchlist (see pollen.rkt)
#
# After articles are rendered in this way, all the series pages are "touched", to trick Pollen into
# re-rendering those pages without relying on its cache. Without this step, it seems those pages
# are rendered “transitively” during the article render, and the listings are incomplete.
vitreous.sqlite: $(core-files) $(html-deps) template.html.p
	racket -tm util/init.rkt
	raco pollen setup -p articles/
	raco pollen render -p -t html articles/*.poly.pm
	touch series/*.poly.pm
	raco pollen setup -p series/
	raco pollen render -p -t html series/*.poly.pm
	rm -f template.html series/template.html
	tidy -quiet -modify -indent --wrap 100 --wrap-attributes no --tidy-mark no articles/*.html || true
	tidy -quiet -modify -indent --wrap 100 --wrap-attributes no --tidy-mark no series/*.html || true

# 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
38
39
40
41
42
43
44



45
46
47
48
49
50
51







-
-
-







    (map resolve-module-path
         (list tags-html.rkt
               snippets-html.rkt
               dust.rkt
               cache.rkt
               crystalize.rkt))))

(case (current-poly-target)
  [(html) (init-cache-db!)])

;; Macro for defining tag functions that automatically branch based on the 
;; current output format and the list of poly-targets in the setup module.
;; Use this macro when you know you will need keyword arguments.
;;
(define-syntax (poly-branch-kwargs-tag stx)
  (syntax-parse stx
    [(_ TAG:id)

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

















1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
#lang racket/base

(require racket/file
         pollen/setup
         "../cache.rkt"
         "../snippets-html.rkt")

(provide main)

(define (main)
  (init-cache-db!)
  (preheat-series!)
  
  (display-to-file (html$-page-footer)
                   (build-path (current-project-root) "scribbled" "site-footer.html")
                   #:exists 'replace))