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

Overview
Comment:The footer is here. Closes [87f985fb5b] and [751a7ebc2a]
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 2c0b202bc28e5fb6a13926db074edcda9050611dad6be7ebafb1fe8cf059f288
User & Date: joel on 2020-02-08 17:56:34
Other Links: manifest | tags
Context
2020-02-10
17:28
Improved footer check-in: 75502f96 user: joel tags: trunk
2020-02-08
17:56
The footer is here. Closes [87f985fb5b] and [751a7ebc2a] check-in: 2c0b202b user: joel tags: trunk
2020-02-02
04:53
Include bold type check-in: 4fecf9d9 user: joel tags: trunk
Changes

Modified cache.rkt from [7fc7c05e] to [42c939a6].

5
6
7
8
9
10
11


12
13
14
15
16
17
18
..
23
24
25
26
27
28
29
30

31
32
33
34
35
36
37
...
197
198
199
200
201
202
203








(require deta
         db/base
         db/sqlite3
         threading
         pollen/setup
         racket/match


         "dust.rkt"
         (except-in pollen/core select))

(provide init-cache-db!
         cache-conn                     ; The most eligible bachelor in Neo Yokyo
         (schema-out cache:article)
         (schema-out cache:note)
................................................................................
         current-plain-title
         articles
         articles+notes
         listing-htmls
         <listing-full>
         <listing-excerpt>
         <listing-short>
         unfence)


;; Cache DB and Schemas

