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

Overview
Comment:Implement basic SQLite caching (closes [ccce11c15])
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 0b455f1f02d3717373f5a401b2e7c5ec5c88c398d3731677601a82968017a2a3
User & Date: joel on 2018-08-26 18:13:23.402
Other Links: manifest | tags
Context
2018-09-02
21:04
Add Flammarion engraving to home.wiki check-in: 4ec64ff2 user: joel tags: trunk
2018-08-26
18:13
Implement basic SQLite caching (closes [ccce11c15]) check-in: 0b455f1f user: joel tags: trunk
2018-08-22
02:45
Correct unit test in dates.rkt check-in: 6034c1b0 user: joel tags: trunk
Changes
Added crystalize.rkt version [c9502c11].
Modified pollen.rkt from [08e62a8c] to [8a4112bd].
︙︙
28
29
30
31
32
33
34
35

36
37
38
39
40
41
42
43
44
45
46
47

48
49
50
51
52
53
54
                     syntax/parse
                     pollen/setup))

(require pollen/tag
         pollen/setup
         racket/function
         "tags-html.rkt"
         "template-html.rkt")


(provide (all-defined-out)
         (all-from-out "template-html.rkt"))

(module setup racket/base
  (require syntax/modresolve)
  (provide (all-defined-out))
  (define poly-targets '(html))
  (define cache-watchlist
    (map resolve-module-path '("tags-html.rkt"
                               "template-html.rkt"
                               "dates.rkt"))))


;; Macro for defining tag functions that automatically branch based on the 
;; current output format and the list of poly-targets in the setup module.
;; 
(define-syntax (poly-branch-tag stx)
  (syntax-parse stx
    [(_ TAG:id)







|
>


|








|
>







28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
                     syntax/parse
                     pollen/setup))

(require pollen/tag
         pollen/setup
         racket/function
         "tags-html.rkt"
         "template-html.rkt"
         "crystalize.rkt")

(provide (all-defined-out)
         (all-from-out "crystalize.rkt" "template-html.rkt"))

(module setup racket/base
  (require syntax/modresolve)
  (provide (all-defined-out))
  (define poly-targets '(html))
  (define cache-watchlist
    (map resolve-module-path '("tags-html.rkt"
                               "template-html.rkt"
                               "dates.rkt"
                               "crystalize.rkt"))))

;; Macro for defining tag functions that automatically branch based on the 
;; current output format and the list of poly-targets in the setup module.
;; 
(define-syntax (poly-branch-tag stx)
  (syntax-parse stx
    [(_ TAG:id)
︙︙
Added sqlite-tools.rkt version [22818cf3].
︙︙
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67

68
69
70

;; Provides functions for displaying content in HTML templates.
(require pollen/core
         "dates.rkt")

(provide (all-defined-out))

(define (ht-head [title #f])
  ◊@{<head>
     <title>The Local Yarn◊when/splice[title]{: ◊title}</title>
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1">
     <link rel="stylesheet" type="text/css" href="/web-extra/martin.css">
     </head>})

(define (ht-page-top)
  ◊@{<body><main>
     <a href="/"><header>
     <img src="/web-extra/logo.png" height="103" width="129" class="logo">
     <h1>The Local Yarn</h1>
     </header></a>})

(define (ht-article-header)
  (define title (select-from-metas 'title (current-metas)))
  (define published (select-from-metas 'published (current-metas)))
    (cond
      [title
       ◊@{<article class="with-title hentry">
          <h1 class="entry-title">◊|title|</h1>
          <p class="time"><a href="#" class="rel-bookmark">
          <time datetime="◊published" class="published">◊ymd->english[published]</time>
          </a></p>
          <section class="entry-content">}]
      [else
       ◊@{<article class="no-title hentry">
          <h1><a href="#" class="rel-bookmark">
          <time datetime="◊published" class="entry-title">◊ymd->english[published]</time>
          </a></h1>
          <section class="entry-content">}]))

(define (ht-article-footer)
  ◊@{</section>
     <footer class="article-info"><span class="x">(</span>Part of ‘Talking About Poetry’. Once I threw a mudball at a birdhouse. I’m not exactly proud of it, though.<span class="x">)</span></footer>
     </article>})
  

(define (ht-page-bottom)
  ◊@{<footer>By Joel Dueck</footer>
     </main></body>})







|







|






|




|






|





|
|


|
>
|


23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71

;; Provides functions for displaying content in HTML templates.
(require pollen/core
         "dates.rkt")

(provide (all-defined-out))

(define (html-head [title #f])
  ◊@{<head>
     <title>The Local Yarn◊when/splice[title]{: ◊title}</title>
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1">
     <link rel="stylesheet" type="text/css" href="/web-extra/martin.css">
     </head>})

(define (html-page-top)
  ◊@{<body><main>
     <a href="/"><header>
     <img src="/web-extra/logo.png" height="103" width="129" class="logo">
     <h1>The Local Yarn</h1>
     </header></a>})

(define (html-article-header)
  (define title (select-from-metas 'title (current-metas)))
  (define published (select-from-metas 'published (current-metas)))
    (cond
      [title
       ◊string-append{<article class="with-title hentry">
          <h1 class="entry-title">◊|title|</h1>
          <p class="time"><a href="#" class="rel-bookmark">
          <time datetime="◊published" class="published">◊ymd->english[published]</time>
          </a></p>
          <section class="entry-content">}]
      [else
       ◊string-append{<article class="no-title hentry">
          <h1><a href="#" class="rel-bookmark">
          <time datetime="◊published" class="entry-title">◊ymd->english[published]</time>
          </a></h1>
          <section class="entry-content">}]))

(define (html-article-footer)
  ◊string-append{</section>
     <footer class="article-info"><span class="x">(</span>Part of ‘Talking About Poetry’. Once I threw a mudball at a birdhouse. I’m not exactly proud of it, though.<span class="x">)</span></footer>
     </article>})


(define (html-page-bottom)
  ◊@{<footer>By Joel Dueck</footer>
     </main></body>})
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<!DOCTYPE html>
<html>
◊ht-head[(select-from-metas 'title here)]

◊ht-page-top[]

◊ht-article-header[]
◊(->html (cdr doc))
◊ht-article-footer[]

◊ht-page-bottom[]

</html>



|

|

|
<
|

|



1
2
3
4
5
6
7

8
9
10
11
12
13
<!DOCTYPE html>
<html>
◊html-head[(select-from-metas 'title here)]

◊html-page-top[]

◊spell-of-summoning![]

◊crystalize-article![here doc]

◊html-page-bottom[]

</html>