fix single-html scribble builds by planet; fix up teachpack docs; add Dave to acks; add a #:use-sources in errortrace docs

svn: r10139
This commit is contained in:
Matthew Flatt 2008-06-05 00:21:36 +00:00
parent 50cd17833f
commit 413c90c0dc
11 changed files with 54 additions and 25 deletions

View File

@ -32,6 +32,7 @@
"Paul Graunke, " "Paul Graunke, "
"Kathy Gray, " "Kathy Gray, "
"Dan Grossman, " "Dan Grossman, "
"Dave Gurnell, "
"Bruce Hauman, " "Bruce Hauman, "
"Dave Herman, " "Dave Herman, "
"Mark Krentel, " "Mark Krentel, "

View File

@ -7,7 +7,7 @@
(define tool-names (list "Essentials of Programming Languages")) (define tool-names (list "Essentials of Programming Languages"))
(define tool-urls (list "http://www.cs.indiana.edu/eopl/")) (define tool-urls (list "http://www.cs.indiana.edu/eopl/"))
(define scribblings '(("eopl.scrbl" () (language -11)))) (define scribblings '(("eopl.scrbl" () (language -12))))
(define textbook-pls (define textbook-pls
(list (list '("eopl-small.gif" "eopl") (list (list '("eopl-small.gif" "eopl")

View File

@ -69,7 +69,8 @@ parameters.
@; --------------------------------------------- @; ---------------------------------------------
@section[#:tag "using-errortrace"]{Using Errortrace} @section[#:tag "using-errortrace"]{Using Errortrace}
@defmodule[errortrace]
@defmodule[errortrace #:use-sources (errortrace/errortrace-lib)]
@; --------------------------------------------- @; ---------------------------------------------

View File

@ -3,4 +3,4 @@
(define name "PLaneT") (define name "PLaneT")
(define mzscheme-launcher-names '("planet")) (define mzscheme-launcher-names '("planet"))
(define mzscheme-launcher-libraries '("planet.ss")) (define mzscheme-launcher-libraries '("planet.ss"))
(define scribblings '(("planet.scrbl" (multi-page)))) (define scribblings '(("planet.scrbl" (multi-page) (tool))))

View File

@ -269,12 +269,15 @@
(define (render src-file dest-dir multi-page?) (define (render src-file dest-dir multi-page?)
(parameterize ([current-namespace (namespace-anchor->empty-namespace anchor)]) (parameterize ([current-namespace (namespace-anchor->empty-namespace anchor)])
(make-directory* dest-dir) (make-directory* dest-dir)
(let* ([renderer (new ((if multi-page? (let* ([index-dir (if multi-page?
(let-values ([(base name dir?) (split-path dest-dir)]) base)
dest-dir)]
[renderer (new ((if multi-page?
(dynamic-require 'scribble/html-render 'render-multi-mixin) (dynamic-require 'scribble/html-render 'render-multi-mixin)
values) values)
((dynamic-require 'scribble/html-render 'render-mixin) ((dynamic-require 'scribble/html-render 'render-mixin)
(dynamic-require 'scribble/base-render 'render%))) (dynamic-require 'scribble/base-render 'render%)))
[dest-dir dest-dir] [dest-dir index-dir]
[root-path dest-dir])] [root-path dest-dir])]
[doc (dynamic-require `(file ,(path->string src-file)) 'doc)] [doc (dynamic-require `(file ,(path->string src-file)) 'doc)]
[ci (send renderer collect (list doc) (list dest-dir))] [ci (send renderer collect (list doc) (list dest-dir))]
@ -283,7 +286,12 @@
[ri (send renderer resolve (list doc) (list dest-dir) ci)]) [ri (send renderer resolve (list doc) (list dest-dir) ci)])
(send renderer set-external-tag-path (send renderer set-external-tag-path
"/servlets/doc-search.ss") "/servlets/doc-search.ss")
(send renderer render (list doc) (list dest-dir) ri) (send renderer render
(list doc)
(list (if multi-page?
dest-dir
(build-path dest-dir "index.html")))
ri)
;; return cross-reference info: ;; return cross-reference info:
(send renderer serialize-info ri)))) (send renderer serialize-info ri))))
@ -347,9 +355,9 @@
(error (format "scribblings file ~a not found" filename))) (error (format "scribblings file ~a not found" filename)))
(printf "Building: ~a\n" filename) (printf "Building: ~a\n" filename)
(let* ([name.scrbl (file-name-from-path filename)] (let* ([name.scrbl (file-name-from-path filename)]
[name (cadr (regexp-match #rx"(.*)\\.scrbl$" (path->string name.scrbl)))]) [name (path-replace-suffix name.scrbl #"")])
(render (build-path filename) (render (build-path filename)
(build-path SCRIBBLE-DOCUMENT-DIR (string-append name "/")) (build-path SCRIBBLE-DOCUMENT-DIR name)
(memq 'multi-page flags)))] (memq 'multi-page flags)))]
[_ (error "malformed scribblings entry")]))))) [_ (error "malformed scribblings entry")])))))

View File

@ -49,7 +49,10 @@ Represents a renderer.
[refer-to-existing-files any/c #f] [refer-to-existing-files any/c #f]
[root-path (or/c path-string? false/c) #f])]{ [root-path (or/c path-string? false/c) #f])]{
Creates a renderer whose output goes to @scheme[dest-dir]. Creates a renderer whose output will go to @scheme[dest-dir]. For
example, @scheme[dest-dir] could name the directory containing the
output Latex file, the HTML file for a single-file output, or the
output sub-directory for multi-file HTML output.
If @scheme[root-path] is not @scheme[#f], it is normally the same as If @scheme[root-path] is not @scheme[#f], it is normally the same as
@scheme[dest-dir] or a parent of @scheme[dest-dir]. It causes @scheme[dest-dir] or a parent of @scheme[dest-dir]. It causes
@ -64,21 +67,30 @@ moved).}
[dests (listof path-string?)]) [dests (listof path-string?)])
collect-info?]{ collect-info?]{
Performs the @techlink{collect pass}.} Performs the @techlink{collect pass}. See @method[render% render] for
information on the @scheme[dests] argument.}
@defmethod[(resolve [srcs (listof part?)] @defmethod[(resolve [srcs (listof part?)]
[dests (listof path-string?)] [dests (listof path-string?)]
[ci collect-info?]) [ci collect-info?])
resolve-info?]{ resolve-info?]{
Performs the @techlink{resolve pass}.} Performs the @techlink{resolve pass}. See @method[render% render] for
information on the @scheme[dests] argument.}
@defmethod[(render [srcs (listof part?)] @defmethod[(render [srcs (listof part?)]
[dests (listof path-string?)] [dests (listof path-string?)]
[ri resolve-info?]) [ri resolve-info?])
void?]{ void?]{
Produces the final output.} Produces the final output.
The @scheme[dests] provide names of files for Latex or single-file
HTML output, or names of sub-directories for multi-file HTML output.
If the @scheme[dests] are relative, they're relative to the current
directory; normally, they should indicates a path within the
@scheme[_dest-dir] supplied on initialization of the @scheme[render%]
object.}
@defmethod[(serialize-info [ri resolve-info?]) @defmethod[(serialize-info [ri resolve-info?])
any/c]{ any/c]{

View File

@ -469,7 +469,8 @@
(for ([i (info-deps info)]) (for ([i (info-deps info)])
(with-my-namespace (with-my-namespace
(lambda () (lambda ()
(send renderer deserialize-info (info-sci i) ci))))) (when (info? i)
(send renderer deserialize-info (info-sci i) ci))))))
(let* ([ri (render-time "resolve" (send renderer resolve (list v) (list dest-dir) ci))] (let* ([ri (render-time "resolve" (send renderer resolve (list v) (list dest-dir) ci))]
[sci (render-time "serialize" (send renderer serialize-info ri))] [sci (render-time "serialize" (send renderer serialize-info ri))]
[defs (render-time "defined" (send renderer get-defined ci))] [defs (render-time "defined" (send renderer get-defined ci))]
@ -554,9 +555,12 @@
(lambda () (lambda ()
(list (list (info-vers info) (doc-flags doc)) (list (list (info-vers info) (doc-flags doc))
(serialize (info-undef info)) (serialize (info-undef info))
(filter
values
(map (lambda (i) (map (lambda (i)
(path->rel (doc-src-file (info-doc i)))) (and (info? i)
(info-deps info)) (path->rel (doc-src-file (info-doc i)))))
(info-deps info)))
(serialize (info-searches info))))))))) (serialize (info-searches info)))))))))
(define (write-out info) (define (write-out info)

View File

@ -8,11 +8,11 @@
@title[#:tag "image"]{Manipulating Images: image.ss} @title[#:tag "image"]{Manipulating Images: image.ss}
@;declare-exporting[teachpack/htdp/image] @declare-exporting[teachpack/htdp/image]
@defmodule[htdp/image]{
The teachpack provides primitives for constructing and manipulating The teachpack provides primitives for constructing and manipulating
images. Basic, colored images are created as outlines or solid images. Basic, colored images are created as outlines or solid
shapes. Additional primitives allow for the composition of images.} shapes. Additional primitives allow for the composition of images.
@;----------------------------------------------------------------------------- @;-----------------------------------------------------------------------------
@section{Images} @section{Images}

View File

@ -8,13 +8,13 @@
@title[#:tag "world"]{Simulations and Animations: world.ss} @title[#:tag "world"]{Simulations and Animations: world.ss}
@defmodule[htdp/world #:use-sources (teachpack/htdp/image)]{
The teachpack provides two sets of tools. The first allows students to The teachpack provides two sets of tools. The first allows students to
create and display a series of animated scenes, i.e., a simulation. The create and display a series of animated scenes, i.e., a simulation. The
second one generalizes the first by adding interactive GUI features. second one generalizes the first by adding interactive GUI features.
}
@;declare-exporting[teachpack/htdp/world #:use-sources (teachpack/htdp/image)]
@declare-exporting[teachpack/htdp/world #:use-sources (teachpack/htdp/image)]
@section[#:tag "basics"]{Basics} @section[#:tag "basics"]{Basics}

View File

@ -1,3 +1,3 @@
#lang setup/infotab #lang setup/infotab
(define scribblings '(("teachpack.scrbl" (multi-page)))) (define scribblings '(("teachpack.scrbl" (multi-page) (language -11))))

View File

@ -18,8 +18,11 @@ In principle, a teachpack is just a library written in the full language,
is imported and signal errors in a way with which students are familiar at is imported and signal errors in a way with which students are familiar at
that level. that level.
This chapter covers the teachpacks for ``How to Design Programs'' and ``How This chapter covers the teachpacks for @italic{How to Design Programs}
to Design Classes.'' and @italic{How to Design Classes}.
@table-of-contents[]
@include-section["htdp/scribblings/htdp.scrbl"] @include-section["htdp/scribblings/htdp.scrbl"]