From 5b639ebb8276aadcdc36dd3d5d650c7cdc35d54c Mon Sep 17 00:00:00 2001 From: David Benoit Date: Tue, 20 Mar 2018 17:41:18 -0400 Subject: [PATCH] point send-main-page to racket website when docs not found --- scribble-lib/help/search.rkt | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/scribble-lib/help/search.rkt b/scribble-lib/help/search.rkt index b3c36742..9992b05f 100644 --- a/scribble-lib/help/search.rkt +++ b/scribble-lib/help/search.rkt @@ -39,11 +39,16 @@ (string->url (format "q?~a" query))) null))])))] - [else - (let* ([path (build-path (find-user-doc-dir) sub)] - [path (if (file-exists? path) path (build-path (find-doc-dir) sub))]) - (notify path) - (send-url/file path #:fragment fragment #:query query))])) + [else + (let* ([path (build-path (find-user-doc-dir) sub)] + [path (if (file-exists? path) path (build-path (find-doc-dir) sub))]) + (notify path) + (if (file-exists? path) + (send-url/file path #:fragment fragment #:query query) + (let ([part (lambda (pfx x) (if x (string-append pfx x) ""))]) + (send-url (string-append + "https://docs.racket-lang.org/" + sub (part "#" fragment) (part "?" query))))))])) ;; This is an example of changing this code to use the online manuals. ;; Normally, it's better to set `doc-open-url` in "etc/config.rktd",