commit a8347bf1b24680527a1c4acedb561a25305a053e
parent bfc0a4f38648a89633d01fcb6bdabc3704e12716
Author: Matthew Flatt <mflatt@racket-lang.org>
Date: Fri, 12 Jul 2013 06:14:55 -0600
scribble/base: add an `#:indirect' option to `other-doc'
original commit: 6c78bb056371ceebe26d5e7748bbd1241e668278
Diffstat:
2 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/pkgs/scribble-pkgs/scribble-doc/scribblings/scribble/base.scrbl b/pkgs/scribble-pkgs/scribble-doc/scribblings/scribble/base.scrbl
@@ -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?]{
diff --git a/pkgs/scribble-pkgs/scribble-lib/scribble/base.rkt b/pkgs/scribble-pkgs/scribble-lib/scribble/base.rkt
@@ -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?)))
;; ----------------------------------------