commit b50c8a7f6ad113ee10f7fb272cb454f20b94d7f8
parent 3cbb1e4e0e6790772254e03d44fa9644d002ceda
Author: Matthew Flatt <mflatt@racket-lang.org>
Date: Tue, 19 Mar 2013 11:17:22 -0700
scribble/manual: add a `#:key' argument to `deftech'
original commit: dfcf50e1651a6dbf4a3aec00868cb74de9538d88
Diffstat:
2 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/collects/scribble/private/manual-tech.rkt b/collects/scribble/private/manual-tech.rkt
@@ -7,7 +7,8 @@
(provide/contract
[deftech (() (#:normalize? any/c
- #:style? any/c)
+ #:style? any/c
+ #:key (or/c string? #f))
#:rest (listof pre-content?) . ->* . element?)]
[tech (()
(#:doc (or/c module-path? false/c)
@@ -37,11 +38,14 @@
[s (datum-intern-literal s)])
(make-elem style c (list 'tech (doc-prefix doc prefix s)))))
-(define (deftech #:style? [style? #t] #:normalize? [normalize? #t] . s)
+(define (deftech #:style? [style? #t]
+ #:normalize? [normalize? #t]
+ #:key [key #f]
+ . s)
(let* ([e (if style?
(apply defterm s)
(make-element #f (decode-content s)))]
- [t (*tech make-target-element #f #f #f (list e) #f normalize?)])
+ [t (*tech make-target-element #f #f #f (list e) key normalize?)])
(make-index-element #f
(list t)
(target-element-tag t)
diff --git a/collects/scribblings/scribble/manual.scrbl b/collects/scribblings/scribble/manual.scrbl
@@ -1418,6 +1418,7 @@ Alias of @racket[hyperlink] for backward compatibility.}
Alias of @racket[other-doc] for backward compatibility.}
@defproc[(deftech [pre-content pre-content?] ...
+ [#:key key (or/c string? #f) #f]
[#:normalize? normalize? any/c #t]
[#:style? style? any/c #t]) element?]{
@@ -1425,9 +1426,10 @@ Produces an element for the @tech{decode}d @racket[pre-content], and
also defines a term that can be referenced elsewhere using
@racket[tech].
-The @racket[content->string] result of the @tech{decode}d
-@racket[pre-content] is used as a key for references; if
-@racket[normalize?] is true, then the string is normalized as follows:
+When @racket[key] is @racket[#f], the @racket[content->string] result
+of the @tech{decode}d @racket[pre-content] is used as a key for
+references. If @racket[normalize?] is true, then the key string is
+normalized as follows:
@itemize[