Scribble improvements: defmodule & co.

svn: r7902
This commit is contained in:
Matthew Flatt 2007-12-05 21:41:07 +00:00
parent f0e73013d1
commit cd7157641c
60 changed files with 528 additions and 217 deletions

View File

@ -5,9 +5,7 @@
@title{Virtual Playing Cards Library} @title{Virtual Playing Cards Library}
@declare-exporting[games/cards] @defmodule[games/cards]
The library is @scheme[games/cards].
@defproc[(make-table [title string? "Cards"] @defproc[(make-table [title string? "Cards"]
[w nonnegative-exact-integer? 7] [w nonnegative-exact-integer? 7]

View File

@ -26,7 +26,8 @@
[splice ([run list?])] [splice ([run list?])]
[part-index-decl ([plain-seq (listof string?)] [part-index-decl ([plain-seq (listof string?)]
[entry-seq list?])] [entry-seq list?])]
[part-collect-decl ([element element?])]) [part-collect-decl ([element element?])]
[part-tag-decl ([tag tag?])])
(define (decode-string s) (define (decode-string s)
(let loop ([l '((#rx"---" mdash) (let loop ([l '((#rx"---" mdash)
@ -173,6 +174,8 @@
(loop (cdr l) next? (cons (car l) keys) colls accum title tag-prefix tags style)] (loop (cdr l) next? (cons (car l) keys) colls accum title tag-prefix tags style)]
[(part-collect-decl? (car l)) [(part-collect-decl? (car l))
(loop (cdr l) next? keys (cons (part-collect-decl-element (car l)) colls) accum title tag-prefix tags style)] (loop (cdr l) next? keys (cons (part-collect-decl-element (car l)) colls) accum title tag-prefix tags style)]
[(part-tag-decl? (car l))
(loop (cdr l) next? keys colls accum title tag-prefix (cons (part-tag-decl-tag (car l)) tags) style)]
[(and (pair? (cdr l)) [(and (pair? (cdr l))
(splice? (cadr l))) (splice? (cadr l)))
(loop (cons (car l) (append (splice-run (cadr l)) (cddr l))) next? keys colls accum title tag-prefix tags style)] (loop (cons (car l) (append (splice-run (cadr l)) (cddr l))) next? keys colls accum title tag-prefix tags style)]

View File

@ -0,0 +1,2 @@
(module info setup/infotab
(define name "Scribble Doc Reader"))

View File

@ -1,4 +1,4 @@
(module reader mzscheme (module reader mzscheme
(require (prefix doc: (lib "docreader.ss" "scribble"))) (require (prefix doc: (lib "reader.ss" "scribble" "doc")))
(provide (rename doc:read read) (provide (rename doc:read read)
(rename doc:read-syntax read-syntax))) (rename doc:read-syntax read-syntax)))

View File

@ -0,0 +1,6 @@
(module main scheme/base
(define-syntax-rule (out)
(begin (require scribble/doclang)
(provide (all-from-out scribble/doclang))))
(out))

View File

@ -1,6 +1,6 @@
(module docreader scheme/base (module reader scheme/base
(require (prefix-in scribble: "reader.ss")) (require (prefix-in scribble: "../reader.ss"))
(provide (rename-out [*read read]) (provide (rename-out [*read read])
(rename-out [*read-syntax read-syntax])) (rename-out [*read-syntax read-syntax]))

View File

@ -50,6 +50,7 @@
(define-color "schemesymbol" "IdentifierColor") (define-color "schemesymbol" "IdentifierColor")
(define-color "schemevalue" "ValueColor") (define-color "schemevalue" "ValueColor")
(define-color "schemevaluelink" "blue") (define-color "schemevaluelink" "blue")
(define-color "schememodlink" "blue")
(define-color "schemeresult" "ResultColor") (define-color "schemeresult" "ResultColor")
(define-color "schemestdout" "OutputColor") (define-color "schemestdout" "OutputColor")
(define-color "schememeta" "IdentifierColor") (define-color "schememeta" "IdentifierColor")

View File

@ -4,6 +4,7 @@
scheme/contract) scheme/contract)
(provide-structs (provide-structs
[module-path-index-desc ()]
[exported-index-desc ([name symbol?] [exported-index-desc ([name symbol?]
[from-libs (listof module-path?)])] [from-libs (listof module-path?)])]
[(method-index-desc exported-index-desc) ([method-name symbol?] [(method-index-desc exported-index-desc) ([method-name symbol?]

View File

@ -47,8 +47,11 @@
#'here #'here
`(unsyntax (make-element `(unsyntax (make-element
#f #f
(list (schemefont ,(format "#lang ")) (list hash-lang
(schemeidfont ,(format "~s" (syntax-e #'lang)))))) (hspace 1)
(as-modname-link
',#'lang
(to-element ',#'lang)))))
#'lang)]) #'lang)])
#'(schemeblock modtag rest ...))])) #'(schemeblock modtag rest ...))]))
@ -83,7 +86,76 @@
(define-code scheme to-element unsyntax keep-s-expr add-sq-prop) (define-code scheme to-element unsyntax keep-s-expr add-sq-prop)
(define-code schemeresult to-element/result unsyntax keep-s-expr add-sq-prop) (define-code schemeresult to-element/result unsyntax keep-s-expr add-sq-prop)
(define-code schemeid to-element/id unsyntax keep-s-expr add-sq-prop) (define-code schemeid to-element/id unsyntax keep-s-expr add-sq-prop)
(define-code schememodname to-element unsyntax keep-s-expr add-sq-prop) (define-code *schememodname to-element unsyntax keep-s-expr add-sq-prop)
(define-syntax-rule (schememodname n)
(as-modname-link 'n (*schememodname n)))
(define (as-modname-link s e)
(if (symbol? s)
(make-link-element "schememodlink"
(list e)
`(mod-path ,(symbol->string s)))
e))
(define-syntax-rule (defmodule*/no-declare (name ...) . content)
(*defmodule (list (schememodname name) ...)
#f
(list . content)))
(define-syntax-rule (defmodule* (name ...) . content)
(begin
(declare-exporting name ...)
(defmodule*/no-declare (name ...) . content)))
(define-syntax-rule (defmodule name . content)
(defmodule* (name) . content))
(define-syntax-rule (defmodulelang*/no-declare (lang ...) . content)
(*defmodule (list (schememodname lang) ...)
#t
(list . content)))
(define-syntax-rule (defmodulelang* (name ...) . content)
(begin
(declare-exporting name ...)
(defmodulelang*/no-declare (name ...) . content)))
(define-syntax-rule (defmodulelang lang . content)
(defmodulelang* (lang) . content))
(define (*defmodule names lang? content)
(make-splice
(cons
(make-table
"defmodule"
(map (lambda (name)
(list
(make-flow
(list (make-paragraph
(if lang?
(list (hspace 1)
hash-lang
(hspace 1)
(make-defschememodname name))
(list
(hspace 1)
(scheme (require #,(make-defschememodname name))))))))))
names))
(append
(map (lambda (name)
(make-part-tag-decl `(mod-path ,(element->string name))))
names)
(flow-paragraphs (decode-flow content))))))
(define (make-defschememodname mn)
(let ([name-str (element->string mn)])
(make-index-element #f
(list mn)
`(mod-path ,name-str)
(list name-str)
(list mn)
(make-module-path-index-desc))))
(define (litchar . strs) (define (litchar . strs)
(unless (andmap string? strs) (unless (andmap string? strs)
@ -148,6 +220,8 @@
schemeinput schemeinput
schememod schememod
scheme scheme/form schemeresult schemeid schememodname scheme scheme/form schemeresult schemeid schememodname
defmodule defmodule* defmodulelang defmodulelang*
defmodule*/no-declare defmodulelang*/no-declare
indexed-scheme indexed-scheme
litchar litchar
verbatim) verbatim)
@ -1375,6 +1449,13 @@
c))) c)))
(provide pidefterm) (provide pidefterm)
(define hash-lang (make-link-element
"schememodlink"
(list (schememodfont "#lang"))
`(part ,(doc-prefix '(lib "scribblings/guide/guide.scrbl")
"hash-lang"))))
;; ---------------------------------------- ;; ----------------------------------------
(provide math) (provide math)

View File

@ -289,6 +289,11 @@
background-color: #ddddff; background-color: #ddddff;
} }
.defmodule {
width: 100%;
background-color: #F5F5DC;
}
.specgrammar { .specgrammar {
float: right; float: right;
} }
@ -369,6 +374,11 @@
color: blue; color: blue;
} }
.schememodlink {
text-decoration: none;
color: blue;
}
.schemesyntaxlink { .schemesyntaxlink {
text-decoration: none; text-decoration: none;
color: black; color: black;

View File

@ -11,13 +11,14 @@ This reference manual describes the MrEd GUI toolbox that is part of
"mred"] in @italic{@link["../guide/index.html"]{A Guide to PLT "mred"] in @italic{@link["../guide/index.html"]{A Guide to PLT
Scheme}} for an introduction to MrEd. Scheme}} for an introduction to MrEd.
The @scheme[(lib "mred")] module provides all of the class, interface, @defmodule*/no-declare[(mred)]{The @schememodname[mred] module provides
and procedure bindings defined in this manual. The all of the class, interface, and procedure bindings defined in this
@schememodname[big-gui] language (for use with @schemefont{#module}) manual.}
extends the @schememodname[big] language with @scheme[(lib "mred")].
@defmodulelang*/no-declare[(scheme/gui)]{The
@schememodname[scheme/gui] language combines all bindings of the
@schememodname[scheme] language and the @schememodname[mred] module.}
@bold{This reference describes a potential future version of PLT Scheme.
It does not match the current implementation.}
@table-of-contents[] @table-of-contents[]

View File

@ -78,11 +78,11 @@ re-evaluate the module body.
] ]
@;------------------------------------------------------------------------ @;------------------------------------------------------------------------
@section{The @schememodfont{#lang} Shorthand} @section[#:tag "hash-lang"]{The @schememodfont{#lang} Shorthand}
Unlike @litchar{'}, there is no fixed syntax for the body of a The body of a @schememodfont{#lang} shorthand has no specific syntax,
@litchar{#lang} shorthand. In general, the syntax is determined by because the syntax is determined by the language name that follows
the language name that follows @litchar{#lang}. @schememodfont{#lang}.
In the case of @schememodfont{#lang} @schememodname[scheme], the syntax In the case of @schememodfont{#lang} @schememodname[scheme], the syntax
is is
@ -107,3 +107,9 @@ the longhand expansion uses @scheme[scheme/base] instead of
@scheme[scheme]. The @schememodfont{#lang} @scheme[honu] form, in @scheme[scheme]. The @schememodfont{#lang} @scheme[honu] form, in
contrast, has a completely different syntax that doesn't even look contrast, has a completely different syntax that doesn't even look
like Scheme, and which we do not attempt to describe in this guide. like Scheme, and which we do not attempt to describe in this guide.
Unless otherwise specified, a module that is documented as a
``language'' using the @schememodfont{#lang} notation will expand to
@scheme[module] in the same way as @schememodfont{#lang}
@schememodname[scheme]. The documented language name can be used
directly with @scheme[module] or @scheme[require], too.

View File

@ -394,11 +394,10 @@ Modules are named and distributed in various ways:
@item{Some modules are packaged in the PLT Scheme distribution or @item{Some modules are packaged in the PLT Scheme distribution or
otherwise installed into a hierarchy of otherwise installed into a hierarchy of
@defterm{collections}. For example, the module name @defterm{collections}. For example, the module name
@schememodname[slideshow/flash] means ``the module @schememodname[slideshow/flash] means ``the module implemented
implemented in the file @filepath{flash.ss} that is located in the in the file @filepath{flash.ss} that is located in the
@filepath{slideshow} collection.'' The @schememodname[slideshow] @filepath{slideshow} collection.'' When a module name includes
specification with @schemefont{#lang} is a shorthand for no slash, then it refers to a @filepath{main.ss} file.}
@schememodname[slideshow/main].}
@item{Some modules are distributed through the @item{Some modules are distributed through the
@link[url:planet]{@PLaneT} server, and they can be @link[url:planet]{@PLaneT} server, and they can be

View File

@ -71,7 +71,6 @@
@title[#:tag "mzlib:class" #:style 'toc]{Classes and Objects} @title[#:tag "mzlib:class" #:style 'toc]{Classes and Objects}
@declare-exporting[scheme/class scheme]
@note-lib[scheme/class] @note-lib[scheme/class]
@local-table-of-contents[] @local-table-of-contents[]

View File

@ -3,14 +3,13 @@
@title[#:tag "mzlib:contract" #:style 'toc]{Contracts} @title[#:tag "mzlib:contract" #:style 'toc]{Contracts}
@declare-exporting[scheme/contract scheme]
@note-lib[scheme/contract]
A @defterm{contract} controls the flow of values to ensure that the A @defterm{contract} controls the flow of values to ensure that the
expectations of one party are met by another party. The expectations of one party are met by another party. The
@scheme[provide/contract] form is the primary mechanism for @scheme[provide/contract] form is the primary mechanism for
associating a contract with a binding. associating a contract with a binding.
@note-lib[scheme/contract]
@local-table-of-contents[] @local-table-of-contents[]
@; ---------------------------------------- @; ----------------------------------------

View File

@ -9,6 +9,8 @@ The @scheme[match] form and related forms support general pattern
matching on Scheme values. See also @secref["regexp"] for information matching on Scheme values. See also @secref["regexp"] for information
on regular-expression matching on strings, bytes, and streams. on regular-expression matching on strings, bytes, and streams.
@note-lib[scheme/match]
@defform/subs[(match val-expr clause ...) @defform/subs[(match val-expr clause ...)
([clause [pat expr ...+] ([clause [pat expr ...+]
[pat (=> identifier) expr ...+]])]{ [pat (=> identifier) expr ...+]])]{

View File

@ -20,20 +20,24 @@
(provide note-lib) (provide note-lib)
(define-syntax-rule (note-lib lib) (define-syntax-rule (note-lib lib)
(begin
(declare-exporting lib scheme)
(defmodule*/no-declare (lib)
(t "The bindings documented in this section are provided by the " (t "The bindings documented in this section are provided by the "
(schememodname lib) (schememodname lib)
" and " " and "
(schememodname scheme) (schememodname scheme)
" libraries, but not " (schememodname scheme/base) " libraries, but not " (schememodname scheme/base)
".")) "."))))
(provide note-lib-only) (provide note-lib-only)
(define-syntax-rule (note-lib-only lib) (define-syntax-rule (note-lib-only lib)
(defmodule lib
(t "The bindings documented in this section are provided by the " (t "The bindings documented in this section are provided by the "
(schememodname lib) (schememodname lib)
" library, not " (schememodname scheme/base) " library, not " (schememodname scheme/base)
" or " (schememodname scheme) " or " (schememodname scheme)
".")) ".")))
(define (*exnraise s) (define (*exnraise s)
(make-element #f (list s " exception is raised"))) (make-element #f (list s " exception is raised")))

View File

@ -8,7 +8,6 @@
@;------------------------------------------------------------------------ @;------------------------------------------------------------------------
@section[#:tag "tcp"]{TCP} @section[#:tag "tcp"]{TCP}
@declare-exporting[scheme/tcp]
@note-lib[scheme/tcp] @note-lib[scheme/tcp]
For information about TCP in general, see @italic{TCP/IP Illustrated, For information about TCP in general, see @italic{TCP/IP Illustrated,
@ -256,7 +255,6 @@ Returns @scheme[#t] if @scheme[v] is a port returned by
@;------------------------------------------------------------------------ @;------------------------------------------------------------------------
@section[#:tag "udp"]{UDP} @section[#:tag "udp"]{UDP}
@declare-exporting[scheme/udp]
@note-lib[scheme/udp] @note-lib[scheme/udp]
For information about UDP in general, see @italic{TCP/IP Illustrated, For information about UDP in general, see @italic{TCP/IP Illustrated,

View File

@ -759,7 +759,6 @@ is little-endian.}
@; ------------------------------------------------------------------------ @; ------------------------------------------------------------------------
@section{Extra Constants and Functions} @section{Extra Constants and Functions}
@declare-exporting[scheme/math scheme]
@note-lib[scheme/math] @note-lib[scheme/math]
@defthing[euler real?]{ @defthing[euler real?]{

View File

@ -451,7 +451,6 @@ Like @scheme[assoc], but finds an element using the predicate
@; ---------------------------------------- @; ----------------------------------------
@section{List Synonyms} @section{List Synonyms}
@declare-exporting[scheme/list scheme]
@note-lib[scheme/list] @note-lib[scheme/list]
@defthing[empty null?]{The empty list.} @defthing[empty null?]{The empty list.}

View File

@ -4,7 +4,6 @@
@title[#:tag "customport"]{More Port Constructors and Events} @title[#:tag "customport"]{More Port Constructors and Events}
@declare-exporting[scheme/port scheme]
@note-lib[scheme/port] @note-lib[scheme/port]
@; ---------------------------------------------------------------------- @; ----------------------------------------------------------------------

View File

@ -4,7 +4,6 @@
@title[#:tag "pretty-print"]{Pretty Printing} @title[#:tag "pretty-print"]{Pretty Printing}
@declare-exporting[scheme/pretty scheme]
@note-lib[scheme/pretty] @note-lib[scheme/pretty]
@defproc[(pretty-print [v any/c] [port output-port? (current-output-port)]) @defproc[(pretty-print [v any/c] [port output-port? (current-output-port)])

View File

@ -743,6 +743,8 @@ If the @scheme[read-accept-reader] @tech{parameter} is set to
@scheme[#f], then if the reader encounters @litchar{#reader}, the @scheme[#f], then if the reader encounters @litchar{#reader}, the
@exnraise[exn:fail:read]. @exnraise[exn:fail:read].
@guideintro["hash-lang"]{@schememodfont["#lang"]}
The @as-index{@litchar{#lang}} reader form is similar, but more The @as-index{@litchar{#lang}} reader form is similar, but more
constrained: the @litchar{#lang} must be followed by a single space constrained: the @litchar{#lang} must be followed by a single space
(ASCII 32), and then a non-empty sequence of alphanumeric ASCII, (ASCII 32), and then a non-empty sequence of alphanumeric ASCII,

View File

@ -4,13 +4,17 @@
@title[#:tag-prefix '(lib "scribblings/reference/reference.scrbl") @title[#:tag-prefix '(lib "scribblings/reference/reference.scrbl")
#:tag "top"]{PLT Scheme Reference} #:tag "top"]{PLT Scheme Reference}
@declare-exporting[scheme/base scheme]
This manual defines the core PLT Scheme language and describes its This manual defines the core PLT Scheme language and describes its
most prominent libraries. The companion manual @|Guide| provides a most prominent libraries. The companion manual @|Guide| provides a
friendlier (though less precise and less complete) overview of the friendlier (though less precise and less complete) overview of the
language. language.
@defmodulelang*[(scheme/base scheme)]{Unless otherwise noted, the
bindings defined in this manual are exported by the
@schememodname[scheme/base] and @schememodname[scheme] languages,
where @schememodname[scheme] includes all of
@schememodname[scheme/base].}
@table-of-contents[] @table-of-contents[]
@include-section["model.scrbl"] @include-section["model.scrbl"]

View File

@ -5,7 +5,6 @@
@title[#:tag "serialization"]{Serialization} @title[#:tag "serialization"]{Serialization}
@declare-exporting[scheme/serialize]
@note-lib-only[scheme/serialize] @note-lib-only[scheme/serialize]
@defproc[(serializable? [v any/c]) boolean?]{ @defproc[(serializable? [v any/c]) boolean?]{

View File

@ -424,7 +424,6 @@ imported structure type, in which case the user is expected to know
the set of fields that are listed in the signature for the structure the set of fields that are listed in the signature for the structure
type. type.
@declare-exporting[scheme/struct-info scheme]
@note-lib-only[scheme/struct-info] @note-lib-only[scheme/struct-info]
@defproc[(struct-info? [v any/c]) boolean?]{ @defproc[(struct-info? [v any/c]) boolean?]{

View File

@ -416,7 +416,6 @@ and different result procedures use distinct marks.}
@section[#:tag "require-trans"]{@scheme[require] Transformers} @section[#:tag "require-trans"]{@scheme[require] Transformers}
@declare-exporting[scheme/require-transform]
@note-lib-only[scheme/require-transform] @note-lib-only[scheme/require-transform]
A @tech{transformer binding} whose value is a structure with the A @tech{transformer binding} whose value is a structure with the
@ -520,7 +519,6 @@ instantiated or visited even if no binding is imported into a module.
@section[#:tag "provide-trans"]{@scheme[provide] Transformers} @section[#:tag "provide-trans"]{@scheme[provide] Transformers}
@declare-exporting[scheme/provide-transform]
@note-lib-only[scheme/provide-transform] @note-lib-only[scheme/provide-transform]
A @tech{transformer binding} whose value is a structure with the A @tech{transformer binding} whose value is a structure with the

View File

@ -224,7 +224,6 @@ real process ID).
@section{Simple Subprocesses} @section{Simple Subprocesses}
@declare-exporting[scheme/system]
@note-lib-only[scheme/system] @note-lib-only[scheme/system]
@defproc[(system [command string?]) boolean?]{ @defproc[(system [command string?]) boolean?]{

View File

@ -109,7 +109,7 @@ other information.
For example, a @schemeidfont{car} @tech{identifier} might have For example, a @schemeidfont{car} @tech{identifier} might have
@tech{lexical information} that designates it as the @scheme[car] from @tech{lexical information} that designates it as the @scheme[car] from
the @schememodname[big] language (i.e., the built-in the @schememodname[scheme/base] language (i.e., the built-in
@scheme[car]). Similarly, a @schemeidfont{lambda} identifier's @scheme[car]). Similarly, a @schemeidfont{lambda} identifier's
@tech{lexical information} may indicate that it represents a procedure @tech{lexical information} may indicate that it represents a procedure
form. Some other @tech{identifier}'s @tech{lexical information} may form. Some other @tech{identifier}'s @tech{lexical information} may
@ -224,7 +224,7 @@ More specifically, the typesetting of identifiers in the above grammar
is significant. For example, the second case for @scheme[_expr] is a is significant. For example, the second case for @scheme[_expr] is a
@tech{syntax-object} list whose first element is an @tech{identifier}, @tech{syntax-object} list whose first element is an @tech{identifier},
where the @tech{identifier}'s @tech{lexical information} specifies a where the @tech{identifier}'s @tech{lexical information} specifies a
binding to the @scheme[define-values] of the @schememodname[big] binding to the @scheme[define-values] of the @schememodname[scheme/base]
language (i.e., the @tech{identifier} is @scheme[free-identifier=?] to language (i.e., the @tech{identifier} is @scheme[free-identifier=?] to
one whose binding is @scheme[define-values]). In all cases, one whose binding is @scheme[define-values]). In all cases,
identifiers above typeset as syntactic-form names refer to the identifiers above typeset as syntactic-form names refer to the

View File

@ -23,11 +23,6 @@
@title[#:tag "mzlib:unit" #:style 'toc]{Units} @title[#:tag "mzlib:unit" #:style 'toc]{Units}
@declare-exporting[scheme/unit scheme]
@note-lib[scheme/unit]
@local-table-of-contents[]
@deftech{Units} are used to organize a program into separately @deftech{Units} are used to organize a program into separately
compilable and reusable components. A unit resembles a procedure in compilable and reusable components. A unit resembles a procedure in
that both are first-class values that are used for abstraction. While that both are first-class values that are used for abstraction. While
@ -43,6 +38,10 @@ itself imports variables that will be propagated to unresolved
imported variables in the linked units, and re-exports some variables imported variables in the linked units, and re-exports some variables
from the linked units for further linking. from the linked units for further linking.
@note-lib[scheme/unit]
@local-table-of-contents[]
@; ------------------------------------------------------------------------ @; ------------------------------------------------------------------------
@section[#:tag "creatingunits"]{Creating Units} @section[#:tag "creatingunits"]{Creating Units}

View File

@ -21,12 +21,12 @@
@title[#:tag "basic"]{Basic Document Forms} @title[#:tag "basic"]{Basic Document Forms}
@declare-exporting[scribble/basic] @defmodule[scribble/basic]{The @schememodname[scribble/basic] libraryp
rovides functions and forms that can be used from code written either
in Scheme or with @elem["@"] expressions.}
The @filepath{basic.ss} libraryprovides functions and forms that can be For example, the @scheme[title] and @scheme[italic] functions might be
used from code written either in Scheme or with @elem["@"] called from Scheme as
expressions. For example, the @scheme[title] and @scheme[italic]
functions might be called from Scheme as
@schemeblock[ @schemeblock[
(title #:tag "how-to" "How to Design " (italic "Great") " Programs") (title #:tag "how-to" "How to Design " (italic "Great") " Programs")
@ -42,7 +42,7 @@ EOS
Although the procedures are mostly design to be used from @elem["@"] Although the procedures are mostly design to be used from @elem["@"]
mode, they are easier to document in Scheme mode (partly because we mode, they are easier to document in Scheme mode (partly because we
have Scribble's @filepath{scheme.ss} and @filepath{manual.ss}). have @schememodname[scribble/manual]).
@; ------------------------------------------------------------------------ @; ------------------------------------------------------------------------

View File

@ -0,0 +1,59 @@
#lang scribble/doc
@(require scribble/manual
"utils.ss"
(for-label scribble/bnf))
@title[#:tag "bnf"]{Typesetting Grammars}
@defmodule[scribble/bnf]{The @scheme[scribble/bnf] library
provides utilities for typesetting grammars.}
See also @scheme[schemegrammar].
@defproc[(BNF [prod (cons element? (listof element?))] ...) table?]{
Typesets a grammar table. Each production starts with an element
(typically constructed with @scheme[nonterm]) for the non-terminal
being defined, and then a list of possibilities (typically constructed
with @scheme[BNF-seq], etc.) to show on separate lines.}
@defproc[(nonterm (pre-content any/c) ...) element?]{
Typesets a non-terminal: italic in angle brackets.}
@defproc[(BNF-seq [elem element?] ...) element?]{
Typesets a sequence.}
@defproc[(BNF-group [pre-content any/c] ...) element?]{
Typesets a group surrounded by curly braces (so the entire group can
be repeated, for example).}
@defproc[(optional [pre-content any/c] ...) element?]{
Typesets an optional element: in square brackets.}
@defproc[(kleenestar [pre-content any/c] ...) element?]{
Typesets a 0-or-more repetition.}
@defproc[(kleeneplus [pre-content any/c] ...) element?]{
Typesets a 1-or-more repetition.}
@defproc[(kleenerange [n any/c] [m any/c] [pre-content any/c] ...) element?]{
Typesets a @scheme[n]-to-@scheme[m] repetition. The @scheme[n] and
@scheme[m] arguments are converted to a string using @scheme[(format
"~a" n)] and @scheme[(format "~a" m)].}
@defproc[(BNF-alt [elem element?] ...) element?]{
Typesets alternatives for a production's right-hand side to appear on
a single line. The result is normally used as a single possibility in
a production list for @scheme[BNF].}
@defthing[BNF-etc string?]{
A string to use for omitted productions or content.}

View File

@ -4,12 +4,11 @@
@title[#:tag "decode"]{Text Decoder} @title[#:tag "decode"]{Text Decoder}
@declare-exporting[scribble/decode] @defmodule[scribble/decode]{The @schememodname[scribble/decode]
library helps you write document content in a natural way---more like
The @filepath{decode.ss} library helps you write document content in a plain text, except for @litchar["@"] escapes. Roughly, it processes a
natural way---more like plain text, except for @litchar["@"] escapes. stream of strings to produces instances of the
Roughly, it processes a stream of strings to produces instances of the @schememodname[scribble/struct] datatypes (see @secref["struct"]).}
@filepath{struct.ss} datatypes (see @secref["struct"]).
At the flow level, decoding recognizes a blank line as a paragraph At the flow level, decoding recognizes a blank line as a paragraph
separator. At the paragraph-content level, decoding makes just a few separator. At the paragraph-content level, decoding makes just a few
@ -39,9 +38,10 @@ Decodes a document, producing a part. In @scheme[lst], instances of
@scheme[part-index-decl] (that precede any sub-part) add index entries @scheme[part-index-decl] (that precede any sub-part) add index entries
that point to the section. Instances of @scheme[part-collect-decl] add that point to the section. Instances of @scheme[part-collect-decl] add
elements to the part that are used only during the @techlink{collect elements to the part that are used only during the @techlink{collect
pass}. Instances of @scheme[part-start] at level 0 trigger sub-part pass}. Instances of @scheme[part-tag-decl] add hyperlink tags to the
parsing. Instances of @scheme[section] trigger are used as-is as section title. Instances of @scheme[part-start] at level 0 trigger
subsections, and instances of @scheme[paragraph] and other sub-part parsing. Instances of @scheme[section] trigger are used as-is
as subsections, and instances of @scheme[paragraph] and other
flow-element datatypes are used as-is in the enclosing flow. flow-element datatypes are used as-is in the enclosing flow.
} }
@ -129,6 +129,12 @@ See @scheme[decode].
} }
@defstruct[part-tag-decl ([tag tag?])]{
See @scheme[decode].
}
@defstruct[splice ([run list?])]{ @defstruct[splice ([run list?])]{
See @scheme[decode], @scheme[decode-part], and @scheme[decode-flow]. See @scheme[decode], @scheme[decode-part], and @scheme[decode-flow].

View File

@ -4,13 +4,14 @@
@title[#:tag "doclang"]{Document Module Language} @title[#:tag "doclang"]{Document Module Language}
The @filepath{doclang.ss} module is suitable for use as a module @defmodule[scribble/doclang]{The @schememodname[scribble/doclang]
language. It provides everything from @scheme[mzscheme], except that language provides everything from @scheme[scheme/base], except that it
it replaces the @scheme[#%module-begin] form. replaces the @scheme[#%module-begin] form.}
The @filepath{doclang.ss} @scheme[#%module-begin] essentially packages the The @schememodname[scribble/doclang] @scheme[#%module-begin]
body of the module into a call to @scheme[decode], binds the result to essentially packages the body of the module into a call to
@scheme[doc], and exports @scheme[doc]. @scheme[decode], binds the result to @scheme[doc], and exports
@scheme[doc].
Any module-level form other than an expression (e.g., a Any module-level form other than an expression (e.g., a
@scheme[require] or @scheme[define]) is remains at the top level, and @scheme[require] or @scheme[define]) is remains at the top level, and

View File

@ -5,9 +5,8 @@
@title[#:tag "docreader"]{Document Reader} @title[#:tag "docreader"]{Document Reader}
The @filepath{docreader.ss} module is suitable for use with @defmodule[scribble/doc]{The @schememodname[scribble/doc] language is
@schemefont{#reader} at the beginning of a file. It reads the entire the same as @schememodname[scribble/doclang], except that
file with @scheme[read-inside-syntax] from Scribble's @scheme[read-inside-syntax] is used to read the body of the module. In
@filepath{reader.ss}, and then wraps the result with @scheme[(module #, other words, the module body starts in Scribble ``text'' mode instead
@nonterm{name} (lib "doclang.ss" "scribble") ...)], where of S-expression mode.}
@nonterm{name} is derived from the enclosing file's name.

View File

@ -4,11 +4,10 @@
@title[#:tag "eval"]{Evaluation and Examples} @title[#:tag "eval"]{Evaluation and Examples}
@declare-exporting[scribble/eval] @defmodule[scribble/eval]{The @scheme[scribble/eval] library provides
utilities for evaluating code at document-build time and incorporating
The @filepath{eval.ss} library provides utilities for evaluating code at the results in the document, especially to show example uses of
document-build time and incorporating the results in the document, defined procedures and syntax.}
especially to show example uses of defined procedures and syntax.
@defform[(interaction datum ...)]{Like @scheme[schemeinput], except @defform[(interaction datum ...)]{Like @scheme[schemeinput], except
that the result for each input @scheme[datum] is shown on the next that the result for each input @scheme[datum] is shown on the next

View File

@ -19,7 +19,7 @@ To document a collection or @|PLaneT| package:
@item{Start @filepath{manual.scrbl} like this: @item{Start @filepath{manual.scrbl} like this:
@verbatim[#<<EOS @verbatim[#<<EOS
#lang scribble/doc #lang scribble/doc
@begin[(require scribble/manual)] @(require scribble/manual)
@title{My Library} @title{My Library}
@ -52,8 +52,14 @@ EOS
collection name to limit the build process to the collection.} collection name to limit the build process to the collection.}
@item{The generated documentation is @item{The generated documentation is
@filepath{compiled/doc/manual/index.html} within the collection or @filepath{compiled/doc/manual/index.html} within the
@|PLaneT| package directory.} collection or @|PLaneT| package directory.
If you want the output to be relative to the PLT Scheme
documentation directory (which is recommend only for those who
produce the ``official'' PLT Scheme distribution), add the
@scheme['main-doc] option to the @scheme[scribblings]
definition in @filepath{info.ss}.}
} }
@ -88,13 +94,20 @@ A @nonterm{cmd} or @nonterm{datum} is a Scheme datum, while a
The expansion of a @litchar["@"] form into Scheme code is The expansion of a @litchar["@"] form into Scheme code is
@schemeblock[
@nonterm{cmd}
]
if neither @litchar["["] @litchar["]"] nor @litchar["{"] @litchar["}"]
are used, otherwise
@schemeblock[ @schemeblock[
(#, @nonterm{cmd} #, @kleenestar{@nonterm{datum}} #, @kleenestar{@nonterm{parsed-body}}) (#, @nonterm{cmd} #, @kleenestar{@nonterm{datum}} #, @kleenestar{@nonterm{parsed-body}})
] ]
where @kleenestar{@nonterm{parsed-body}} is the parse result of the where @kleenestar{@nonterm{parsed-body}} is the parse result of the
@nonterm{text-body}. It often turns out to be a sequence of Scheme @nonterm{text-body}. The @kleenestar{@nonterm{parsed-body}} part often
strings. turns out to be a sequence of Scheme strings.
In practice, the @nonterm{cmd} is normally a Scheme identifier that is In practice, the @nonterm{cmd} is normally a Scheme identifier that is
bound to a procedure or syntactic form. If the procedure or form bound to a procedure or syntactic form. If the procedure or form
@ -136,18 +149,20 @@ information on the decoding process.
@; ---------------------------------------- @; ----------------------------------------
@section[#:tag "scheme-hyperlinks"]{Scheme Typesetting and Hyperlinks} @section[#:tag "scheme-hyperlinks"]{Scheme Typesetting and Hyperlinks}
With the document source in @secref["getting-started"], the Scheme In the document source at the start of this chapter
expression @scheme[(#,(schemeidfont "list") 'testing 1 2 3)] is (@secref["getting-started"]), the Scheme expression
typeset properly, but the @schemeidfont{list} identifier is not @scheme[(#,(schemeidfont "list") 'testing 1 2 3)] is typeset properly,
hyperlinked to the usual definition. To cause @schemeidfont{list} to but the @schemeidfont{list} identifier is not hyperlinked to the usual
be hyperlinked, add the following to the @tt["@begin"] body: definition. To cause @schemeidfont{list} to be hyperlinked, extend the
@scheme[require] form like this:
@schemeblock[ @schemeblock[
(require (for-label (lib "scheme"))) (require scribble/manual
(for-label #,(schememodname scheme)))
] ]
This @scheme[require] with @scheme[for-label] declaration introduces a This @scheme[require] with @scheme[for-label] declaration introduces a
document-time binding for each export of the @scheme[(lib "scheme")] document-time binding for each export of the @schememodname[scheme]
module. When the document is built, the @scheme[scheme] form detects module. When the document is built, the @scheme[scheme] form detects
the binding for @scheme[list], and so it generates a reference to the the binding for @scheme[list], and so it generates a reference to the
specification of @scheme[list]. The setup process detects the specification of @scheme[list]. The setup process detects the
@ -162,8 +177,8 @@ binding is documented elsewhere:
@verbatim[#<<EOS @verbatim[#<<EOS
#lang scribble/doc #lang scribble/doc
@begin[(require scribble/manual @(require scribble/manual
(for-label (lib "scheme")))] (for-label scheme))
@title{My Library} @title{My Library}
@ -178,8 +193,8 @@ and it preserves the expression's formatting from the document source.
@verbatim[#<<EOS @verbatim[#<<EOS
#lang scribble/doc #lang scribble/doc
@begin[(require scribble/manual @(require scribble/manual
(for-label (lib "scheme"))] (for-label scheme))
@title{My Library} @title{My Library}
@ -209,8 +224,8 @@ The following example illustrates section hyperlinks:
@verbatim[#<<EOS @verbatim[#<<EOS
#lang scribble/doc #lang scribble/doc
@begin[(require scribble/manual @(require scribble/manual
(for-label (lib "scheme")))] (for-label scheme))
@title{My Library} @title{My Library}
@ -231,9 +246,9 @@ The following example illustrates section hyperlinks:
EOS EOS
] ]
Since the page is so short, it the hyperlinks are more effective if Since the page is so short, it the hyperlinks in the above example are
you change the @filepath{info.ss} file to add the @scheme['multi-file] more effective if you change the @filepath{info.ss} file to add the
flag: @scheme['multi-file] flag:
@schemeblock[ @schemeblock[
(define scribblings '(("manual.scrbl" (multi-page)))) (define scribblings '(("manual.scrbl" (multi-page))))
@ -249,9 +264,9 @@ manual:
@verbatim[#<<EOS @verbatim[#<<EOS
#lang scribble/doc #lang scribble/doc
@begin[(require scribble/manual @(require scribble/manual
(for-label (lib "scheme"))) (for-label scheme))
(define ref-src @(define ref-src
'(lib "scribblings/reference/reference.scrbl"))] '(lib "scribblings/reference/reference.scrbl"))]
@title{My Library} @title{My Library}
@ -261,9 +276,9 @@ EOS
] ]
As mentioned in @secref{scheme-hyperlinks}, however, cross-document As mentioned in @secref{scheme-hyperlinks}, however, cross-document
references based on @scheme[require-for-label] and @scheme[scheme] are references based on @scheme[(require (for-label ....))] and
usually better than to cross-document references using @scheme[scheme] are usually better than to cross-document references
@scheme[secref]. using @scheme[secref].
@; ---------------------------------------- @; ----------------------------------------
@section{Defining Scheme Bindings} @section{Defining Scheme Bindings}
@ -275,16 +290,16 @@ and they declare hyperlink targets for @scheme[scheme]-based
hyperlinks. hyperlinks.
To document a @scheme[my-helper] procedure that is exported by To document a @scheme[my-helper] procedure that is exported by
@filepath{helper.ss} in the collection that contains @filepath{manual.scrbl}, @filepath{helper.ss} in the collection that contains
first use @scheme[require-for-label] to import the binding information @filepath{manual.scrbl}, first use @scheme[(require (for-label ....))]
of @filepath{helper.ss}. Then use @scheme[defproc] to document the to import the binding information of @filepath{helper.ss}. Then use
procedure: @scheme[defproc] to document the procedure:
@verbatim[#<<EOS @verbatim[#<<EOS
#lang scribble/doc #lang scribble/doc
@begin[(require scribble/manual @(require scribble/manual
(for-label (lib "scheme") (for-label scheme
"helper.ss"))] "helper.ss"))
@title{My Library} @title{My Library}
@ -305,6 +320,30 @@ of the result must be given; in this case, @scheme[my-helper]
guarantees a result that is a list where none of the elements are guarantees a result that is a list where none of the elements are
@scheme['cow]. @scheme['cow].
Finally, the documentation should declare the module that is being
defined. Use @scheme[defmodule] to declare the module name before any
other definitions.
@verbatim[#<<EOS
#lang scribble/doc
@(require scribble/manual
(for-label scheme
"helper.ss"))
@title{My Library}
@defmodule[my-lib/helper]{The @schememodname[my-lib/helper]
module---now with extra cows!}
@defproc[(my-helper [lst list?])
(listof
(not/c (one-of/c 'cow)))]{
Replaces each @scheme['cow] in @scheme[lst] with
@scheme['aardvark].}
EOS
]
Some things to notice in this example and the documentation that it Some things to notice in this example and the documentation that it
generates: generates:
@ -324,9 +363,12 @@ generates:
it's used in the scope of a procedure with argument it's used in the scope of a procedure with argument
@scheme[_lst].} @scheme[_lst].}
@item{If you hover the mouse pointer over @scheme[my-helper], a popup
reports that it is provided from @schemeidfont{my-lib/helper}.}
@item{If you use @scheme[my-helper] in any documentation now, as long @item{If you use @scheme[my-helper] in any documentation now, as long
as that documentation source also has a as that documentation source also has a @scheme[(require
@scheme[require-for-label] of @filepath{my-helper.ss}, then the (for-label ....))] of @filepath{my-helper.ss}, then the
reference is hyperlinked to the definition above.} reference is hyperlinked to the definition above.}
} }
@ -350,14 +392,17 @@ via @scheme[require-for-label] and @scheme[require]:
@verbatim[#<<EOS @verbatim[#<<EOS
#lang scribble/doc #lang scribble/doc
@begin[(require scribble/manual @(require scribble/manual
scribble/eval ; <--- added scribble/eval ; <--- added
"helper.ss" ; <--- added "helper.ss" ; <--- added
(for-label (lib "scheme") (for-label scheme
"helper.ss"))] "helper.ss"))]
@title{My Library} @title{My Library}
@defmodule[my-lib/helper]{The @schememodname[my-lib/helper]
module---now with extra cows!}
@defproc[(my-helper [lst list?]) @defproc[(my-helper [lst list?])
(listof (not/c (one-of/c 'cow)))]{ (listof (not/c (one-of/c 'cow)))]{
@ -384,10 +429,13 @@ In @filepath{manual.scrbl}:
@verbatim[#<<EOS @verbatim[#<<EOS
#lang scribble/doc #lang scribble/doc
@begin[(require scribble/manual)] @(require scribble/manual)
@title{My Library} @title{My Library}
@defmodule[my-lib/helper]{The @schememodname[my-lib/helper]
module---now with extra cows!}
@include-section["cows.scrbl"] @include-section["cows.scrbl"]
@include-section["aardvarks.scrbl"] @include-section["aardvarks.scrbl"]
EOS EOS
@ -397,7 +445,7 @@ In @filepath{cows.scrbl}:
@verbatim[#<<EOS @verbatim[#<<EOS
#lang scribble/doc #lang scribble/doc
@begin[(require scribble/manual)] @(require scribble/manual)
@title{Cows} @title{Cows}
@ -409,9 +457,9 @@ In @filepath{aardvarks.scrbl}:
@verbatim[#<<EOS @verbatim[#<<EOS
#lang scribble/doc #lang scribble/doc
@begin[(require scribble/manual @(require scribble/manual
(for-label (lib "scheme") (for-label scheme
"helper.ss"))] "helper.ss"))
@title{Aardvarks} @title{Aardvarks}
@ -423,7 +471,6 @@ In @filepath{aardvarks.scrbl}:
EOS EOS
] ]
@;---------------------------------------- @;----------------------------------------
@section{Multi-Page Sections} @section{Multi-Page Sections}
@ -441,7 +488,7 @@ Revising @filepath{cows.scrbl} from the previous section:
@verbatim[#<<EOS @verbatim[#<<EOS
#lang scribble/doc #lang scribble/doc
@begin[(require scribble/manual)] @(require scribble/manual)
@title[#:style '(toc)]{Cows} @title[#:style '(toc)]{Cows}

View File

@ -5,10 +5,10 @@
@title[#:tag "manual"]{PLT Manual Forms} @title[#:tag "manual"]{PLT Manual Forms}
@declare-exporting[scribble/manual] @defmodule[scribble/manual]{The @schememodname[scribble/manual]
provides all of @schememodname[scribble/basic], plus additional
The @filepath{manual.ss} module provides all of @filepath{basic.ss}, and functions that are relatively specific to writing PLT Scheme
more... documentation.}
@; ------------------------------------------------------------------------ @; ------------------------------------------------------------------------
@section[#:tag "scribble:manual:code"]{Typesetting Code} @section[#:tag "scribble:manual:code"]{Typesetting Code}
@ -102,7 +102,7 @@ without insetting the code.}
@scheme[datum] are typeset after a prompt representing a REPL.} @scheme[datum] are typeset after a prompt representing a REPL.}
@defform[(schememod lang datum ...)]{Like @scheme[schemeblock], but @defform[(schememod lang datum ...)]{Like @scheme[schemeblock], but
the @scheme[datum] are typeset inside a @schemefont{#module}-form the @scheme[datum] are typeset inside a @schememodfont{#lang}-form
module whose language is @scheme[lang].} module whose language is @scheme[lang].}
@defform[(scheme datum ...)]{Like @scheme[schemeblock], but typeset on @defform[(scheme datum ...)]{Like @scheme[schemeblock], but typeset on
@ -115,8 +115,10 @@ as a REPL value (i.e., a single color with no hyperlinks).}
@defform[(schemeid datum ...)]{Like @scheme[scheme], but typeset @defform[(schemeid datum ...)]{Like @scheme[scheme], but typeset
as an unbound identifier (i.e., no coloring or hyperlinks).} as an unbound identifier (i.e., no coloring or hyperlinks).}
@defform[(schememodname datum ...)]{Like @scheme[scheme], but typeset @defform[(schememodname datum)]{Like @scheme[scheme], but typeset as a
as a @schemefont{#module} language name.} module path. If @scheme[datum] is an identifier, then it is
hyperlinked to the module path's definition as created by
@scheme[defmodule].}
@defproc[(litchar [str string?]) element?]{Typesets @scheme[str] as a @defproc[(litchar [str string?]) element?]{Typesets @scheme[str] as a
representation of literal text. Use this when you have to talk about representation of literal text. Use this when you have to talk about
@ -130,7 +132,7 @@ useful with @scheme[verbatim].}
@defproc[(schemefont [pre-content any/c] ...) element?]{Typesets the given @defproc[(schemefont [pre-content any/c] ...) element?]{Typesets the given
content as uncolored, unhyperlinked Scheme. This procedure is useful content as uncolored, unhyperlinked Scheme. This procedure is useful
for typesetting things like @scheme{#module}, which are not for typesetting things like @schemefont{#lang}, which are not
@scheme[read]able by themselves.} @scheme[read]able by themselves.}
@defproc[(schemevalfont [pre-content any/c] ...) element?]{Like @defproc[(schemevalfont [pre-content any/c] ...) element?]{Like
@ -167,7 +169,65 @@ cannot work for some reason.}
in a form definition.} in a form definition.}
@; ------------------------------------------------------------------------ @; ------------------------------------------------------------------------
@section{Definition Reference} @section{Documenting Modules}
@defform[(defmodule id pre-flow ...)]{
Produces a sequence of flow elements (encaptured in a @scheme[splice])
to start the documentation for a module that can be @scheme[require]d
using the path @scheme[id]. The @scheme[pre-flow]s list is parsed as a
flow that documents the procedure (see @scheme[decode-flow]).
Besides generating text, this form expands to a use of
@scheme[declare-exporting] with @scheme[id].
Hyperlinks created by @scheme[schememodname] are associated with the
enclosing section, rather than the local @scheme[id] text.}
@defform[(defmodulelang id pre-flow ...)]{
Like @scheme[defmodule], but documents @scheme[id] as a module path
suitable for use by either @scheme[require] or @schememodfont{#lang}.}
@defform[(defmodule* (id ...) pre-flow ...)]{
Like @scheme[defmodule], but introduces multiple module paths instead
of just one.}
@defform[(defmodulelang* (id ...) pre-flow ...)]{
Like @scheme[defmodulelang], but introduces multiple module paths
instead of just one.}
@defform[(defmodule*/no-declare (id ...) pre-flow ...)]{
Like @scheme[defmodule*], but without expanding to
@scheme[declare-exporting]. Use this form when you want to provide a
more specific list of modules (e.g., to name both a specific module
and one that combines several modules) via your own
@scheme[declare-exporting] declaration.}
@defform[(defmodulelang*/no-declare (id ...) pre-flow ...)]{
Like @scheme[defmodulelang*], but without expanding to
@scheme[declare-exporting].}
@defform[(declare-exporting module-path ...)]{
Associates the @scheme[module-paths]s to all bindings defined within
the enclosing section, except as overridden by other
@scheme[declare-exporting] declarations in nested sub-sections. The
list of @scheme[module-path]s is shown, for example, when the user
hovers the mouse over one of the bindings defined within the section.}
@; ------------------------------------------------------------------------
@section{Documenting Forms, Functions, Structure Types, and Values}
@defform/subs[(defproc (id arg-spec ...) @defform/subs[(defproc (id arg-spec ...)
result-contract-expr-datum result-contract-expr-datum
@ -378,7 +438,7 @@ Like @scheme[schemegrammar], but for typesetting multiple productions
at once, aligned around the @litchar{=} and @litchar{|}.} at once, aligned around the @litchar{=} and @litchar{|}.}
@; ------------------------------------------------------------------------ @; ------------------------------------------------------------------------
@section{Classes and Interfaces} @section{Documenting Classes and Interfaces}
@defform[(defclass id super-id (intf-id ...) pre-flow ...)]{ @defform[(defclass id super-id (intf-id ...) pre-flow ...)]{

View File

@ -23,9 +23,7 @@ meaning of these S-expressions depends on the rest of your own code.
A PLT Scheme manual more likely starts with A PLT Scheme manual more likely starts with
@schemeblock[ @schememod[scribble/doc]
#, @schemefont{#lang scribble/doc}
]
which installs a reader, wraps the file content afterward into a which installs a reader, wraps the file content afterward into a
MzScheme module, and parses the body into a document using MzScheme module, and parses the body into a document using
@ -35,7 +33,7 @@ Another way to use the reader is to use the @scheme[use-at-readtable]
function to switch the current readtable to a readtable that parses function to switch the current readtable to a readtable that parses
@"@"-forms. You can do this in a single command line: @"@"-forms. You can do this in a single command line:
@commandline{mzscheme -Le reader.ss scribble "(use-at-readtable)"} @commandline{mzscheme -l scheme -l scribble/reader -e "(use-at-readtable)"}
@;-------------------------------------------------------------------- @;--------------------------------------------------------------------
@section{Concrete Syntax} @section{Concrete Syntax}
@ -721,9 +719,8 @@ an example of this.
@;-------------------------------------------------------------------- @;--------------------------------------------------------------------
@section{Interface} @section{Interface}
@declare-exporting[scribble/reader] @defmodule[scribble/reader]{The @schememodname[scribble/reader] module
provides direct Scribble reader functionality for advanced needs.}
The @filepath{reader.ss} module provides 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

View File

@ -13,23 +13,36 @@ tends to be format-independent, and it usually implemented completely
by the base renderer. The latter method generates the actual output, by the base renderer. The latter method generates the actual output,
which is naturally specific to a particular format. which is naturally specific to a particular format.
The @filepath{base-render.ss} module provides @scheme[render%], which @defmodule[scribble/base-render]{The
implements the core of a renderer. The @filepath{html-renderer.ss}, @schememodname[scribble/base-render] module provides @scheme[render%],
@filepath{latex-renderer.ss}, and @filepath{text-renderer.ss} modules each which implements the core of a renderer.}
provide @scheme[renderer-mixin] to extend the base. The
@filepath{html-renderer.ss} module also provides @defmodule*/no-declare[(scribble/text-render)]{The
@scheme[multi-renderer-mixin] to produce multi-file HTML instead @schememodname[scribble/text-render] module provides
instead of single-file HTML. @schemeidfont{renderer-mixin}, which specializes @scheme[render%] for
generating plain text.}
@defmodule*/no-declare[(scribble/html-render)]{The
@schememodname[scribble/html-render] module provides
@schemeidfont{renderer-mixin}, which specializes @scheme[render%] for
generating a single HTML file. It also supplies
@schemeidfont{multi-renderer-mixin}, which further specializes the
renderer to produce multi-file HTML.}
@defmodule*/no-declare[(scribble/latex-render)]{The
@schememodname[scribble/latex-render] module provides
@schemeidfont{renderer-mixin}, which specializes @scheme[render%] for
generating Latex.}
The mixin structure is meant to support document-specific extensions The mixin structure is meant to support document-specific extensions
to the renderers. For example, the @exec{scribble} command-line tool to the renderers. For example, the @exec{scribble} command-line tool
might, in the future, extract rendering mixins from a document module might, in the future, extract rendering mixins from a document module
(in addition to the document proper). (in addition to the document proper).
See @filepath{base-render.ss} for more information about the methods of See the @filepath{base-render.ss} source for more information about
the renderer. Documents built with higher layers, such as the methods of the renderer. Documents built with higher layers, such
@filepath{manual.ss}, generally do not call the render object's methods as @schememodname[scribble/manual], generally do not call the render
directly. object's methods directly.
@defclass[render% object% ()]{ @defclass[render% object% ()]{

View File

@ -0,0 +1,12 @@
#lang scribble/doc
@require[scribble/manual]
@require["utils.ss"]
@title[#:tag "scheme"]{Scheme}
@defmodule[scribble/scheme]{The @scheme[scribble/scheme] library
provides utilities for typesetting Scheme code. The
@scheme[scribble/manual] forms provide a higher-level interface.}
@italic{To do:} document this library!

View File

@ -26,52 +26,51 @@ The layers are:
@itemize{ @itemize{
@item{@filepath{reader.ss}: a reader that extends the syntax of Scheme @item{@schememodname[scribble/reader]: a reader that extends the
with @"@"-forms for conveniently embedding a mixin of text and syntax of Scheme with @"@"-forms for conveniently embedding a
escapes. See @secref["reader"].} mixin of text and escapes. See @secref["reader"].}
@item{@filepath{struct.ss}: a set of document datatypes and utilities @item{@schememodname[scribble/struct]: a set of document datatypes and utilities
that define the basic layout and processing of a document. See that define the basic layout and processing of a document. See
@secref["struct"].} @secref["struct"].}
@item{@filepath{base-render.ss} with @filepath{html-render.ss}, @item{@schememodname[scribble/base-render] with @schememodname[scribble/html-render],
@filepath{latex-render.ss}, or @filepath{text-render.ss}: A base @schememodname[scribble/latex-render], or @schememodname[scribble/text-render]: A base
renderer and mixins that generate documents in various formats renderer and mixins that generate documents in various formats
from instances of the @filepath{struct.ss} datatypes. See from instances of the @schememodname[scribble/struct] datatypes. See
@secref["renderer"].} @secref["renderer"].}
@item{@filepath{decode.ss}: Processes a stream of text, section-start @item{@schememodname[scribble/decode]: Processes a stream of text, section-start
markers, etc. to produce instances of the @filepath{struct.ss} markers, etc. to produce instances of the @schememodname[scribble/struct]
datatypes. See @secref["decode"].} datatypes. See @secref["decode"].}
@item{@filepath{doclang.ss}: to be used for the initial import of a @item{@schememodname[scribble/doclang]: to be used for the initial import of a
module; processes the module top level through module; processes the module top level through
@filepath{decode.ss}, and otherwise provides all of @schememodname[scribble/decode], and otherwise provides all of
@schememodname[big]. See @secref["doclang"].} @schememodname[scheme/base]. See @secref["doclang"].}
@item{@filepath{docreader.ss}: a reader that is meant to tbe used to @item{@schememodname[scribble/doc]: a language that essentially
process an entire file; it essentially combines combines @schememodname[scribble/reader] with
@filepath{reader.ss} with @filepath{doclang.ss}. See @schememodname[scribble/doclang]. See @secref["docreader"].}
@secref["docreader"].}
@item{@filepath{basic.ss}: a library of basic document operators---such @item{@schememodname[scribble/basic]: a library of basic document operators---such
as @scheme[title], @scheme[section], and @scheme[secref]---for as @scheme[title], @scheme[section], and @scheme[secref]---for
use with @filepath{decode.ss} and a renderer. See use with @schememodname[scribble/decode] and a renderer. See
@secref["basic"].} @secref["basic"].}
@item{@filepath{scheme.ss}: a library of support functions for @item{@schememodname[scribble/scheme]: a library of support functions for
typesetting Scheme code.} typesetting Scheme code. See @secref["scheme"].}
@item{@filepath{manual.ss}: a library of support functions for writing @item{@schememodname[scribble/manual]: a library of support functions for writing
PLT Scheme documentation; re-exports @filepath{basic.ss}. See PLT Scheme documentation; re-exports @schememodname[scribble/basic]. See
@secref["manual"].} @secref["manual"].}
@item{@filepath{eval.ss}: a library of support functions for ealuating @item{@schememodname[scribble/eval]: a library of support functions for ealuating
code at document-build time, especially for showing code at document-build time, especially for showing
examples. See @secref["eval"].} examples. See @secref["eval"].}
@item{@filepath{bnf.ss}: a library of support functions for writing @item{@schememodname[scribble/bnf]: a library of support functions for writing
grammars.} grammars. See @secref["bnf"].}
} }
@ -80,7 +79,7 @@ exports a @scheme{struct.ss}-based document, generating output with a
specified renderer. More specifically, the executable installs a specified renderer. More specifically, the executable installs a
renderer, loads the specified modules and extracts the @scheme[doc] renderer, loads the specified modules and extracts the @scheme[doc]
export of each (which must be an instance of @scheme[section] from export of each (which must be an instance of @scheme[section] from
@filepath{struct.ss}), and renders each. Use @exec{scribble -h} for more @schememodname[scribble/struct]), and renders each. Use @exec{scribble -h} for more
information. information.
@; ------------------------------------------------------------------------ @; ------------------------------------------------------------------------
@ -91,7 +90,9 @@ information.
@include-section["doclang.scrbl"] @include-section["doclang.scrbl"]
@include-section["docreader.scrbl"] @include-section["docreader.scrbl"]
@include-section["basic.scrbl"] @include-section["basic.scrbl"]
@include-section["scheme.scrbl"]
@include-section["manual.scrbl"] @include-section["manual.scrbl"]
@include-section["eval.scrbl"] @include-section["eval.scrbl"]
@include-section["bnf.scrbl"]
@index-section[] @index-section[]

View File

@ -4,7 +4,7 @@
@title[#:tag "struct"]{Document Structures And Processing} @title[#:tag "struct"]{Document Structures And Processing}
@declare-exporting[scribble/struct] @defmodule[scribble/struct]
A document is represented as a @techlink{part}, as described in A document is represented as a @techlink{part}, as described in
@secref["parts"]. This representation is intended to @secref["parts"]. This representation is intended to

View File

@ -219,11 +219,14 @@ displays).
@section{Command-line Options} @section{Command-line Options}
The @schememodname[slideshow/start] module can be invoked @defmodule[slideshow/start]
directly, in which case a module file name should be provided on
the command line to provide the slide content. Setup PLT creates The @exec{slideshow} executable invokes the
a @exec{Slideshow} executable that runs the @schememodname[slideshow/start] module, which inspects the command
@schememodname[slideshow/start] modue. line as reported by @scheme[current-command-line-arguments] to get
another module to provide the slide content. It also initializes
variables like @scheme[printing?] and @scheme[condense?] based on
flags supplied on the command line.
Thus, if the above example is in @filepath{multi-step.ss}, then the Thus, if the above example is in @filepath{multi-step.ss}, then the
command command

View File

@ -6,12 +6,13 @@
@declare-exporting[slideshow/pict slideshow] @declare-exporting[slideshow/pict slideshow]
The @schememodname[slideshow/pict] layer provides core functions for @defmodule*/no-declare[(slideshow/pict)]{ The
@schememodname[slideshow/pict] layer provides core functions for
constructing pictures, and it is independent of the slide viewer. This constructing pictures, and it is independent of the slide viewer. This
layer can be used, for example, to generate a picture as encapsulated layer can be used, for example, to generate a picture as encapsulated
PostScript for inclusion into a larger document. The PostScript for inclusion into a larger document. The
@schememodname[slideshow/pict] layer is re-provided by the @schememodname[slideshow/pict] layer is re-provided by the
@schememodname[slideshow] module. @schememodname[slideshow] language.}
@local-table-of-contents[] @local-table-of-contents[]

View File

@ -6,6 +6,10 @@
@declare-exporting[slideshow/base slideshow] @declare-exporting[slideshow/base slideshow]
@defmodule*/no-declare[(slideshow/base)]{The
@schememodname[slideshow/base] module, which is re-provided by
@schememodname[slideshow], provides the functions for creating slides.}
@local-table-of-contents[] @local-table-of-contents[]
@; ---------------------------------------------------------------------- @; ----------------------------------------------------------------------

View File

@ -19,6 +19,9 @@ Functional Presentations" #:author "Robert Bruce Findler and Matthew
Flatt" #:location @elem{@italic{Journal of Functional Programming}, Flatt" #:location @elem{@italic{Journal of Functional Programming},
16(4-5), pp. 583--619} #:date "2006" #:url paper-url]. 16(4-5), pp. 583--619} #:date "2006" #:url paper-url].
@defmodulelang*/no-declare[(slideshow)]{Most of the bindings defined in
the manual are provided by the @schememodname[slideshow] language.}
@table-of-contents[] @table-of-contents[]
@; ------------------------------------------------------------------------ @; ------------------------------------------------------------------------

View File

@ -1,4 +1,4 @@
#reader(lib "docreader.ss" "scribble") #lang scribble/doc
@require["../web-server.ss"] @require["../web-server.ss"]
@title{Web Server User Guide} @title{Web Server User Guide}

View File

@ -1,4 +1,4 @@
#reader(lib "docreader.ss" "scribble") #lang scribble/doc
@require["../web-server.ss"] @require["../web-server.ss"]
@title[#:tag "configuration" @title[#:tag "configuration"

View File

@ -1,4 +1,4 @@
#reader(lib "docreader.ss" "scribble") #lang scribble/doc
@require["../web-server.ss"] @require["../web-server.ss"]
@title[#:tag "dispatchers" @title[#:tag "dispatchers"

View File

@ -1,4 +1,4 @@
#reader(lib "docreader.ss" "scribble") #lang scribble/doc
@require["../web-server.ss"] @require["../web-server.ss"]
@title[#:tag "lang" @title[#:tag "lang"

View File

@ -1,4 +1,4 @@
#reader(lib "docreader.ss" "scribble") #lang scribble/doc
@require["../web-server.ss"] @require["../web-server.ss"]
@title[#:tag "managers" @title[#:tag "managers"

View File

@ -1,4 +1,4 @@
#reader(lib "docreader.ss" "scribble") #lang scribble/doc
@require["../web-server.ss"] @require["../web-server.ss"]
@title[#:tag "private" @title[#:tag "private"

View File

@ -1,4 +1,4 @@
#reader(lib "docreader.ss" "scribble") #lang scribble/doc
@require["../web-server.ss"] @require["../web-server.ss"]
@title[#:tag "run.ss" @title[#:tag "run.ss"

View File

@ -1,4 +1,4 @@
#reader(lib "docreader.ss" "scribble") #lang scribble/doc
@require["../web-server.ss"] @require["../web-server.ss"]
@title[#:tag "servlet-env.ss" @title[#:tag "servlet-env.ss"

View File

@ -1,4 +1,4 @@
#reader(lib "docreader.ss" "scribble") #lang scribble/doc
@require["../web-server.ss"] @require["../web-server.ss"]
@title[#:tag "servlet" @title[#:tag "servlet"

View File

@ -1,4 +1,4 @@
#reader(lib "docreader.ss" "scribble") #lang scribble/doc
@require["../web-server.ss"] @require["../web-server.ss"]
@title[#:tag "web-config-unit.ss" @title[#:tag "web-config-unit.ss"

View File

@ -1,4 +1,4 @@
#reader(lib "docreader.ss" "scribble") #lang scribble/doc
@require["../web-server.ss"] @require["../web-server.ss"]
@title[#:tag "web-server-ref"]{Web Server Reference Manual} @title[#:tag "web-server-ref"]{Web Server Reference Manual}

View File

@ -1,4 +1,4 @@
#reader(lib "docreader.ss" "scribble") #lang scribble/doc
@require["../web-server.ss"] @require["../web-server.ss"]
@title[#:tag "web-server-unit.ss" @title[#:tag "web-server-unit.ss"

View File

@ -3845,7 +3845,7 @@ static int generate_closure(Scheme_Closure_Data *data,
(void)mz_finish(GC_malloc_one_small_tagged); (void)mz_finish(GC_malloc_one_small_tagged);
} }
jit_retval(JIT_R0); jit_retval(JIT_R0);
init_word = *(long *)&example_so; init_word = *(long *)(void *)&example_so;
jit_movi_l(JIT_R1, init_word); jit_movi_l(JIT_R1, init_word);
jit_str_l(JIT_R0, JIT_R1); jit_str_l(JIT_R0, JIT_R1);
} }