(define DBFILE (build-path (current-project-root) "vitreous.sqlite"))
(define cache-conn (sqlite3-connect #:database DBFILE #:mode 'create))

(define current-plain-title (make-parameter "void"))
................................................................................
          ,@(listing-htmls (query-func 'short #:series s #:limit lim #:order ord))
          "</ul>")) ;;                 ^^^^^^

;; Remove "<style>" and "</style>" introduced by using ->html on docs containing output from
;; listing functions
(define (unfence html-str)
  (regexp-replace* #px"<[\\/]{0,1}style>" html-str ""))














>
>







 







|
>







 







>
>
>
>
>
>
>
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
..
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
...
200
201
202
203
204
205
206
207
208
209
210
211
212
213

(require deta
         db/base
         db/sqlite3
         threading
         pollen/setup
         racket/match
         (rename-in racket/list
                    (group-by group-list-by))
         "dust.rkt"
         (except-in pollen/core select))

(provide init-cache-db!
         cache-conn                     ; The most eligible bachelor in Neo Yokyo
         (schema-out cache:article)
         (schema-out cache:note)
................................................................................
         current-plain-title
         articles
         articles+notes
         listing-htmls
         <listing-full>
         <listing-excerpt>
         <listing-short>
         unfence
         series-grouped-list)

;; Cache DB and Schemas

(define DBFILE (build-path (current-project-root) "vitreous.sqlite"))
(define cache-conn (sqlite3-connect #:database DBFILE #:mode 'create))

(define current-plain-title (make-parameter "void"))
................................................................................
          ,@(listing-htmls (query-func 'short #:series s #:limit lim #:order ord))
          "</ul>")) ;;                 ^^^^^^

;; Remove "<style>" and "</style>" introduced by using ->html on docs containing output from
;; listing functions
(define (unfence html-str)
  (regexp-replace* #px"<[\\/]{0,1}style>" html-str ""))

;;
;;  ~~~ Fetching series ~~~
;;
(define (series-grouped-list)
  (~> (for/list ([row (in-entities cache-conn (from cache:series #:as s))]) row)
      (group-list-by cache:series-noun-plural _ string-ci=?)))

Modified index.html.pp from [eb78d203] to [511f6fe5].

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
..
85
86
87
88
89
90
91

92
93
94
95
96
97
98
#lang pollen

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

◊(require pollen/template db/base racket/list racket/match)

◊(define (fetch-series)
  (define q "SELECT noun_plural, page, title FROM series ORDER BY noun_plural DESC")
  (query-rows cache-conn q))

◊(define (series-item->txpr s)
  (match-define (list n pagenode title) s)
  `(li (a [[href ,pagenode]] (i ,title))))

◊(define (series-grouped-list)
  ;; Produces '((("noun1" "p.html" "Title") ("noun1" "q.html" "Title")) (("noun2" ...) ...))
  (define init-group
    (group-by first (map vector->list (fetch-series)) string-ci=?))
  
  (define series-list-items
    (for/list ([group (in-list init-group)])
      `(div (h2 ,(first (first group))) (ul ,@(map series-item->txpr group)))))
  `(section [[class "series-list"] [style "margin-top: 1.3rem"]] ,@series-list-items))
            

<!DOCTYPE html>
<html lang="en">
◊html$-page-head["The Local Yarn" #f]
<style>
  header#front-page {
    text-align: center;
  }
................................................................................
(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)


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





|
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







 







>



|



1
2
3
4
5
6
7



















8
9
10
11
12
13
14
..
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#lang pollen

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

◊(require pollen/template racket/file)
            



















<!DOCTYPE html>
<html lang="en">
◊html$-page-head["The Local Yarn" #f]
<style>
  header#front-page {
    text-align: center;
  }
................................................................................
(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 [223b34de] to [9872e7c1].

47
48
49
50
51
52
53

54
55
56
57
58
59
60
..
90
91
92
93
94
95
96

97
98
99
100
101
102
103
# render, triggering this rule for that series.
$(series-html): %.html: %.poly.pm
	raco pollen render $@
	tidy -quiet -modify -indent --wrap 100 --wrap-attributes no --tidy-mark no $@ || true

index.html: $(core-files) $(html-deps) $(series-html) index.html.pp
	raco pollen render index.html


# This target will also rebuild pg2, pg3, etc. as needed
blog-pg1.html: $(core-files) $(html-deps) $(articles-html) blog.rkt
	rm -f blog*.html
	racket -tm blog.rkt
	tidy -quiet -modify -indent --wrap 100 --wrap-attributes no --tidy-mark no blog*.html || true

................................................................................
		--exclude=.fslckout \
		--exclude='*.ltx' \
		--exclude='*.swp' \
		--exclude=.DS_Store \
	    --exclude='template*.*' \
		--exclude=makefile 
	rm -rf ~/Desktop/publish


scribble: ## Rebuild code documentation and update Fossil repo
	scribble --htmls +m --redirect https://docs.racket-lang.org/local-redirect/ code-docs/main.scrbl
	fossil uv rm scribbled/*
	rm -rf scribbled/*
	mv main/* scribbled/
	cp code-docs/scribble-iframe.html scribbled/scribble.html







>







 







>







47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
..
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# render, triggering this rule for that series.
$(series-html): %.html: %.poly.pm
	raco pollen render $@
	tidy -quiet -modify -indent --wrap 100 --wrap-attributes no --tidy-mark no $@ || true

index.html: $(core-files) $(html-deps) $(series-html) index.html.pp
	raco pollen render index.html
	fossil uv add scribbled/site-footer.html

# This target will also rebuild pg2, pg3, etc. as needed
blog-pg1.html: $(core-files) $(html-deps) $(articles-html) blog.rkt
	rm -f blog*.html
	racket -tm blog.rkt
	tidy -quiet -modify -indent --wrap 100 --wrap-attributes no --tidy-mark no blog*.html || true

................................................................................
		--exclude=.fslckout \
		--exclude='*.ltx' \
		--exclude='*.swp' \
		--exclude=.DS_Store \
	    --exclude='template*.*' \
		--exclude=makefile 
	rm -rf ~/Desktop/publish
	fossil uv sync

scribble: ## Rebuild code documentation and update Fossil repo
	scribble --htmls +m --redirect https://docs.racket-lang.org/local-redirect/ code-docs/main.scrbl
	fossil uv rm scribbled/*
	rm -rf scribbled/*
	mv main/* scribbled/
	cp code-docs/scribble-iframe.html scribbled/scribble.html

Modified snippets-html.rkt from [9386bc7c] to [56f8da66].

9
10
11
12
13
14
15

16
17
18
19

20
21
22

23
24
25
26
27
28
29
..
69
70
71
72
73
74
75
76












77
78


79
80
81
82
83
84
85
86
...
194
195
196
197
198
199
200










         pollen/decode
         pollen/private/version
         racket/string
         racket/function
         racket/list
         txexpr
         openssl/sha1

         "dust.rkt")

(provide html$-page-head
         html$-page-body-open

         html$-article-open
         html$-article-close
         html$-article-listing-short

         html$-page-body-close
         html$-note-contents
         html$-note-listing-full
         html$-note-in-article
         html$-notes-section
         html$-paginate-navlinks)

................................................................................

(define (html$-article-listing-short pagenode pubdate title)
  ◊string-append{
 <li><a href="/◊(symbol->string pagenode)">
 <div class="article-list-date caps">◊(ymd->english pubdate)</div>
 <div class="article-list-title">◊|title|</div>
 </a></li>})













(define (html$-page-body-close)
  ◊string-append{<footer>By Joel Dueck</footer>


 </main></body>})

;; Notes
;;
(define (html$-note-contents disposition-mark disposition-verb elems)
  (define disposition
    (cond [(non-empty-string? disposition-mark)
           `(abbr [[class "disposition-mark-in-note"]
................................................................................

  (define next-link
    (if (eq? pagecount pagenum)
        "<li class=\"nav-text inactive-link\">Older&rarr;</li>"
        (page-func (+ pagenum 1) "Older&thinsp;&rarr;" "nav-text")))

  (string-join `(,prev-link ,@page-group ,next-link)))

















>




>



>







 








>
>
>
>
>
>
>
>
>
>
>
>

|
>
>
|







 







>
>
>
>
>
>
>
>
>
>
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
..
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
...
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
         pollen/decode
         pollen/private/version
         racket/string
         racket/function
         racket/list
         txexpr
         openssl/sha1
         "cache.rkt"
         "dust.rkt")

(provide html$-page-head
         html$-page-body-open
         html$-series-list
         html$-article-open
         html$-article-close
         html$-article-listing-short
         html$-page-footer
         html$-page-body-close
         html$-note-contents
         html$-note-listing-full
         html$-note-in-article
         html$-notes-section
         html$-paginate-navlinks)

................................................................................

(define (html$-article-listing-short pagenode pubdate title)
  ◊string-append{
 <li><a href="/◊(symbol->string pagenode)">
 <div class="article-list-date caps">◊(ymd->english pubdate)</div>
 <div class="article-list-title">◊|title|</div>
 </a></li>})

(define (html$-page-footer)
  ◊string-append{
<footer id="main">
 <h1>The Local Yarn</h1>
 <p><a href="/">Home</a> •
    <a href="/blog-pg1.html">Blog</a> •
    <a href="/keyword-index.html">Keyword Index</a> •
    <a href="/code"><i><code>(Source Code)</code></i></a>
 </p>
 ◊(html$-series-list)
 </footer>})

(define (html$-page-body-close)
  ◊string-append{
 </main>
 ◊(html$-page-footer)
 </body>})

;; Notes
;;
(define (html$-note-contents disposition-mark disposition-verb elems)
  (define disposition
    (cond [(non-empty-string? disposition-mark)
           `(abbr [[class "disposition-mark-in-note"]
................................................................................

  (define next-link
    (if (eq? pagecount pagenum)
        "<li class=\"nav-text inactive-link\">Older&rarr;</li>"
        (page-func (+ pagenum 1) "Older&thinsp;&rarr;" "nav-text")))

  (string-join `(,prev-link ,@page-group ,next-link)))

(define (series->txpr s)
  `(li (a [[href ,(symbol->string (cache:series-page s))]]
          (i ,(cache:series-title s)))))

(define (html$-series-list)
  (define series-list-items
    (for/list ([group (in-list (series-grouped-list))])
      `(div (h2 ,(cache:series-noun-plural (first group))) (ul ,@(map series->txpr group)))))
  (->html `(section [[class "column-list"] [style "margin-top: 1.3rem"]] ,@series-list-items)))

Modified web-extra/martin.css.pp from [7cbcbc97] to [f7b75dc6].

630
631
632
633
634
635
636
637
638
639
640
641
642
643
644



645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
...
682
683
684
685
686
687
688










689
690
691
692
693
694
695
div.article-list-title {
    font-size: 1.2rem;
}

/* ******* (Mobile first) Columnar series list styling *******
 */

.series-list {
    display: grid;
    grid-template-columns: repeat(auto-fill,8em);
    place-content: center;
}

.series-list div {
    padding-left: 0.25em; /* Keeps some italic descenders inside the box */



}

.series-list h2 {
    font-feature-settings: "smcp" on;
    text-transform: lowercase;
    font-weight: normal;
    font-size: 1em;
    margin: 0;
}

.series-list ul {
    margin-top: 0;
    list-style-type: none;
    padding: 0;
}

/* ******* (Mobile first) Keyword Index styling *******
 */
................................................................................
    padding: 0;
}

#keywordindex ul ul {
    margin-left: 0.5em;
    font-size: smaller;
}











/* End of mobile-first typography and layout */


/* Here’s where we start getting funky for any viewport wider than mobile portrait.
   An iPhone 6 is 667px wide in landscape mode, so that’s our breakpoint. */








|
|
|
|


|

>
>
>


|







|







 







>
>
>
>
>
>
>
>
>
>







630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
...
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
div.article-list-title {
    font-size: 1.2rem;
}

/* ******* (Mobile first) Columnar series list styling *******
 */

.column-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-evenly;
}

.column-list div {
    padding-left: 0.25em; /* Keeps some italic descenders inside the box */
    margin: 0 0.5rem;
    text-align: left;
    width: 8rem;
}

.column-list h2 {
    font-feature-settings: "smcp" on;
    text-transform: lowercase;
    font-weight: normal;
    font-size: 1em;
    margin: 0;
}

.column-list ul {
    margin-top: 0;
    list-style-type: none;
    padding: 0;
}

/* ******* (Mobile first) Keyword Index styling *******
 */
................................................................................
    padding: 0;
}

#keywordindex ul ul {
    margin-left: 0.5em;
    font-size: smaller;
}

/* Footer ***** */

footer#main {
  text-align: center;
  margin-top: ◊x-lineheight[1];
  padding-top: ◊x-lineheight[1];
  background: #dedede;
  border-top: dotted ◊color-bodytext 2px;
}

/* End of mobile-first typography and layout */


/* Here’s where we start getting funky for any viewport wider than mobile portrait.
   An iPhone 6 is 667px wide in landscape mode, so that’s our breakpoint. */