13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
"../dust.rkt"
"../snippets-html.rkt"
racket/base
racket/contract
racket/string
pollen/template
pollen/pagetree
sugar/coerce))
@title{@filepath{snippets-html.rkt}}
@defmodule["snippets-html.rkt" #:packages ()]
Each “snippet” module provides all the document- and article-level blocks of structural markup
|
>
|
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
"../dust.rkt"
"../snippets-html.rkt"
racket/base
racket/contract
racket/string
pollen/template
pollen/pagetree
txexpr
sugar/coerce))
@title{@filepath{snippets-html.rkt}}
@defmodule["snippets-html.rkt" #:packages ()]
Each “snippet” module provides all the document- and article-level blocks of structural markup
|
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
@section{HTML Snippet functions}
@defproc[(html$-page-head [title (or/c string? #f) #f]) non-empty-string?]
Returns the @tt{<head>} section of an HTML document.
@defproc[(html$-page-body-open) non-empty-string?]
Returns the opening @tt{<body>} and @tt{<main>} tags and elements that immediately follow, such as
site header, logo and navigation.
@defproc[(html$-article-open [title-specified-in-doc? boolean?] [title txexpr?] [pubdate string?])
non-empty-string?]
Returns the opening @tt{<article>} tag and elements that immediately follow: permlink, publish date,
and opening @tt{<section>} tag.
The @racket[_title-specified-in-doc?] form changes the HTML markup structure used.
@defproc[(html$-article-close [footertext string?]) non-empty-string?]
Returns a string containing a closing @tt{<section>} tag, a @tt{<footer>} element containing
@racket[_footertext], and a closing @tt{<article>} tag. If @racket[_footertext] is empty, the
@tt{<footer>} element will be omitted.
@defproc[(html$-page-body-close) non-empty-string?]
Returns a string containing the page’s @tt{<footer>} and closing tags.
@defproc[(html$-note-title [author string?] [pagenode pagenode?] [parent-title string?])
non-empty-string?]
|
|
>
>
>
|
>
>
>
|
>
>
>
>
>
>
|
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
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
|
@section{HTML Snippet functions}
@defproc[(html$-page-head [title (or/c string? #f) #f]) non-empty-string?]
Returns the @tt{<head>} section of an HTML document.
@defproc[(html$-page-body-open [body-class string? ""]) non-empty-string?]
Returns the opening @tt{<body>} and @tt{<main>} tags and elements that immediately follow, such as
site header, logo and navigation.
If @racket[_body-class] is a non-empty string, its contents will be included in the @tt{class}
attribute of the @tt{<body>} tag.
@defproc[(html$-article-open [pagenode pagenode?]
[title-specified-in-doc? boolean?]
[title txexpr?]
[pubdate string?])
non-empty-string?]
Returns the opening @tt{<article>} tag and elements that immediately follow: permlink, publish date,
and opening @tt{<section>} tag.
The @racket[_title-specified-in-doc?] form changes the HTML markup structure used.
@defproc[(html$-article-close [footertext string?]) non-empty-string?]
Returns a string containing a closing @tt{<section>} tag, a @tt{<footer>} element containing
@racket[_footertext], and a closing @tt{<article>} tag. If @racket[_footertext] is empty, the
@tt{<footer>} element will be omitted.
@defproc[(html$-article-listing-short [pagenode pagenode?] [pubdate string?] [title string?])
non-empty-string?]
Returns a string of HTML for an article as it would appear in a listing context in “short” form
(date and title only, with link).
@defproc[(html$-page-body-close) non-empty-string?]
Returns a string containing the page’s @tt{<footer>} and closing tags.
@defproc[(html$-note-title [author string?] [pagenode pagenode?] [parent-title string?])
non-empty-string?]
|
116
117
118
119
120
121
122
123
|
Like @racket[html$-note-listing-full], but returns HTML for a @racket[note] suitable for display
inside its parent article.
@defproc[(html$-notes-section [note-htmls string?]) non-empty-string?]
Returns the complete HTML for the @italic{Further Notes} section of an article.
|
>
>
>
>
>
>
>
>
>
|
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
|
Like @racket[html$-note-listing-full], but returns HTML for a @racket[note] suitable for display
inside its parent article.
@defproc[(html$-notes-section [note-htmls string?]) non-empty-string?]
Returns the complete HTML for the @italic{Further Notes} section of an article.
@defproc[(html$-paginate-navlinks [current-page exact-positive-integer?]
[pagecount exact-positive-integer?]
[basename string?]) string?]
On the “blog”, the articles are split across multiple files: @filepath{blog-pg1.html},
@filepath{blog-pg2.html}, etc. This function provides a string containing HTML for a group of links
that can be given within each file, to link to the pages that come before/after it.
The links are enclosed within @tt{<li>} tags. It’s up to the calling site to provide the enclosing
@tt{<ul>} tag (in case any custom styling or IDs need to be applied).
|