improved scribble syntax use

svn: r8720

original commit: 264af9a6d0224c7374c0e81d1cb8f25ce45bfd41
This commit is contained in:
Eli Barzilay 2008-02-19 12:22:45 +00:00
parent 2620e79135
commit d9a438219a
2 changed files with 24 additions and 21 deletions

View File

@ -3,21 +3,24 @@
"utils.ss" "utils.ss"
(for-syntax scheme/base)) (for-syntax scheme/base))
@define-syntax[def-section-like @(define-syntax def-section-like
(syntax-rules () (syntax-rules ()
[(_ id result/c x ...) (defproc (id [#:tag tag (or/c false/c string?) #f] [(_ id result/c x ...)
(defproc (id [#:tag tag (or/c false/c string?) #f]
[pre-content any/c] (... ...+)) [pre-content any/c] (... ...+))
result/c result/c
x ...)])] x ...)]))
@define-syntax[def-elem-proc @(define-syntax def-elem-proc
(syntax-rules () (syntax-rules ()
[(_ id x ...) (defproc (id [pre-content any/c] (... ...)) [(_ id x ...)
(defproc (id [pre-content any/c] (... ...))
element? element?
x ...)])] x ...)]))
@define-syntax[def-style-proc @(define-syntax def-style-proc
(syntax-rules () (syntax-rules ()
[(_ id) @def-elem-proc[id]{Like @scheme[elem], but with style @scheme['id]}])] [(_ id)
@def-elem-proc[id]{Like @scheme[elem], but with style @scheme['id]}]))
@title[#:tag "basic"]{Basic Document Forms} @title[#:tag "basic"]{Basic Document Forms}

View File

@ -733,7 +733,7 @@ provides direct Scribble reader functionality for advanced needs.}
@; The `with-scribble-read' trick below shadows `read' and @; The `with-scribble-read' trick below shadows `read' and
@; `read-syntax' with for-label bindings from the Scribble reader @; `read-syntax' with for-label bindings from the Scribble reader
@define-syntax[with-scribble-read @(define-syntax with-scribble-read
(syntax-rules () (syntax-rules ()
[(_) [(_)
(... (...
@ -815,6 +815,6 @@ resulting readtable using @scheme[current-readtable]. It also enables
line counting for the current input-port via @scheme[port-count-lines!].} line counting for the current input-port via @scheme[port-count-lines!].}
@; *** End reader-import section *** @; *** End reader-import section ***
))])] ))]))
@with-scribble-read[] @with-scribble-read[]