|
80 | 80 | #'(make-scribble-post-dep 'mod-path)])
|
81 | 81 |
|
82 | 82 | (define all-post-deps
|
83 |
| - (map markdown-post '("2015-07-18-automatically-deploying-a-frog-powered-blog-to-github-pages.md" |
84 |
| - "2015-08-22-deploying-racket-applications-on-heroku.md" |
85 |
| - "2015-08-30-managing-application-configuration-with-envy.md" |
86 |
| - "2015-09-23-canonical-factories-for-testing-with-factory-girl-api.md" |
87 |
| - "2015-11-06-functionally-updating-record-types-in-elm.md" |
88 |
| - "2015-12-21-adts-in-typed-racket-with-macros.md" |
89 |
| - "2016-02-18-simple-safe-multimethods-in-racket.md" |
90 |
| - "2016-06-03-four-months-with-haskell.md" |
91 |
| - "2016-08-11-climbing-the-infinite-ladder-of-abstraction.md" |
92 |
| - "2016-08-24-understanding-the-npm-dependency-model.md" |
93 |
| - "2016-10-01-using-types-to-unit-test-in-haskell.md" |
94 |
| - "2017-01-02-rascal-a-haskell-with-more-parentheses.md" |
95 |
| - "2017-01-05-rascal-is-now-hackett-plus-some-answers-to-questions.md" |
96 |
| - "2017-04-28-lifts-for-free-making-mtl-typeclasses-derivable.md" |
97 |
| - "2017-05-27-realizing-hackett-a-metaprogrammable-haskell.md" |
98 |
| - "2017-06-29-unit-testing-effectful-haskell-with-monad-mock.md" |
99 |
| - "2017-08-12-user-programmable-infix-operators-in-racket.md" |
100 |
| - "2017-08-28-hackett-progress-report-documentation-quality-of-life-and-snake.md" |
101 |
| - "2017-10-27-a-space-of-their-own-adding-a-type-namespace-to-hackett.md" |
102 |
| - "2018-02-10-an-opinionated-guide-to-haskell-in-2018.md" |
103 |
| - "2018-04-15-reimplementing-hackett-s-type-language-expanding-to-custom-core-forms-in-racket.md" |
104 |
| - "2018-09-13-custom-core-forms-in-racket-part-ii-generalizing-to-arbitrary-expressions-and-internal-definitions.md" |
105 |
| - "2018-10-06-macroexpand-anywhere-with-local-apply-transformer.md" |
106 |
| - "2019-04-21-defeating-racket-s-separate-compilation-guarantee.md" |
107 |
| - "2019-09-07-demystifying-monadbasecontrol.md" |
108 |
| - "2019-10-19-empathy-and-subjective-experience-in-programming-languages.md" |
109 |
| - "2019-11-05-parse-don-t-validate.md" |
110 |
| - "2020-01-19-no-dynamic-type-systems-are-not-inherently-more-open.md" |
111 |
| - "2020-08-13-types-as-axioms-or-playing-god-with-static-types.md" |
112 |
| - "2020-11-01-names-are-not-type-safety.md" |
113 |
| - "2021-03-25-an-introduction-to-typeclass-metaprogramming.md"))) |
| 83 | + (list (markdown-post "2015-07-18-automatically-deploying-a-frog-powered-blog-to-github-pages.md") |
| 84 | + (markdown-post "2015-08-22-deploying-racket-applications-on-heroku.md") |
| 85 | + (markdown-post "2015-08-30-managing-application-configuration-with-envy.md") |
| 86 | + (markdown-post "2015-09-23-canonical-factories-for-testing-with-factory-girl-api.md") |
| 87 | + (markdown-post "2015-11-06-functionally-updating-record-types-in-elm.md") |
| 88 | + (markdown-post "2015-12-21-adts-in-typed-racket-with-macros.md") |
| 89 | + (markdown-post "2016-02-18-simple-safe-multimethods-in-racket.md") |
| 90 | + (markdown-post "2016-06-03-four-months-with-haskell.md") |
| 91 | + (markdown-post "2016-08-11-climbing-the-infinite-ladder-of-abstraction.md") |
| 92 | + (markdown-post "2016-08-24-understanding-the-npm-dependency-model.md") |
| 93 | + (markdown-post "2016-10-01-using-types-to-unit-test-in-haskell.md") |
| 94 | + (markdown-post "2017-01-02-rascal-a-haskell-with-more-parentheses.md") |
| 95 | + (markdown-post "2017-01-05-rascal-is-now-hackett-plus-some-answers-to-questions.md") |
| 96 | + (markdown-post "2017-04-28-lifts-for-free-making-mtl-typeclasses-derivable.md") |
| 97 | + (markdown-post "2017-05-27-realizing-hackett-a-metaprogrammable-haskell.md") |
| 98 | + (markdown-post "2017-06-29-unit-testing-effectful-haskell-with-monad-mock.md") |
| 99 | + (markdown-post "2017-08-12-user-programmable-infix-operators-in-racket.md") |
| 100 | + (markdown-post "2017-08-28-hackett-progress-report-documentation-quality-of-life-and-snake.md") |
| 101 | + (markdown-post "2017-10-27-a-space-of-their-own-adding-a-type-namespace-to-hackett.md") |
| 102 | + (markdown-post "2018-02-10-an-opinionated-guide-to-haskell-in-2018.md") |
| 103 | + (markdown-post "2018-04-15-reimplementing-hackett-s-type-language-expanding-to-custom-core-forms-in-racket.md") |
| 104 | + (markdown-post "2018-09-13-custom-core-forms-in-racket-part-ii-generalizing-to-arbitrary-expressions-and-internal-definitions.md") |
| 105 | + (markdown-post "2018-10-06-macroexpand-anywhere-with-local-apply-transformer.md") |
| 106 | + (markdown-post "2019-04-21-defeating-racket-s-separate-compilation-guarantee.md") |
| 107 | + (markdown-post "2019-09-07-demystifying-monadbasecontrol.md") |
| 108 | + (markdown-post "2019-10-19-empathy-and-subjective-experience-in-programming-languages.md") |
| 109 | + (markdown-post "2019-11-05-parse-don-t-validate.md") |
| 110 | + (markdown-post "2020-01-19-no-dynamic-type-systems-are-not-inherently-more-open.md") |
| 111 | + (markdown-post "2020-08-13-types-as-axioms-or-playing-god-with-static-types.md") |
| 112 | + (markdown-post "2020-11-01-names-are-not-type-safety.md") |
| 113 | + (markdown-post "2021-03-25-an-introduction-to-typeclass-metaprogramming.md"))) |
114 | 114 |
|
115 | 115 | (define (timestamp-string)
|
116 | 116 | (define (pad n) (~r n #:min-width 2 #:pad-string "0"))
|
|
162 | 162 |
|
163 | 163 | render-result)
|
164 | 164 |
|
165 |
| -(define (build-post-body dep) |
| 165 | +(define (build-post-body dep #:xrefs-in xref-in-paths) |
166 | 166 | (define src-mod-time (file-or-directory-modify-seconds (post-dep-src-path dep) #f (λ () #f)))
|
167 | 167 | (define info-mod-time (file-or-directory-modify-seconds (post-dep-info-path dep) #f (λ () #f)))
|
168 | 168 | (cond
|
| 169 | + ; Note: this check doesn’t handle the case where we ought to rebuild because |
| 170 | + ; the xrefs-in changed. This is because we don’t currently implement |
| 171 | + ; dependency tracking for blog posts, so we’d have to pessimistically |
| 172 | + ; rebuild *all* newer blog posts whenever an older one changed. This seems |
| 173 | + ; okay for now, since older blog posts don’t change very often, and even |
| 174 | + ; when they do, they usually don’t change in ways that would invalidate |
| 175 | + ; external references. |
169 | 176 | [(and src-mod-time info-mod-time (> info-mod-time src-mod-time))
|
170 | 177 | (deserialize (call-with-input-file* (post-dep-info-path dep) read))]
|
171 | 178 | [else
|
172 | 179 | (eprintf "~a running <posts>/~a\n" (timestamp-string) (find-relative-path posts-dir (post-dep-src-path dep)))
|
173 | 180 | (render-scribble blog-post-render%
|
174 | 181 | (post-dep-main-part dep)
|
175 | 182 | (post-dep-info-path dep)
|
| 183 | + #:xrefs-in xref-in-paths |
176 | 184 | #:xref-out (post-dep-xref-path dep))]))
|
177 | 185 |
|
178 | 186 | (define (build-post-page info #:older older-info #:newer newer-info)
|
|
232 | 240 | (make-directory* output-dir)
|
233 | 241 |
|
234 | 242 | (define all-posts
|
235 |
| - (for/list ([dep (in-list all-post-deps)]) |
236 |
| - (build-post-body dep))) |
| 243 | + (for/fold ([rendered-results '()] |
| 244 | + [prev-xrefs '()] |
| 245 | + #:result (reverse rendered-results)) |
| 246 | + ([dep (in-list all-post-deps)]) |
| 247 | + ; Currently, we only pass the xrefs from previous blog posts, which means |
| 248 | + ; circular references between blog posts is impossible. Supporting that |
| 249 | + ; would require a more elaborate strategy, and it isn’t necessary at the |
| 250 | + ; moment, so we stick to the simple thing for now. |
| 251 | + (values (cons (build-post-body dep #:xrefs-in prev-xrefs) rendered-results) |
| 252 | + (cons (post-dep-xref-path dep) prev-xrefs)))) |
| 253 | + |
237 | 254 | (for ([post (in-list all-posts)]
|
238 | 255 | [older-post (in-list (cons #f all-posts))]
|
239 | 256 | [newer-post (in-list (append (rest all-posts) (list #f)))])
|
|
0 commit comments