# ◊(capitalize-first-letter here-title) | Typography for Lawyers

◊(define parent-page (parent here)) ◊(define previous-page (previous here)) ◊(define next-page (next here)) ◊(define here-title (or (select-from-metas 'title here) (symbol->string here))) ◊(define toolbar? (not (select-from-metas 'toolbar-blank metas))) ◊(define (make-side-nav id url text) ◊div[#:class "nav-outer" #:id id]{◊(link (or url "") ◊div[#:class "nav-inner"]{◊div[#:class "nav-flex" text]})}) ◊(define center-cell-width 14) ◊(define side-cell-width (/ (- 100 (+ 10 (* center-cell-width 2))) 2)) ◊(local-require pollen/tag) ◊; the name `link` is already defined as a function that makes hyperlinks, ◊; so we use `make-default-tag-function` to make a literal `link` tag ◊(define literal-link (make-default-tag-function 'link)) ◊(define (make-subnav children) (apply ul #:class "subnav" (for/list ([child (in-list children)]) (li (xref (select-from-metas 'title child)))))) ◊(local-require css-tools)
◊if[(not (select-from-metas 'tfl-font-template metas)) ""]{ }
◊(define (empty-string) "") ◊(define (tfl-font-template-body) ◊body{ ◊style[#:type "text/css"]{ #tfl-fonts-nav { top: 0; width: 29rem; margin-bottom: 2rem; font-size: 90%; } #tfl-fonts-nav tr:first-child { background: ◊|content-rule-color|; ◊make-css-background-gradient[(list ◊|content-rule-color| "#777") '("17%" "100%")] color: white; } #tfl-fonts-nav tr:first-child td { padding: 0; padding-top: 0.3em; padding-bottom: 0.5em; } #tfl-fonts-nav tr + tr td { padding: 0; } #tfl-fonts-nav tr + tr td .xref { display: inline-block; height: 100%; width: 100%; padding-top: 0.3em; padding-bottom: 0.3em; box-sizing: content-box; background: none; } #content { padding-top: 0; padding-bottom: 2rem; border-top: 0; } } ◊div[#:id "content"]{ ◊table[#:id "tfl-fonts-nav"]{ ◊tr{◊td[#:colspan "4"]{◊xref["fonts.html"]{The TFL fonts — designed by Matthew Butterick}}} ◊tr{ ◊td{◊xref{Equity}} ◊td{◊xref{Concourse}} ◊td{◊xref{Triplicate}} ◊td{◊xref{Advocate}}}} ◊doc} ◊if[(not toolbar?) ""]{ ◊div[#:class "nav-outer" #:id "bottom"]{ ◊div[#:class "nav-inner"]{ ◊table[#:id "navtable"]{ ◊tr{ ◊td{◊xref["/index.html"]{TFL home}} ◊td{◊xref["/toc.html"]{Read excerpts}} ◊td{◊xref[buy-url]{get the book}}}}}}}}) ◊(define (default-body) ◊body{ ◊; use this body for all other pages ◊div[#:id "content"]{ ◊doc ◊(gap 1) ◊(make-subnav (or (children here) null))} ◊(if previous-page ◊make-side-nav["prev" previous-page]{<} "") ◊(if next-page ◊make-side-nav["next" next-page]{>} "") ◊; ◊(if (not toolbar?) (empty-string) ◊div[#:class "nav-outer" #:id "bottom"]{ ◊div[#:class "nav-inner"]{ ◊table[#:id "navtable"]{ ◊tr{ ◊(if (eq? here 'toc.html) (empty-string) ◊td[#:id "left" #:style (format "width: ~a%" side-cell-width)]{◊xref{◊(select 'title previous-page)}}) ◊td[#:style "width:10%"]{◊xref["/index.html"]{TFL home}} ◊td[#:style (format "width:~a%" center-cell-width)]{◊xref[buy-url]{get the book}} ◊td[#:style (format "width:~a%" center-cell-width)]{◊xref["/fonts.html"]{get the fonts}} ◊(if next-page ◊td[#:id "right" #:style (format "width: ~a%" side-cell-width)]{◊xref{◊(select 'title next-page)}} "")}}}})}) ◊(->html (body (if (select-from-metas 'tfl-font-template metas) (tfl-font-template-body) (default-body))))