scribble/base: add an #:indirect' option to other-doc'

original commit: 6c78bb056371ceebe26d5e7748bbd1241e668278
This commit is contained in:
Matthew Flatt 2013-07-12 06:14:55 -06:00
parent bfc0a4f386
commit a8347bf1b2
2 changed files with 18 additions and 5 deletions

View File

@ -535,13 +535,20 @@ the section hyperlink's resolution in HTML is potentially delayed; see
@defproc[(other-doc [module-path module-path?]
[#:underline? underline? any/c #t])
[#:underline? underline? any/c #t]
[#:indirect indirect (or/c #f content?) #f])
element?]{
Like @racket[secref] for the document's implicit @racket["top"]
tag. Use this function to refer to a whole manual instead of
@racket[secref], in case a special style in the future is used for
manual titles.}
manual titles.
If @racket[indirect] is not @racket[#f], then the link's resolution in
HTML can be delayed, like @racket[seclink] with @racket[#:indirect?
#t]. The @racket[indirect] content is prefixed with ``the'' and
suffixed with ``documentation'' to generate the rendered text of the
link.}
@defproc[(elemtag [t (or/c tag? string?)] [pre-content pre-content?] ...) element?]{

View File

@ -429,7 +429,8 @@
#:rest (listof pre-content?)
element?)]
[other-doc (->* (module-path?)
(#:underline? any/c)
(#:underline? any/c
#:indirect (or/c #f content?))
element?)])
(define (elemtag t . body)
@ -465,8 +466,13 @@
(decode-content s)
`(part ,(doc-prefix doc prefix tag))))
(define (other-doc #:underline? [u? #t] doc)
(secref #:doc doc #:underline? u? "top"))
(define (other-doc doc
#:underline? [u? #t]
#:indirect [indirect #f])
(if indirect
(seclink "top" #:doc doc #:underline? u? #:indirect? #t
(list "the " indirect " documentation"))
(secref "top" #:doc doc #:underline? u?)))
;; ----------------------------------------