Index: crystalize.rkt ================================================================== --- crystalize.rkt +++ crystalize.rkt @@ -182,15 +182,17 @@ (let* ([note-id (build-note-id note-tx)] [title-tx (make-note-title pagenode parent-title-plain)] [title-html (->html title-tx #:splice? #t)] [author (maybe-attr 'author attrs default-authorname)] [author-url (maybe-attr 'author-url attrs)] + [note-srcline (maybe-attr 'srcline attrs)] [content-html (html$-note-contents disp-mark disp-verb elems)] [listing-full (html$-note-listing-full pagenode note-id title-html note-date + note-srcline content-html author author-url)]) (insert-one! (cache-conn) (make-cache:note Index: dust.rkt ================================================================== --- dust.rkt +++ dust.rkt @@ -1,6 +1,6 @@ -#lang racket/base +#lang debug racket/base ; SPDX-License-Identifier: BlueOak-1.0.0 ; This file is licensed under the Blue Oak Model License 1.0.0. (require pollen/core @@ -129,11 +129,11 @@ [(windows) (system (format "type nul >> ~a" series-file))] [else (system (format "touch ~a" series-file))])))) ;; Determine if the current article has been checked into Fossil repo (define (checked-in?) - (cond [(current-metas) + (cond [#R (current-metas) (define articles-path (build-path (current-project-root) articles-folder)) (define checked-in (with-output-to-string (lambda () (system (format "/usr/local/bin/fossil ls ~a" articles-path))))) (string-contains? checked-in (path->string (here-source-path)))] Index: pollen.rkt ================================================================== --- pollen.rkt +++ pollen.rkt @@ -112,11 +112,11 @@ (poly-branch-tag url) (poly-branch-tag xref) (poly-branch-tag fn) (poly-branch-tag fndef) -(poly-branch-kwargs-tag note) +(poly-branch-kwargs-tag note-with-srcline) (poly-branch-tag block) ;; Not yet implemented ; (poly-branch-tag table) ; #:columns "" ; (poly-branch-tag inline-math) @@ -123,11 +123,17 @@ ; (poly-branch-tag margin-note) ; (poly-branch-tag noun) ; (poly-branch-func index-entry entry) ; (poly-branch-tag spot-illustration) ; #:src "img--sans-path.png" [#:has-print-version? "yes"] +(define-syntax (note stx) + (syntax-parse stx + [(_ args ...) + (with-syntax ([srcline (number->string (syntax-line stx))]) + #'(note-with-srcline #:srcline srcline args ...))])) + ;; My pet shortcut for for/splice. Greatly cuts down on parentheses for the ;; most common use case (looping through a single list). (define-syntax (for/s stx) (syntax-case stx () [(_ thing listofthings result-expr ...) #'(for/splice ([thing (in-list listofthings)]) result-expr ...)])) Index: snippets-html.rkt ================================================================== --- snippets-html.rkt +++ snippets-html.rkt @@ -3,11 +3,10 @@ ; SPDX-License-Identifier: BlueOak-1.0.0 ; This file is licensed under the Blue Oak Model License 1.0.0. ;; Provides functions for displaying content in HTML templates. (require pollen/template - pollen/core pollen/decode pollen/private/version racket/string racket/function racket/list @@ -45,16 +44,17 @@

The Local Yarn

}) -(define (html$-repo-links) +(define (html$-repo-links [line #f]) (define here (path->string (here-source-path))) + (define line-param (if line (format "?ln=~a" line) "")) (cond [(checked-in?) ◊string-append{}] [else (format "" here) ])) (define (html$-article-open pagenode title? title-tx published) @@ -133,11 +133,12 @@ (cons (txexpr first-tag first-attrs (cons disposition first-elems)) (cdr elems))] [else (cons disposition elems)])) (string-append* (map ->html body-elems))) -(define (html$-note-listing-full pagenode note-id title-html-flow date contents [author default-authorname] [author-url ""]) +(define (html$-note-listing-full pagenode note-id title-html-flow + date srcline contents [author default-authorname] [author-url ""]) (define author-part (cond [(non-empty-string? author-url) ◊string-append{
◊|author| @@ -154,10 +155,11 @@

◊|title-html-flow|

+ ◊(html$-repo-links srcline)
◊|contents|
◊author-part
}) Index: tags-html.rkt ================================================================== --- tags-html.rkt +++ tags-html.rkt @@ -78,11 +78,11 @@ html-link html-xref html-url html-fn html-fndef - html-note) + html-note-with-srcline) (define html-item (default-tag-function 'li)) (define html-section (default-tag-function 'h2)) (define html-subsection (default-tag-function 'h3)) (define html-newthought (default-tag-function 'span #:class "newthought")) @@ -261,7 +261,7 @@ (format "~a" (+ 1 fnref-num)))]] "↩"))]) `(li [[id ,(fndef-id fn-name)]] ,@definition-text ,@backrefs)))) (cond [(null? note-items) ""] [else `(section ((class "footnotes")) (hr) (ol ,@note-items))])) -(define (html-note attrs elems) +(define (html-note-with-srcline attrs elems) (txexpr 'note attrs (decode-hardwrapped-paragraphs elems))) Index: web-extra/martin.css.pp ================================================================== --- web-extra/martin.css.pp +++ web-extra/martin.css.pp @@ -891,16 +891,19 @@ .scm-links { float: none; grid-area: rightmargin; height: 100%; } + + article.with-title .scm-links { + grid-area: title; + } .scm-links a:hover { color: #2176ff; background: none; } - section.entry-content { grid-area: main; /* Prevent content from overriding grid column sizing */ /* See https://css-tricks.com/preventing-a-grid-blowout/ */