Index: code-docs/scribble-helpers.rkt ================================================================== --- code-docs/scribble-helpers.rkt +++ code-docs/scribble-helpers.rkt @@ -29,11 +29,12 @@ (only-in net/uri-codec uri-encode)) (provide (all-defined-out)) (define repo-url/ "https://thelocalyarn.com/cgi-bin/yarncode/") -;; Link to a ticket on the Fossil repository by specifying the ticket ID +;; Link to a ticket on the Fossil repository by specifying the ticket ID. +;; The "_parent" target breaks out of the iframe used by the Fossil repo web UI. (define (ticket id-str) (hyperlink (string-append repo-url/ "tktview?name=" id-str) "ticket " (tt id-str) #:style (style #f (list (attributes '((target . "_parent"))))))) @@ -42,15 +43,23 @@ (define (wiki title) (hyperlink (string-append repo-url/ "wiki?name=" (uri-encode title)) title #:style (style #f (list (attributes '((target . "_parent"))))))) +;; Link somewhere outside these docs or Racket docs. The `_blank` target opens in a new tab. (define (ext-link url-str . elems) (keyword-apply hyperlink '(#:style) (list (style #f (list (attributes '((target . "_blank")))))) - url-str - elems)) + url-str + elems)) + +;; Link to show contents of the latest checked-in version of a file +;; (or a file listing if a directory was specified) +(define (repo-file filename) + (hyperlink (string-append repo-url/ "file/" filename) + (tt filename) + #:style (style #f (list (attributes '((target . "_parent"))))))) (define (responsive-retina-image img-path) (image img-path #:scale 0.5 #:style (style #f (list (attributes '((style . "max-width:100%;height:auto;")))))))