commit ed3216185b5ab38a62f01813832c7660b43b1c3d
parent caf5421f7f7e3598f315bf73573310290749e977
Author: Matthew Flatt <mflatt@racket-lang.org>
Date: Thu, 26 Feb 2009 22:49:07 +0000
adjust scribble/lp docs
svn: r13859
original commit: db70d62ca717d7602ec0fd0efe2dba9e15e9fe38
Diffstat:
6 files changed, 46 insertions(+), 18 deletions(-)
diff --git a/collects/scribblings/scribble/config.scrbl b/collects/scribblings/scribble/config.scrbl
@@ -58,7 +58,7 @@ To avoid collisions with future additions to Scribble, start your
style name with an uppercase letter that is not @litchar{S}. An
uppercase letter helps to avoid collisions with macros defined by
Latex packages, and future styles needed by @scheme[scribble/manual]
-will start with @litchar{s}.
+will start with @litchar{S}.
For example, a Scribble document
diff --git a/collects/scribblings/scribble/lp-ex-doc.scrbl b/collects/scribblings/scribble/lp-ex-doc.scrbl
@@ -0,0 +1,4 @@
+#lang scribble/doc
+@(require scribble/lp-include)
+
+@lp-include["lp-ex.ss"]
diff --git a/collects/scribblings/scribble/lp-ex.ss b/collects/scribblings/scribble/lp-ex.ss
@@ -1,4 +1,5 @@
#lang scribble/lp
+
Literate programs have chunks of code, like this one:
@chunk[<f>
diff --git a/collects/scribblings/scribble/lp.css b/collects/scribblings/scribble/lp.css
@@ -0,0 +1,4 @@
+.LPBoxed {
+ padding: 1ex;
+ border: 1px solid #000000;
+}
diff --git a/collects/scribblings/scribble/lp.scrbl b/collects/scribblings/scribble/lp.scrbl
@@ -1,26 +1,34 @@
#lang scribble/doc
-@(require scribble/manual scheme/runtime-path scribble/lp-include)
+@(require scribble/manual
+ scribble/struct
+ scheme/runtime-path
+ (prefix-in lp-ex: "lp-ex-doc.scrbl")
+ "utils.ss"
+ (for-label scribble/lp-include
+ (only-in scribble/private/lp chunk)))
-@title[#:tag "lp"]{Literate Programming}
+@title[#:tag "lp" #:style `((css "lp.css") (tex "lp.tex")) ]{Literate Programming}
Programs written using @schememodname[scribble/lp] are simultaneously
-two things: a program, and a document describing the program.
+two things: a program and a document describing the program.
Programs in @schememodname[scribble/lp] are viewed in two different
-ways, either by running the program directly, or by including it with
-@scheme[include-lp]. When running the program, all of the
+ways, either by running the program directly or by including it with
+@scheme[lp-include]. When running the program, all of the
@scheme[chunk] expressions are collected and stitched together into a
-program and the rest of the module is discarded. When using
-@scheme[include-lp], the entire contents of the module are preserved
+program, and the rest of the module is discarded. When using
+@scheme[lp-include], the entire contents of the module are preserved
and are treated like an ordinary Scribble document, where
@scheme[chunk]s are typeset in a manner similar to @scheme[codeblock].
@(define-runtime-path lp-ex "lp-ex.ss")
For example, consider this program:
+
@(call-with-input-file lp-ex
(lambda (port)
(verbatim
+ #:indent 2
(apply
string-append
(let loop ()
@@ -36,25 +44,34 @@ function @scheme[f] that squares its argument, and the documentation
is ignored. When it is included with @scheme[lp-include], it looks
like this:
-@lp-include["lp-ex.ss"]
+@(make-blockquote
+ "LPBoxed"
+ (flow-paragraphs (part-flow lp-ex:doc)))
+
+@section{@schememodname[scribble/lp] Language}
-@section{@schememodname[scribble/lp] language}
+@declare-exporting[scribble/private/lp]
-@defmodulelang[scribble/lp]{This is a Scribble's core support for Literate Programming.}
+@defmodulelang*/no-declare[(scribble/lp)]{The
+@schememodname[scribble/lp] language provides core support for
+literate programming.}
-@defform[(chunk <id> expressions ...)]{
- Introduces a chunk, binding @scheme[<id>] for use in other chunks.
+@defform[(chunk id form ...)]{
- If @scheme[<id>] is @tt{<*>}, then this chunk is used as the main
- chunk in the file. If @tt{<*>} is never used, then the first chunk
+ Introduces a chunk, binding @scheme[id] for use in other
+ chunks. Normally, @scheme[id] starts with @litchar{<} and ends with
+ @litchar{>}.
+
+ If @scheme[id] is @schemeidfont{<*>}, then this chunk is used as the main
+ chunk in the file. If @schemeidfont{<*>} is never used, then the first chunk
in the file is treated as the main chunk.
}
-@section{@schememodname[scribble/lp-include] module}
+@section{@schememodname[scribble/lp-include] Module}
@defmodule[scribble/lp-include]{}
@defform[(lp-include filename)]{
Includes the source of @scheme[filename] as the typeset version of the literate
program.
-}
-\ No newline at end of file
+}
diff --git a/collects/scribblings/scribble/lp.tex b/collects/scribblings/scribble/lp.tex
@@ -0,0 +1,3 @@
+
+\usepackage{framed}
+\newenvironment{LPBoxed}{\begin{framed}}{\end{framed}}