commit fbc47c5886031bb050a2ed6a751af405d611f3eb
parent 648facb9e480047b7d143cc8e87ea25d2dcdafc0
Author: Matthew Flatt <mflatt@racket-lang.org>
Date: Thu, 9 Aug 2007 17:21:12 +0000
towards MrEd documentation via Scribble
svn: r7066
original commit: d913915068c30c2118b593f7323584b996200d8e
Diffstat:
2 files changed, 37 insertions(+), 12 deletions(-)
diff --git a/collects/scribble/manual.ss b/collects/scribble/manual.ss
@@ -93,11 +93,13 @@
[(_ x) (add-scheme-index 'x (scheme x))]))
(define (add-scheme-index s e)
- (let ([k (if (and (pair? s)
- (eq? (car s) 'quote))
- (cadr s)
- s)])
- (index* (list (format "~s" k)) (list e) e)))
+ (let ([k (cond
+ [(and (pair? s)
+ (eq? (car s) 'quote))
+ (format "~s" (cadr s))]
+ [(string? s) s]
+ [else (format "~s" s)])])
+ (index* (list k) (list e) e)))
(provide schemeblock SCHEMEBLOCK
schemeblock0 SCHEMEBLOCK0
@@ -177,6 +179,20 @@
;; ----------------------------------------
+ (provide method xmethod)
+
+ (define-syntax method
+ (syntax-rules ()
+ [(_ a b)
+ (scheme b)]))
+
+ (define-syntax xmethod
+ (syntax-rules ()
+ [(_ a b)
+ (elem (scheme b) " in " (scheme a))]))
+
+ ;; ----------------------------------------
+
(provide margin-note)
(define (margin-note . c)
diff --git a/collects/scribblings/scribble/manual.scrbl b/collects/scribblings/scribble/manual.scrbl
@@ -109,13 +109,6 @@ module whose language is @scheme[lang].}
a single line and wrapped with its enclosing paragraph, independent of
the formatting of @scheme[datum].}
-@defform[(indexed-scheme datum ...)]{
-
-A combination of @scheme[scheme] and @scheme[as-index], with the
-special case that if a single @scheme[datum] is provided and it is a
-@scheme[quote] form, then the quote is removed from the key (so that
-it's sorted using its unquoted form).}
-
@defform[(schemeresult datum ...)]{Like @scheme[scheme], but typeset
as a REPL value (i.e., a single color with no hyperlinks).}
@@ -504,6 +497,22 @@ the link.}
@; ------------------------------------------------------------------------
@section{Indexing}
+@defform[(indexed-scheme datum ...)]{
+
+A combination of @scheme[scheme] and @scheme[as-index], with the
+following special cases when a single @scheme[datum] is provided:
+
+ @itemize{
+
+ @item{If @scheme[datum] is a @scheme[quote] form, then the quote is
+ removed from the key (so that it's sorted using its unquoted
+ form).}
+
+ @item{If @scheme[datum] is a string, then quotes are removed from the
+ key (so that it's sorted using the string content).}
+
+}}
+
@defproc[(idefterm [pre-content any/c] ...) element?]{Combines
@scheme[as-index] and @scheme[defterm]. The content normally should be
plural, rather than singular. Consider using @scheme[deftech],