@@ -59,10 +59,11 @@ html-item html-section html-subsection html-newthought html-caps + html-mono html-center html-strike html-block html-blockcode html-index @@ -71,11 +72,13 @@ html-image-link html-dialogue html-say html-saylines html-verse + html-attrib html-link + html-xref html-url html-fn html-fndef html-note) @@ -85,10 +88,11 @@ (define html-newthought (default-tag-function 'span #:class "newthought")) (define html-caps (default-tag-function 'span #:class "caps")) (define html-center (default-tag-function 'div #:style "text-align: center")) (define html-strike (default-tag-function 'span #:style "text-decoration: line-through")) (define html-dialogue (default-tag-function 'dl #:class "dialogue")) +(define html-mono (default-tag-function 'samp)) (define (html-block . elements) `(section [[class "content-block"]] (div [[class "content-block-main"]] ,@elements))) (define (html-root . elements) @@ -136,10 +140,12 @@ [pre-attrs (cond [italic? '([class "verse"] [style "font-style: italic"])] [else '([class "verse"])])] [pre-title (cond [(string>? title "") `(p [[class "verse-heading"]] ,title)] [else ""])]) `(div [[class "poem"]] ,pre-title (pre ,pre-attrs ,@elems)))) + +(define html-attrib (default-tag-function 'div #:class "attrib")) ;; (Private) Get the dimensions of an image file (define (get-image-size filepath) (define bmp (make-object bitmap% filepath)) (list (send bmp get-width) (send bmp get-height))) @@ -208,10 +214,16 @@ (let* ([url-ref (attr-ref tx 'ref)] [url (or (hash-ref link-urls url-ref #f) (format "Missing reference: ~a" url-ref))]) `(a [[href ,url]] ,@(get-elements tx)))] [else tx])) + +;; Quick link to another article +(define (html-xref . elems) + `(a [[href ,(format "~aarticles/~a.html" web-root (first elems))] + [class "xref"]] + ,@(rest elems))) ;; Footnotes ;; ;; Private use: (define fn-names null)