`scribble' reports broken cross references by default

original commit: 39edc5a5991d17c8becfc7a1b44665fb5cd9d622
This commit is contained in:
Matthew Flatt 2011-08-18 13:05:37 -06:00
parent af3a99ae55
commit 8890f72c3a
3 changed files with 18 additions and 6 deletions

View File

@ -39,7 +39,8 @@
#:xrefs [xrefs null]
#:info-in-files [info-input-files null]
#:info-out-file [info-output-file #f]
#:quiet? [quiet? #t])
#:quiet? [quiet? #t]
#:warn-undefined? [warn-undefined? (not quiet?)])
(when dest-dir (make-directory* dest-dir))
(let ([renderer (new (render-mixin render%)
[dest-dir dest-dir]
@ -73,5 +74,11 @@
(let ([s (send renderer serialize-info r-info)])
(with-output-to-file info-output-file
#:exists 'truncate/replace
(lambda () (write s))))))
(lambda () (write s)))))
(when warn-undefined?
(let ([undef (send renderer get-undefined r-info)])
(unless (null? undef)
(eprintf "Warning: some cross references may be broken due to undefined tags:\n")
(for ([t (in-list undef)])
(eprintf " ~s\n" t))))))
(void))))

View File

@ -91,7 +91,7 @@
(current-info-input-files
(cons file (current-info-input-files)))]
#:once-each
[("--quiet") "suppress output-file reporting"
[("--quiet") "suppress output-file and undefined-tag reporting"
(current-quiet #t)]
#:args (file . another-file)
(let ([files (cons file another-file)])

View File

@ -46,7 +46,8 @@ function to render a document.
[#:info-out-file info-out-file (or/c #f path-string?) #f]
[#:redirect redirect (or/c #f string?) #f]
[#:redirect-main redirect-main (or/c #f string?) #f]
[#:quiet? quiet? any/c #f])
[#:quiet? quiet? any/c #t]
[#:warn-undefined? warn-undefined? any/c (not quiet?)])
void?]{
Renders the given @racket[docs], each with an output name derived from
@ -78,8 +79,12 @@ to the @racket[set-external-tag-path] and
@racketmodname[scribble/html-render], so they should be
non-@racket[#f] only for HTML rendering.
If @racket[quiet?] is a true value, output-file information is written
to the current output port.}
If @racket[quiet?] is a false value, output-file information is
written to the current output port.
If @racket[warn-undefined?] is a true value, then references to
missing cross-reference targets trigger a warning message on the
current error port.}
@section{Base Renderer}