commit 426cf50f116a9f28f7eb26d6c55c5660ea11de50
parent 9fc96fc56e660254b336bab555a8a05e252065f4
Author: Jay McCarthy <jay.mccarthy@gmail.com>
Date: Tue, 5 Sep 2017 10:37:53 +0100
Make package names links
Diffstat:
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/scribble-lib/scribble/private/manual-mod.rkt b/scribble-lib/scribble/private/manual-mod.rkt
@@ -11,6 +11,7 @@
setup/main-collects
pkg/path
racket/list
+ scribble/html-properties
(for-syntax scheme/base
syntax/parse)
(for-label scheme/base))
@@ -201,6 +202,21 @@
(list pkg)
null)))
+;; mflatt thinks this should not be exposed
+(define (racketpkgname pkg)
+ (link
+ ;; XXX Look at (pkg-info-orig-pkg (hash-ref (read-pkgs-db scope)
+ ;; pkg)) and only show link if catalog? Or did mflatt have
+ ;; something else in mind? But I'd have to know the scope and pass
+ ;; that down from compute-packages
+ (format "https://pkgs.racket-lang.org/package/~a" pkg)
+ (tt pkg)
+ #:style (make-style #f
+ (list "plainlink"
+ (hover-property
+ (format "Install this package using `raco pkg install ~a`"
+ pkg))))))
+
(define (*defmodule names modpaths module-path packages link-target? lang content req)
(let ([modpaths (or modpaths names)])
(define pkg-spec
@@ -218,7 +234,8 @@
""
"s")))
" "
- (add-between (map tt pkgs) ", "))))))))))
+ (add-between (map racketpkgname pkgs)
+ ", "))))))))))
(define (flow-width f) (apply max (map block-width f)))
(define libs-specs
;; make-desc : element -> flow