commit 76a79e35360985ceb2c9f56d338d24744836e783
parent 8a3c287eb6c53625172f4762dade88036427cb39
Author: Matthew Flatt <mflatt@racket-lang.org>
Date: Tue, 7 May 2013 10:03:53 -0400
scribble: fix `--redirect{-main}' and non-HTML mode
original commit: 4ac6a6b3e3d381bc0e20ecb19258cf8b520a8437
Diffstat:
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/collects/scribble/run.rkt b/collects/scribble/run.rkt
@@ -14,6 +14,7 @@
(lambda (%) (html:render-multi-mixin (html:render-mixin %))))
(define current-render-mixin (make-parameter text:render-mixin))
+(define current-html (make-parameter #f))
(define current-dest-directory (make-parameter #f))
(define current-dest-name (make-parameter #f))
(define current-info-output-file (make-parameter #f))
@@ -41,8 +42,10 @@
#:program (short-program+command-name)
#:once-any
[("--html") "generate HTML-format output file (the default)"
+ (current-html #t)
(current-render-mixin html:render-mixin)]
[("--htmls") "generate HTML-format output directory"
+ (current-html #t)
(current-render-mixin multi-html:render-mixin)]
[("--latex") "generate LaTeX-format output"
(current-render-mixin latex:render-mixin)]
@@ -129,8 +132,8 @@
#:style-extra-files (reverse (current-style-extra-files))
#:extra-files (reverse (current-extra-files))
#:helper-file-prefix (helper-file-prefix)
- #:redirect (current-redirect)
- #:redirect-main (current-redirect-main)
+ #:redirect (and (current-html) (current-redirect))
+ #:redirect-main (and (current-html) (current-redirect-main))
#:quiet? (current-quiet)
#:info-in-files (reverse (current-info-input-files))
#:xrefs (for/list ([mod+id (in-list (reverse (current-xref-input-modules)))])
diff --git a/collects/scribblings/scribble/running.scrbl b/collects/scribblings/scribble/running.scrbl
@@ -129,15 +129,16 @@ information for all installed documentation, and @PFlag{m} or
@DPFlag{main-xref-in} is just a shorthand for @exec{++xref-in
setup/xref load-collections-xref}.
-The @DFlag{redirect-main} flag redirects links to the local
+The @DFlag{redirect-main} flag for HTML output redirects links to the local
installation's documentation to a given URL, such as
@tt{http://docs.racket-lang.org/}. Beware that documentation links
sometimes change (although Scribble generates HTML paths and anchors
in a relatively stable way), so
@tt{http://download.racket-lang.org/docs/@italic{version}/html/} may be
more reliable when building with an installation for @italic{version}.
+The @DFlag{redirect-main} flag is ignored for non-HTML output.
-The @DFlag{redirect} flag is similar to @DFlag{redirect-main}, except
+The @DFlag{redirect} flag is like @DFlag{redirect-main}, except
that it builds on the given URL to indicate a cross-reference tag that
is more stable than an HTML path and anchor (in case the documentation
for a function changes sections, for example). No server currently