From cd7157641cc8a1dd6266c926675e5909daeb643f Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Wed, 5 Dec 2007 21:41:07 +0000 Subject: [PATCH] Scribble improvements: defmodule & co. svn: r7902 --- collects/games/cards/doc.scrbl | 4 +- collects/scribble/decode.ss | 5 +- collects/scribble/doc/info.ss | 2 + collects/scribble/doc/lang/reader.ss | 2 +- collects/scribble/doc/main.ss | 6 + .../scribble/{docreader.ss => doc/reader.ss} | 4 +- collects/scribble/latex-render.ss | 1 + collects/scribble/manual-struct.ss | 1 + collects/scribble/manual.ss | 87 ++++++++++- collects/scribble/scribble.css | 10 ++ collects/scribblings/gui/gui.scrbl | 13 +- .../scribblings/guide/module-syntax.scrbl | 14 +- collects/scribblings/quick/quick.scrbl | 9 +- collects/scribblings/reference/class.scrbl | 1 - .../scribblings/reference/contracts.scrbl | 5 +- collects/scribblings/reference/match.scrbl | 2 + collects/scribblings/reference/mz.ss | 28 ++-- .../scribblings/reference/networking.scrbl | 2 - collects/scribblings/reference/numbers.scrbl | 1 - collects/scribblings/reference/pairs.scrbl | 1 - collects/scribblings/reference/port-lib.scrbl | 1 - .../scribblings/reference/pretty-print.scrbl | 1 - collects/scribblings/reference/reader.scrbl | 2 + .../scribblings/reference/reference.scrbl | 8 +- .../scribblings/reference/serialization.scrbl | 1 - collects/scribblings/reference/struct.scrbl | 1 - .../scribblings/reference/stx-trans.scrbl | 2 - .../scribblings/reference/subprocess.scrbl | 1 - .../scribblings/reference/syntax-model.scrbl | 4 +- collects/scribblings/reference/units.scrbl | 9 +- collects/scribblings/scribble/basic.scrbl | 12 +- collects/scribblings/scribble/bnf.scrbl | 59 +++++++ collects/scribblings/scribble/decode.scrbl | 24 +-- collects/scribblings/scribble/doclang.scrbl | 13 +- collects/scribblings/scribble/docreader.scrbl | 11 +- collects/scribblings/scribble/eval.scrbl | 9 +- collects/scribblings/scribble/how-to.scrbl | 145 ++++++++++++------ collects/scribblings/scribble/manual.scrbl | 80 ++++++++-- collects/scribblings/scribble/reader.scrbl | 11 +- collects/scribblings/scribble/renderer.scrbl | 35 +++-- collects/scribblings/scribble/scheme.scrbl | 12 ++ collects/scribblings/scribble/scribble.scrbl | 53 +++---- collects/scribblings/scribble/struct.scrbl | 2 +- collects/scribblings/slideshow/guide.scrbl | 13 +- collects/scribblings/slideshow/picts.scrbl | 5 +- collects/scribblings/slideshow/slides.scrbl | 4 + .../scribblings/slideshow/slideshow.scrbl | 3 + .../web-server/docs/guide/web-guide.scrbl | 2 +- .../docs/reference/configuration.scrbl | 2 +- .../docs/reference/dispatchers.scrbl | 2 +- collects/web-server/docs/reference/lang.scrbl | 2 +- .../web-server/docs/reference/managers.scrbl | 2 +- .../web-server/docs/reference/private.scrbl | 2 +- .../web-server/docs/reference/running.scrbl | 2 +- .../docs/reference/servlet-env.scrbl | 2 +- .../web-server/docs/reference/servlet.scrbl | 2 +- .../docs/reference/web-config-unit.scrbl | 2 +- .../docs/reference/web-reference.scrbl | 2 +- .../docs/reference/web-server-unit.scrbl | 2 +- src/mzscheme/src/jit.c | 2 +- 60 files changed, 528 insertions(+), 217 deletions(-) create mode 100644 collects/scribble/doc/info.ss create mode 100644 collects/scribble/doc/main.ss rename collects/scribble/{docreader.ss => doc/reader.ss} (89%) create mode 100644 collects/scribblings/scribble/bnf.scrbl create mode 100644 collects/scribblings/scribble/scheme.scrbl diff --git a/collects/games/cards/doc.scrbl b/collects/games/cards/doc.scrbl index eb5926fe49..cb1647acef 100644 --- a/collects/games/cards/doc.scrbl +++ b/collects/games/cards/doc.scrbl @@ -5,9 +5,7 @@ @title{Virtual Playing Cards Library} -@declare-exporting[games/cards] - -The library is @scheme[games/cards]. +@defmodule[games/cards] @defproc[(make-table [title string? "Cards"] [w nonnegative-exact-integer? 7] diff --git a/collects/scribble/decode.ss b/collects/scribble/decode.ss index af2affd32c..0b11accc8e 100644 --- a/collects/scribble/decode.ss +++ b/collects/scribble/decode.ss @@ -26,7 +26,8 @@ [splice ([run list?])] [part-index-decl ([plain-seq (listof string?)] [entry-seq list?])] - [part-collect-decl ([element element?])]) + [part-collect-decl ([element element?])] + [part-tag-decl ([tag tag?])]) (define (decode-string s) (let loop ([l '((#rx"---" mdash) @@ -173,6 +174,8 @@ (loop (cdr l) next? (cons (car l) keys) colls accum title tag-prefix tags style)] [(part-collect-decl? (car l)) (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)) (splice? (cadr l))) (loop (cons (car l) (append (splice-run (cadr l)) (cddr l))) next? keys colls accum title tag-prefix tags style)] diff --git a/collects/scribble/doc/info.ss b/collects/scribble/doc/info.ss new file mode 100644 index 0000000000..414f9d22c2 --- /dev/null +++ b/collects/scribble/doc/info.ss @@ -0,0 +1,2 @@ +(module info setup/infotab + (define name "Scribble Doc Reader")) diff --git a/collects/scribble/doc/lang/reader.ss b/collects/scribble/doc/lang/reader.ss index fbe0d07252..fa4f99f8dd 100644 --- a/collects/scribble/doc/lang/reader.ss +++ b/collects/scribble/doc/lang/reader.ss @@ -1,4 +1,4 @@ (module reader mzscheme - (require (prefix doc: (lib "docreader.ss" "scribble"))) + (require (prefix doc: (lib "reader.ss" "scribble" "doc"))) (provide (rename doc:read read) (rename doc:read-syntax read-syntax))) diff --git a/collects/scribble/doc/main.ss b/collects/scribble/doc/main.ss new file mode 100644 index 0000000000..6dd33c881e --- /dev/null +++ b/collects/scribble/doc/main.ss @@ -0,0 +1,6 @@ +(module main scheme/base + (define-syntax-rule (out) + (begin (require scribble/doclang) + (provide (all-from-out scribble/doclang)))) + (out)) + diff --git a/collects/scribble/docreader.ss b/collects/scribble/doc/reader.ss similarity index 89% rename from collects/scribble/docreader.ss rename to collects/scribble/doc/reader.ss index b9e6ea8b60..72cb294362 100644 --- a/collects/scribble/docreader.ss +++ b/collects/scribble/doc/reader.ss @@ -1,6 +1,6 @@ -(module docreader scheme/base - (require (prefix-in scribble: "reader.ss")) +(module reader scheme/base + (require (prefix-in scribble: "../reader.ss")) (provide (rename-out [*read read]) (rename-out [*read-syntax read-syntax])) diff --git a/collects/scribble/latex-render.ss b/collects/scribble/latex-render.ss index 6fed316231..f84b3fa665 100644 --- a/collects/scribble/latex-render.ss +++ b/collects/scribble/latex-render.ss @@ -50,6 +50,7 @@ (define-color "schemesymbol" "IdentifierColor") (define-color "schemevalue" "ValueColor") (define-color "schemevaluelink" "blue") + (define-color "schememodlink" "blue") (define-color "schemeresult" "ResultColor") (define-color "schemestdout" "OutputColor") (define-color "schememeta" "IdentifierColor") diff --git a/collects/scribble/manual-struct.ss b/collects/scribble/manual-struct.ss index eea0b8a858..11c0224ee2 100644 --- a/collects/scribble/manual-struct.ss +++ b/collects/scribble/manual-struct.ss @@ -4,6 +4,7 @@ scheme/contract) (provide-structs + [module-path-index-desc ()] [exported-index-desc ([name symbol?] [from-libs (listof module-path?)])] [(method-index-desc exported-index-desc) ([method-name symbol?] diff --git a/collects/scribble/manual.ss b/collects/scribble/manual.ss index e9e54c410a..0359209c8e 100644 --- a/collects/scribble/manual.ss +++ b/collects/scribble/manual.ss @@ -47,8 +47,11 @@ #'here `(unsyntax (make-element #f - (list (schemefont ,(format "#lang ")) - (schemeidfont ,(format "~s" (syntax-e #'lang)))))) + (list hash-lang + (hspace 1) + (as-modname-link + ',#'lang + (to-element ',#'lang))))) #'lang)]) #'(schemeblock modtag rest ...))])) @@ -83,7 +86,76 @@ (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 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) (unless (andmap string? strs) @@ -148,6 +220,8 @@ schemeinput schememod scheme scheme/form schemeresult schemeid schememodname + defmodule defmodule* defmodulelang defmodulelang* + defmodule*/no-declare defmodulelang*/no-declare indexed-scheme litchar verbatim) @@ -1375,6 +1449,13 @@ c))) (provide pidefterm) + + (define hash-lang (make-link-element + "schememodlink" + (list (schememodfont "#lang")) + `(part ,(doc-prefix '(lib "scribblings/guide/guide.scrbl") + "hash-lang")))) + ;; ---------------------------------------- (provide math) diff --git a/collects/scribble/scribble.css b/collects/scribble/scribble.css index 0604c3feca..2365f2372e 100644 --- a/collects/scribble/scribble.css +++ b/collects/scribble/scribble.css @@ -289,6 +289,11 @@ background-color: #ddddff; } + .defmodule { + width: 100%; + background-color: #F5F5DC; + } + .specgrammar { float: right; } @@ -369,6 +374,11 @@ color: blue; } + .schememodlink { + text-decoration: none; + color: blue; + } + .schemesyntaxlink { text-decoration: none; color: black; diff --git a/collects/scribblings/gui/gui.scrbl b/collects/scribblings/gui/gui.scrbl index 3f15d5c4d0..39cf5404bd 100644 --- a/collects/scribblings/gui/gui.scrbl +++ b/collects/scribblings/gui/gui.scrbl @@ -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 Scheme}} for an introduction to MrEd. -The @scheme[(lib "mred")] module provides all of the class, interface, - and procedure bindings defined in this manual. The - @schememodname[big-gui] language (for use with @schemefont{#module}) - extends the @schememodname[big] language with @scheme[(lib "mred")]. +@defmodule*/no-declare[(mred)]{The @schememodname[mred] module provides +all of the class, interface, and procedure bindings defined in this +manual.} + +@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[] diff --git a/collects/scribblings/guide/module-syntax.scrbl b/collects/scribblings/guide/module-syntax.scrbl index ab3f415d05..679ec17f6d 100644 --- a/collects/scribblings/guide/module-syntax.scrbl +++ b/collects/scribblings/guide/module-syntax.scrbl @@ -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 -@litchar{#lang} shorthand. In general, the syntax is determined by -the language name that follows @litchar{#lang}. +The body of a @schememodfont{#lang} shorthand has no specific syntax, +because the syntax is determined by the language name that follows +@schememodfont{#lang}. In the case of @schememodfont{#lang} @schememodname[scheme], the syntax is @@ -107,3 +107,9 @@ the longhand expansion uses @scheme[scheme/base] instead of @scheme[scheme]. The @schememodfont{#lang} @scheme[honu] form, in contrast, has a completely different syntax that doesn't even look 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. diff --git a/collects/scribblings/quick/quick.scrbl b/collects/scribblings/quick/quick.scrbl index 08ec1247e3..5e31be1b15 100644 --- a/collects/scribblings/quick/quick.scrbl +++ b/collects/scribblings/quick/quick.scrbl @@ -394,11 +394,10 @@ Modules are named and distributed in various ways: @item{Some modules are packaged in the PLT Scheme distribution or otherwise installed into a hierarchy of @defterm{collections}. For example, the module name - @schememodname[slideshow/flash] means ``the module - implemented in the file @filepath{flash.ss} that is located in the - @filepath{slideshow} collection.'' The @schememodname[slideshow] - specification with @schemefont{#lang} is a shorthand for - @schememodname[slideshow/main].} + @schememodname[slideshow/flash] means ``the module implemented + in the file @filepath{flash.ss} that is located in the + @filepath{slideshow} collection.'' When a module name includes + no slash, then it refers to a @filepath{main.ss} file.} @item{Some modules are distributed through the @link[url:planet]{@PLaneT} server, and they can be diff --git a/collects/scribblings/reference/class.scrbl b/collects/scribblings/reference/class.scrbl index 8bb4fbd29f..64aa57aa4c 100644 --- a/collects/scribblings/reference/class.scrbl +++ b/collects/scribblings/reference/class.scrbl @@ -71,7 +71,6 @@ @title[#:tag "mzlib:class" #:style 'toc]{Classes and Objects} -@declare-exporting[scheme/class scheme] @note-lib[scheme/class] @local-table-of-contents[] diff --git a/collects/scribblings/reference/contracts.scrbl b/collects/scribblings/reference/contracts.scrbl index c502e9bafb..803483e806 100644 --- a/collects/scribblings/reference/contracts.scrbl +++ b/collects/scribblings/reference/contracts.scrbl @@ -3,14 +3,13 @@ @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 expectations of one party are met by another party. The @scheme[provide/contract] form is the primary mechanism for associating a contract with a binding. +@note-lib[scheme/contract] + @local-table-of-contents[] @; ---------------------------------------- diff --git a/collects/scribblings/reference/match.scrbl b/collects/scribblings/reference/match.scrbl index 7d8c431508..d98efee503 100644 --- a/collects/scribblings/reference/match.scrbl +++ b/collects/scribblings/reference/match.scrbl @@ -9,6 +9,8 @@ The @scheme[match] form and related forms support general pattern matching on Scheme values. See also @secref["regexp"] for information on regular-expression matching on strings, bytes, and streams. +@note-lib[scheme/match] + @defform/subs[(match val-expr clause ...) ([clause [pat expr ...+] [pat (=> identifier) expr ...+]])]{ diff --git a/collects/scribblings/reference/mz.ss b/collects/scribblings/reference/mz.ss index cc9dcf0913..5f7763f64a 100644 --- a/collects/scribblings/reference/mz.ss +++ b/collects/scribblings/reference/mz.ss @@ -20,21 +20,25 @@ (provide note-lib) (define-syntax-rule (note-lib lib) - (t "The bindings documented in this section are provided by the " - (schememodname lib) - " and " - (schememodname scheme) - " libraries, but not " (schememodname scheme/base) - ".")) + (begin + (declare-exporting lib scheme) + (defmodule*/no-declare (lib) + (t "The bindings documented in this section are provided by the " + (schememodname lib) + " and " + (schememodname scheme) + " libraries, but not " (schememodname scheme/base) + ".")))) (provide note-lib-only) (define-syntax-rule (note-lib-only lib) - (t "The bindings documented in this section are provided by the " - (schememodname lib) - " library, not " (schememodname scheme/base) - " or " (schememodname scheme) - ".")) - + (defmodule lib + (t "The bindings documented in this section are provided by the " + (schememodname lib) + " library, not " (schememodname scheme/base) + " or " (schememodname scheme) + "."))) + (define (*exnraise s) (make-element #f (list s " exception is raised"))) (define-syntax exnraise diff --git a/collects/scribblings/reference/networking.scrbl b/collects/scribblings/reference/networking.scrbl index 0732f63f48..47477bd90c 100644 --- a/collects/scribblings/reference/networking.scrbl +++ b/collects/scribblings/reference/networking.scrbl @@ -8,7 +8,6 @@ @;------------------------------------------------------------------------ @section[#:tag "tcp"]{TCP} -@declare-exporting[scheme/tcp] @note-lib[scheme/tcp] 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} -@declare-exporting[scheme/udp] @note-lib[scheme/udp] For information about UDP in general, see @italic{TCP/IP Illustrated, diff --git a/collects/scribblings/reference/numbers.scrbl b/collects/scribblings/reference/numbers.scrbl index 30e037c2a9..c421eb5d1e 100644 --- a/collects/scribblings/reference/numbers.scrbl +++ b/collects/scribblings/reference/numbers.scrbl @@ -759,7 +759,6 @@ is little-endian.} @; ------------------------------------------------------------------------ @section{Extra Constants and Functions} -@declare-exporting[scheme/math scheme] @note-lib[scheme/math] @defthing[euler real?]{ diff --git a/collects/scribblings/reference/pairs.scrbl b/collects/scribblings/reference/pairs.scrbl index ec3c050d31..2f9c9d616e 100644 --- a/collects/scribblings/reference/pairs.scrbl +++ b/collects/scribblings/reference/pairs.scrbl @@ -451,7 +451,6 @@ Like @scheme[assoc], but finds an element using the predicate @; ---------------------------------------- @section{List Synonyms} -@declare-exporting[scheme/list scheme] @note-lib[scheme/list] @defthing[empty null?]{The empty list.} diff --git a/collects/scribblings/reference/port-lib.scrbl b/collects/scribblings/reference/port-lib.scrbl index 45379b77fb..485f9fccf6 100644 --- a/collects/scribblings/reference/port-lib.scrbl +++ b/collects/scribblings/reference/port-lib.scrbl @@ -4,7 +4,6 @@ @title[#:tag "customport"]{More Port Constructors and Events} -@declare-exporting[scheme/port scheme] @note-lib[scheme/port] @; ---------------------------------------------------------------------- diff --git a/collects/scribblings/reference/pretty-print.scrbl b/collects/scribblings/reference/pretty-print.scrbl index f73558c1f7..bae463ba43 100644 --- a/collects/scribblings/reference/pretty-print.scrbl +++ b/collects/scribblings/reference/pretty-print.scrbl @@ -4,7 +4,6 @@ @title[#:tag "pretty-print"]{Pretty Printing} -@declare-exporting[scheme/pretty scheme] @note-lib[scheme/pretty] @defproc[(pretty-print [v any/c] [port output-port? (current-output-port)]) diff --git a/collects/scribblings/reference/reader.scrbl b/collects/scribblings/reference/reader.scrbl index c458591c76..a25979a298 100644 --- a/collects/scribblings/reference/reader.scrbl +++ b/collects/scribblings/reference/reader.scrbl @@ -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 @exnraise[exn:fail:read]. +@guideintro["hash-lang"]{@schememodfont["#lang"]} + The @as-index{@litchar{#lang}} reader form is similar, but more constrained: the @litchar{#lang} must be followed by a single space (ASCII 32), and then a non-empty sequence of alphanumeric ASCII, diff --git a/collects/scribblings/reference/reference.scrbl b/collects/scribblings/reference/reference.scrbl index 2806e71e71..94c0852bd7 100644 --- a/collects/scribblings/reference/reference.scrbl +++ b/collects/scribblings/reference/reference.scrbl @@ -4,13 +4,17 @@ @title[#:tag-prefix '(lib "scribblings/reference/reference.scrbl") #:tag "top"]{PLT Scheme Reference} -@declare-exporting[scheme/base scheme] - This manual defines the core PLT Scheme language and describes its most prominent libraries. The companion manual @|Guide| provides a friendlier (though less precise and less complete) overview of the 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[] @include-section["model.scrbl"] diff --git a/collects/scribblings/reference/serialization.scrbl b/collects/scribblings/reference/serialization.scrbl index f9e05a0b2f..27f0b4a383 100644 --- a/collects/scribblings/reference/serialization.scrbl +++ b/collects/scribblings/reference/serialization.scrbl @@ -5,7 +5,6 @@ @title[#:tag "serialization"]{Serialization} -@declare-exporting[scheme/serialize] @note-lib-only[scheme/serialize] @defproc[(serializable? [v any/c]) boolean?]{ diff --git a/collects/scribblings/reference/struct.scrbl b/collects/scribblings/reference/struct.scrbl index 5a731b8595..63889f2933 100644 --- a/collects/scribblings/reference/struct.scrbl +++ b/collects/scribblings/reference/struct.scrbl @@ -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 type. -@declare-exporting[scheme/struct-info scheme] @note-lib-only[scheme/struct-info] @defproc[(struct-info? [v any/c]) boolean?]{ diff --git a/collects/scribblings/reference/stx-trans.scrbl b/collects/scribblings/reference/stx-trans.scrbl index 31da529363..e7d4c605e7 100644 --- a/collects/scribblings/reference/stx-trans.scrbl +++ b/collects/scribblings/reference/stx-trans.scrbl @@ -416,7 +416,6 @@ and different result procedures use distinct marks.} @section[#:tag "require-trans"]{@scheme[require] Transformers} -@declare-exporting[scheme/require-transform] @note-lib-only[scheme/require-transform] 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} -@declare-exporting[scheme/provide-transform] @note-lib-only[scheme/provide-transform] A @tech{transformer binding} whose value is a structure with the diff --git a/collects/scribblings/reference/subprocess.scrbl b/collects/scribblings/reference/subprocess.scrbl index 8fbe5b5ce0..8e5abc2c30 100644 --- a/collects/scribblings/reference/subprocess.scrbl +++ b/collects/scribblings/reference/subprocess.scrbl @@ -224,7 +224,6 @@ real process ID). @section{Simple Subprocesses} -@declare-exporting[scheme/system] @note-lib-only[scheme/system] @defproc[(system [command string?]) boolean?]{ diff --git a/collects/scribblings/reference/syntax-model.scrbl b/collects/scribblings/reference/syntax-model.scrbl index 6ec2e1c186..ad6f1c31ea 100644 --- a/collects/scribblings/reference/syntax-model.scrbl +++ b/collects/scribblings/reference/syntax-model.scrbl @@ -109,7 +109,7 @@ other information. For example, a @schemeidfont{car} @tech{identifier} might have @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 @tech{lexical information} may indicate that it represents a procedure 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 @tech{syntax-object} list whose first element is an @tech{identifier}, 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 one whose binding is @scheme[define-values]). In all cases, identifiers above typeset as syntactic-form names refer to the diff --git a/collects/scribblings/reference/units.scrbl b/collects/scribblings/reference/units.scrbl index 6263dd95cc..cb6815ba7d 100644 --- a/collects/scribblings/reference/units.scrbl +++ b/collects/scribblings/reference/units.scrbl @@ -23,11 +23,6 @@ @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 compilable and reusable components. A unit resembles a procedure in 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 from the linked units for further linking. +@note-lib[scheme/unit] + +@local-table-of-contents[] + @; ------------------------------------------------------------------------ @section[#:tag "creatingunits"]{Creating Units} diff --git a/collects/scribblings/scribble/basic.scrbl b/collects/scribblings/scribble/basic.scrbl index baf5a0a8f5..57c1592e61 100644 --- a/collects/scribblings/scribble/basic.scrbl +++ b/collects/scribblings/scribble/basic.scrbl @@ -21,12 +21,12 @@ @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 -used from code written either in Scheme or with @elem["@"] -expressions. For example, the @scheme[title] and @scheme[italic] -functions might be called from Scheme as +For example, the @scheme[title] and @scheme[italic] functions might be +called from Scheme as @schemeblock[ (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["@"] 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]). @; ------------------------------------------------------------------------ diff --git a/collects/scribblings/scribble/bnf.scrbl b/collects/scribblings/scribble/bnf.scrbl new file mode 100644 index 0000000000..72cd5a80f6 --- /dev/null +++ b/collects/scribblings/scribble/bnf.scrbl @@ -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.} diff --git a/collects/scribblings/scribble/decode.scrbl b/collects/scribblings/scribble/decode.scrbl index 92b2ad2598..2bc8854527 100644 --- a/collects/scribblings/scribble/decode.scrbl +++ b/collects/scribblings/scribble/decode.scrbl @@ -4,12 +4,11 @@ @title[#:tag "decode"]{Text Decoder} -@declare-exporting[scribble/decode] - -The @filepath{decode.ss} library helps you write document content in a -natural way---more like plain text, except for @litchar["@"] escapes. -Roughly, it processes a stream of strings to produces instances of the -@filepath{struct.ss} datatypes (see @secref["struct"]). +@defmodule[scribble/decode]{The @schememodname[scribble/decode] +library helps you write document content in a natural way---more like +plain text, except for @litchar["@"] escapes. Roughly, it processes a +stream of strings to produces instances of the +@schememodname[scribble/struct] datatypes (see @secref["struct"]).} At the flow level, decoding recognizes a blank line as a paragraph 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 that point to the section. Instances of @scheme[part-collect-decl] add elements to the part that are used only during the @techlink{collect -pass}. Instances of @scheme[part-start] at level 0 trigger sub-part -parsing. Instances of @scheme[section] trigger are used as-is as -subsections, and instances of @scheme[paragraph] and other +pass}. Instances of @scheme[part-tag-decl] add hyperlink tags to the +section title. Instances of @scheme[part-start] at level 0 trigger +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. } @@ -129,6 +129,12 @@ See @scheme[decode]. } +@defstruct[part-tag-decl ([tag tag?])]{ + +See @scheme[decode]. + +} + @defstruct[splice ([run list?])]{ See @scheme[decode], @scheme[decode-part], and @scheme[decode-flow]. diff --git a/collects/scribblings/scribble/doclang.scrbl b/collects/scribblings/scribble/doclang.scrbl index 44bd1f3f75..f2ebb8fe81 100644 --- a/collects/scribblings/scribble/doclang.scrbl +++ b/collects/scribblings/scribble/doclang.scrbl @@ -4,13 +4,14 @@ @title[#:tag "doclang"]{Document Module Language} -The @filepath{doclang.ss} module is suitable for use as a module -language. It provides everything from @scheme[mzscheme], except that -it replaces the @scheme[#%module-begin] form. +@defmodule[scribble/doclang]{The @schememodname[scribble/doclang] +language provides everything from @scheme[scheme/base], except that it +replaces the @scheme[#%module-begin] form.} -The @filepath{doclang.ss} @scheme[#%module-begin] essentially packages the -body of the module into a call to @scheme[decode], binds the result to -@scheme[doc], and exports @scheme[doc]. +The @schememodname[scribble/doclang] @scheme[#%module-begin] +essentially packages the body of the module into a call to +@scheme[decode], binds the result to @scheme[doc], and exports +@scheme[doc]. Any module-level form other than an expression (e.g., a @scheme[require] or @scheme[define]) is remains at the top level, and diff --git a/collects/scribblings/scribble/docreader.scrbl b/collects/scribblings/scribble/docreader.scrbl index 24a92d9cda..ebfc4899d4 100644 --- a/collects/scribblings/scribble/docreader.scrbl +++ b/collects/scribblings/scribble/docreader.scrbl @@ -5,9 +5,8 @@ @title[#:tag "docreader"]{Document Reader} -The @filepath{docreader.ss} module is suitable for use with -@schemefont{#reader} at the beginning of a file. It reads the entire -file with @scheme[read-inside-syntax] from Scribble's -@filepath{reader.ss}, and then wraps the result with @scheme[(module #, -@nonterm{name} (lib "doclang.ss" "scribble") ...)], where -@nonterm{name} is derived from the enclosing file's name. +@defmodule[scribble/doc]{The @schememodname[scribble/doc] language is +the same as @schememodname[scribble/doclang], except that +@scheme[read-inside-syntax] is used to read the body of the module. In +other words, the module body starts in Scribble ``text'' mode instead +of S-expression mode.} diff --git a/collects/scribblings/scribble/eval.scrbl b/collects/scribblings/scribble/eval.scrbl index eca3216cf7..2592e4e803 100644 --- a/collects/scribblings/scribble/eval.scrbl +++ b/collects/scribblings/scribble/eval.scrbl @@ -4,11 +4,10 @@ @title[#:tag "eval"]{Evaluation and Examples} -@declare-exporting[scribble/eval] - -The @filepath{eval.ss} library provides utilities for evaluating code at -document-build time and incorporating the results in the document, -especially to show example uses of defined procedures and syntax. +@defmodule[scribble/eval]{The @scheme[scribble/eval] library provides +utilities for evaluating code at document-build time and incorporating +the results in the document, especially to show example uses of +defined procedures and syntax.} @defform[(interaction datum ...)]{Like @scheme[schemeinput], except that the result for each input @scheme[datum] is shown on the next diff --git a/collects/scribblings/scribble/how-to.scrbl b/collects/scribblings/scribble/how-to.scrbl index 570d913bf9..4bec9e8e4d 100644 --- a/collects/scribblings/scribble/how-to.scrbl +++ b/collects/scribblings/scribble/how-to.scrbl @@ -19,7 +19,7 @@ To document a collection or @|PLaneT| package: @item{Start @filepath{manual.scrbl} like this: @verbatim[#<