From 51614ab0b29b9d463f0cd2a4b45fbe0b4518a818 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sun, 4 May 2014 09:29:34 -0600 Subject: [PATCH] raco pkg config: add `doc-open-url` key --- pkgs/racket-pkgs/racket-doc/pkg/scribblings/pkg.scrbl | 5 +++++ racket/collects/pkg/lib.rkt | 11 ++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/pkgs/racket-pkgs/racket-doc/pkg/scribblings/pkg.scrbl b/pkgs/racket-pkgs/racket-doc/pkg/scribblings/pkg.scrbl index 937fa82a4d..414c2c26a4 100644 --- a/pkgs/racket-pkgs/racket-doc/pkg/scribblings/pkg.scrbl +++ b/pkgs/racket-pkgs/racket-doc/pkg/scribblings/pkg.scrbl @@ -638,6 +638,11 @@ for @nonterm{key}. be kept in the download cache directory.} @item{@exec{download-cache-max-bytes} --- A limit on the total size of files that are kept in the download cache directory.} + @item{@exec{doc-open-url} --- A URL to use in place of a local + filesystem path for viewing (or at least searching) + documentation; an empty string, which is the default, disables + the URL so that the local filesystem is used. This key can be + set only in @exec{installation} scope.} ] } diff --git a/racket/collects/pkg/lib.rkt b/racket/collects/pkg/lib.rkt index b4e18d9b4c..92a0bc51ba 100644 --- a/racket/collects/pkg/lib.rkt +++ b/racket/collects/pkg/lib.rkt @@ -2381,7 +2381,8 @@ "name" "download-cache-max-files" "download-cache-max-bytes" - "download-cache-dir"))) + "download-cache-dir" + "doc-open-url"))) (pkg-error (~a "missing value for config key\n" " config key: ~a") key)] @@ -2437,6 +2438,12 @@ key val)) (update-pkg-cfg! (string->symbol key) (string->number val))] + [(list (and key "doc-open-url") val) + (unless (eq? 'installation (current-pkg-scope)) + (pkg-error (~a "setting `doc-open-url' works only in `installation' scope\n" + " current package scope: ~a") + (current-pkg-scope))) + (update-pkg-cfg! 'doc-open-url (if (equal? val "") #f val))] [(list* key args) (pkg-error "unsupported config key\n key: ~a" key)])] [else @@ -2455,6 +2462,8 @@ "download-cache-max-files" "download-cache-max-bytes") (printf "~a~a\n" indent (read-pkg-cfg/def (string->symbol key)))] + ["doc-open-url" + (printf "~a~a\n" indent (or (read-pkg-cfg/def 'doc-open-url) ""))] [_ (pkg-error "unsupported config key\n key: ~e" key)])] [(list)