Index: code-docs/pollen.scrbl ================================================================== --- code-docs/pollen.scrbl +++ code-docs/pollen.scrbl @@ -247,15 +247,23 @@ block. If the first element in an article is a @racket[verse] tag with the @racket[#:title] attribute specified, that title is used as the article’s title if the normal @racket[title] tag is absent. +To cite a source, use @racket[attrib] immediately afterward. + } @defproc[(blockquote [element xexpr?] ...) txexpr?]{ -Surrounds a block quotation. To cite a source, include a @code{footer} tag at the bottom. +Surrounds a block quotation. To cite a source, use @racket[attrib] immediately afterward. + +} + +@defproc[(attrib [element xexpr?] ...) txexpr?]{ + +An attribution line, for citing a source for a block quotation, epigraph or poem. } @defproc[(blockcode [element xexpr?] ...) txexpr?]{ @@ -264,10 +272,11 @@ } @deftogether[(@defproc[(i [element xexpr?] ...) txexpr?] @defproc[(em [element xexpr?] ...) txexpr?] @defproc[(b [element xexpr?] ...) txexpr?] + @defproc[(mono [element xexpr?] ...) txexpr?] @defproc[(strong [element xexpr?] ...) txexpr?] @defproc[(strike [element xexpr?] ...) txexpr?] @defproc[(ol [element xexpr?] ...) txexpr?] @defproc[(ul [element xexpr?] ...) txexpr?] @defproc[(item [element xexpr?] ...) txexpr?] Index: pollen.rkt ================================================================== --- pollen.rkt +++ pollen.rkt @@ -10,11 +10,10 @@ syntax/parse pollen/setup)) (require pollen/tag pollen/setup - racket/function "cache.rkt" "tags-html.rkt" "snippets-html.rkt" "crystalize.rkt") @@ -81,10 +80,11 @@ (poly-branch-tag p) (poly-branch-tag i) (poly-branch-tag em) (poly-branch-tag b) +(poly-branch-tag mono) (poly-branch-tag strong) (poly-branch-tag strike) ;(poly-branch-tag color) (poly-branch-tag ol) (poly-branch-tag ul) @@ -104,13 +104,15 @@ (poly-branch-tag figure) (poly-branch-tag figure-@2x) (poly-branch-tag image-link) (poly-branch-kwargs-tag blockcode) (poly-branch-kwargs-tag verse) ; [#:title ""] [#:italic "no"] +(poly-branch-tag attrib) (poly-branch-tag link) (poly-branch-tag url) +(poly-branch-tag xref) (poly-branch-tag fn) (poly-branch-tag fndef) (poly-branch-kwargs-tag note) (poly-branch-tag block) Index: tags-html.rkt ================================================================== --- tags-html.rkt +++ tags-html.rkt @@ -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) Index: web-extra/martin.css.pp ================================================================== --- web-extra/martin.css.pp +++ web-extra/martin.css.pp @@ -264,11 +264,15 @@ article>h1 { font-size: ◊x-lineheight[1]; line-height: ◊x-lineheight[1]; margin: 0 0 ◊x-lineheight[1] 0; font-style: italic; - font-weight: normal; + font-weight: bold; +} + +article.no-title>h1 { + font-weight: normal } /* Titles non-bold, non-smallcaps by default. This can be overridden in document markup. */ h1.entry-title { margin: 0 0 0 0; @@ -276,10 +280,11 @@ font-style: normal; line-height: 1.7rem; } h1.entry-title.note-full { + font-weight: normal; font-feature-settings: "smcp" on, "liga" on, "clig" on, "dlig" on, "kern" on, "onum" on, "pnum" on; } /* This class is used in titles for Notes appended to earlier articles */ h1.entry-title .cross-reference { @@ -408,16 +413,12 @@ section.entry-content blockquote:first-child { margin-top: 0; } -section.entry-content blockquote footer::before { - content: '—'; /* Em-dash */ -} - section.entry-content blockquote footer { - margin-top: ◊x-lineheight[1]; + margin-top: ◊x-lineheight[0.5]; text-align: right; width: calc(100% + 2em); } section.entry-content h2 { @@ -455,10 +456,12 @@ } code { font-size: 0.75rem; font-family: ◊mono-font; + background: #ddd; + border-radius: 0.2em; } pre { line-height: ◊derive-lineheight[7 #:per-lines 6]; max-width: 100%; @@ -467,17 +470,22 @@ } pre code { border: 0; background: none; - font-style: italic; - font-size: 0.75rem; + font-size: 0.6rem; } pre.code { border: dotted #aaa 2px; padding-left: 0.2em; + line-height: 0.7rem; +} + +samp { + font-family: ◊mono-font; + font-size: 0.7rem; } pre.verse { font-family: ◊body-font; font-size: 1rem; @@ -493,10 +501,16 @@ p.verse-heading { font-feature-settings: "smcp" on, "liga" on, "clig" on, "dlig" on, "kern" on, "onum" on, "pnum" on; text-align: center; font-size: 1.3rem; } + +div.attrib { + text-align: right; + font-size: .8rem; + margin-top: -◊x-lineheight[0.5]; +} section.entry-content figure { margin: ◊x-lineheight[1] 0; padding: 0; }