scribblings: more explicit fonts and relative sizes for more consistent output, and colors changed to match DrScheme defaults
svn: r6560
This commit is contained in:
parent
8a25ef30e6
commit
732569c39d
|
@ -176,10 +176,9 @@
|
|||
[(sf) `((b (font ([size "-1"][face "Helvetica"]) ,@(super render-element e part ht))))]
|
||||
[(subscript) `((sub ,@(super render-element e part ht)))]
|
||||
[(superscript) `((sup ,@(super render-element e part ht)))]
|
||||
[(hspace) `((tt ,@(let ([str (content->string (element-content e))])
|
||||
(if (= 1 (string-length str))
|
||||
'(" ")
|
||||
(map (lambda (c) 'nbsp) (string->list str))))))]
|
||||
[(hspace) `((span ([class "hspace"])
|
||||
,@(let ([str (content->string (element-content e))])
|
||||
(map (lambda (c) 'nbsp) (string->list str)))))]
|
||||
[else (error 'html-render "unrecognized style symbol: ~e" style)])]
|
||||
[(string? style)
|
||||
`((span ([class ,style]) ,@(super render-element e part ht)))]
|
||||
|
|
|
@ -35,15 +35,21 @@
|
|||
(define-color "schemeplain" "black")
|
||||
(printf "\\newcommand{\\schemekeyword}[1]{{\\color{black}{\\texttt{\\textbf{#1}}}}}\n")
|
||||
(printf "\\newcommand{\\schemesyntaxlink}[1]{\\schemekeyword{#1}}\n")
|
||||
(define-color "schemecomment" "Brown")
|
||||
(define-color "schemeparen" "BrickRed")
|
||||
(define-color "schemeinputcol" "BrickRed")
|
||||
(define-color "schemesymbol" "NavyBlue")
|
||||
(define-color "schemevalue" "ForestGreen")
|
||||
(printf "\\definecolor{CommentColor}{rgb}{0.76,0.45,0.12}\n")
|
||||
(printf "\\definecolor{ParenColor}{rgb}{0.52,0.24,0.14}\n")
|
||||
(printf "\\definecolor{IdentifierColor}{rgb}{0.15,0.15,0.50}\n")
|
||||
(printf "\\definecolor{ResultColor}{rgb}{0.0,0.0,0.69}\n")
|
||||
(printf "\\definecolor{ValueColor}{rgb}{0.13,0.55,0.13}\n")
|
||||
(printf "\\definecolor{OutputColor}{rgb}{0.59,0.00,0.59}\n")
|
||||
(define-color "schemecomment" "CommentColor")
|
||||
(define-color "schemeparen" "ParenColor")
|
||||
(define-color "schemeinputcol" "ParenColor")
|
||||
(define-color "schemesymbol" "IdentifierColor")
|
||||
(define-color "schemevalue" "ValueColor")
|
||||
(define-color "schemevaluelink" "blue")
|
||||
(define-color "schemeresult" "NavyBlue")
|
||||
(define-color "schemestdout" "Purple")
|
||||
(define-color "schemevariablecol" "NavyBlue")
|
||||
(define-color "schemeresult" "ResultColor")
|
||||
(define-color "schemestdout" "OutputColor")
|
||||
(define-color "schemevariablecol" "IdentifierColor")
|
||||
(printf "\\newcommand{\\schemevariable}[1]{{\\schemevariablecol{\\textsl{#1}}}}\n")
|
||||
(define-color "schemeerrorcol" "red")
|
||||
(printf "\\newcommand{\\schemeerror}[1]{{\\schemeerrorcol{\\textrm{\\textit{#1}}}}}\n")
|
||||
|
@ -134,7 +140,6 @@
|
|||
[(hspace) (let ([s (content->string (element-content e))])
|
||||
(case (string-length s)
|
||||
[(0) (void)]
|
||||
[(1) (printf "{\\texttt{ }}")] ; allows a line break to replace the space
|
||||
[else
|
||||
(printf "{\\texttt{~a}}"
|
||||
(regexp-replace* #rx"." s "~"))]))]
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
[end-spaces (regexp-match-positions #rx" *$" s)])
|
||||
(make-element "schemeinput"
|
||||
(list (hspace (cdar spaces))
|
||||
(make-element 'tt (list (substring s (cdar spaces) (caar end-spaces))))
|
||||
(make-element #f (list (substring s (cdar spaces) (caar end-spaces))))
|
||||
(hspace (- (cdar end-spaces) (caar end-spaces))))))))
|
||||
|
||||
(define (verbatim s)
|
||||
|
|
|
@ -89,7 +89,7 @@
|
|||
values)
|
||||
(if color?
|
||||
(make-element cls (list v))
|
||||
(make-element 'tt (list v))))
|
||||
(make-element #f (list v))))
|
||||
content))
|
||||
(set! dest-col (+ dest-col len)))))]))
|
||||
(define advance
|
||||
|
@ -112,7 +112,10 @@
|
|||
(let ([amt (- d-col dest-col)])
|
||||
(when (positive? amt)
|
||||
(let ([old-dest-col dest-col])
|
||||
(out (make-element 'hspace (list (make-string amt #\space))) #f)
|
||||
(out (if (and (= 1 amt) (not multi-line?))
|
||||
(make-element 'tt (list " ")) ; allows a line break to replace the space
|
||||
(make-element 'hspace (list (make-string amt #\space))))
|
||||
#f)
|
||||
(set! dest-col (+ old-dest-col amt))))))
|
||||
(set! src-col c)
|
||||
(hash-table-put! next-col-map src-col dest-col)))]
|
||||
|
@ -178,7 +181,10 @@
|
|||
(out "; " comment-color)
|
||||
(let ([v (syntax-object->datum (cadr (syntax->list c)))])
|
||||
(if (paragraph? v)
|
||||
(map (lambda (v) (out v comment-color)) (paragraph-content v))
|
||||
(map (lambda (v) (if (string? v)
|
||||
(out v comment-color)
|
||||
(out v #f)))
|
||||
(paragraph-content v))
|
||||
(out v comment-color)))]
|
||||
[(and (pair? (syntax-e c))
|
||||
(eq? (syntax-e (car (syntax-e c))) 'code:contract))
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
|
||||
body {
|
||||
color: black;
|
||||
/* background-color: #e5e5e5;*/
|
||||
background-color: #ffffff;
|
||||
/*background-color: beige;*/
|
||||
max-width: 35em;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
font-family: Times;
|
||||
}
|
||||
|
||||
.refpara {
|
||||
|
@ -130,7 +129,7 @@
|
|||
list-style-type: upper-alpha;
|
||||
}
|
||||
|
||||
tt i {
|
||||
i {
|
||||
font-family: serif;
|
||||
}
|
||||
|
||||
|
@ -138,12 +137,6 @@
|
|||
font-family: serif;
|
||||
}
|
||||
|
||||
/*
|
||||
.verbatim {
|
||||
color: #4d0000;
|
||||
}
|
||||
*/
|
||||
|
||||
.ghost {
|
||||
color: white;
|
||||
}
|
||||
|
@ -157,15 +150,19 @@
|
|||
background-color: #ddddff;
|
||||
}
|
||||
|
||||
.hspace {
|
||||
font-family: Courier; font-size: 80%;
|
||||
}
|
||||
|
||||
.schemeinput {
|
||||
color: brown;
|
||||
background-color: #eeeeee;
|
||||
font-family: monospace;
|
||||
font-family: Courier; font-size: 80%;
|
||||
}
|
||||
|
||||
.schemeparen {
|
||||
color: brown;
|
||||
font-family: monospace;
|
||||
color: #843c24;
|
||||
font-family: Courier; font-size: 80%;
|
||||
}
|
||||
|
||||
.schemeopt {
|
||||
|
@ -175,7 +172,7 @@
|
|||
.schemekeyword {
|
||||
color: black;
|
||||
font-weight: bold;
|
||||
font-family: monospace;
|
||||
font-family: Courier; font-size: 80%;
|
||||
}
|
||||
|
||||
.schemeerror {
|
||||
|
@ -184,27 +181,25 @@
|
|||
}
|
||||
|
||||
.schemevariable {
|
||||
color: navy;
|
||||
color: #262680;
|
||||
font-style: italic;
|
||||
font-family: monospace;
|
||||
font-family: Courier; font-size: 80%;
|
||||
}
|
||||
|
||||
.schemesymbol {
|
||||
color: navy;
|
||||
font-family: monospace;
|
||||
color: #262680;
|
||||
font-family: Courier; font-size: 80%;
|
||||
}
|
||||
|
||||
.schemevaluelink {
|
||||
text-decoration: none;
|
||||
color: blue;
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
.schemesyntaxlink {
|
||||
text-decoration: none;
|
||||
color: black;
|
||||
font-weight: bold;
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
.badlink {
|
||||
|
@ -213,23 +208,23 @@
|
|||
}
|
||||
|
||||
.schemeresult {
|
||||
color: navy;
|
||||
font-family: monospace;
|
||||
color: #0000af;
|
||||
font-family: Courier; font-size: 80%;
|
||||
}
|
||||
|
||||
.schemestdout {
|
||||
color: purple;
|
||||
font-family: monospace;
|
||||
color: #960096;
|
||||
font-family: Courier; font-size: 80%;
|
||||
}
|
||||
|
||||
.schemecomment {
|
||||
color: teal;
|
||||
font-family: monospace;
|
||||
color: #c2741f;
|
||||
font-family: Courier; font-size: 80%;
|
||||
}
|
||||
|
||||
.schemevalue {
|
||||
color: green;
|
||||
font-family: monospace;
|
||||
color: #228b22;
|
||||
font-family: Courier; font-size: 80%;
|
||||
}
|
||||
|
||||
.nonavigation {
|
||||
|
@ -251,13 +246,6 @@
|
|||
text-align: right;
|
||||
}
|
||||
|
||||
/*
|
||||
.smallprint hr {
|
||||
text-align: left;
|
||||
width: 40%;
|
||||
}
|
||||
*/
|
||||
|
||||
.footnoterule {
|
||||
text-align: left;
|
||||
width: 40%;
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
@title[#:tag "boxes"]{Boxes}
|
||||
|
||||
A @defterm{box} is like a single-element vector. It prints as
|
||||
@schemefont{#&} followed by the printed form of the boxed value. A
|
||||
@schemefont{#&} form can also be used as an expression, but since the
|
||||
@litchar{#&} followed by the printed form of the boxed value. A
|
||||
@litchar{#&} form can also be used as an expression, but since the
|
||||
resulting box is constant, it has practically no use.
|
||||
|
||||
@examples[
|
||||
|
|
|
@ -20,7 +20,7 @@ instead of characters. Byte strings can be used in applications that
|
|||
process pure ASCII instead of Unicode text. The printed and form of a
|
||||
byte string supports such uses in particular, because a byte string
|
||||
prints like the ASCII decoding of the byte string, but prefixed with a
|
||||
@schemefont{#}. Unprintable ASCII characters or non-ASCII bytes in the
|
||||
@litchar{#}. Unprintable ASCII characters or non-ASCII bytes in the
|
||||
byte string are written with octal notation.
|
||||
|
||||
@refdetails["mz:parse-string"]{the syntax of byte strings}
|
||||
|
|
|
@ -9,11 +9,11 @@ A @defterm{string} is a fixed-length array of
|
|||
@seclink["guide:characters"]{characters}. It prints using doublequotes,
|
||||
where doublequote and backslash characters within the string are
|
||||
escaped with backslashes. Other common string escapes are supported,
|
||||
incluing @schemefont["\\n"] for a linefeed, @schemefont["\\r"] for a
|
||||
carriage return, octal escapes using @schemefont["\\"] followed by up
|
||||
to three octal digits, and hexadimal escapes with @schemefont["\\u"]
|
||||
including @litchar["\\n"] for a linefeed, @litchar["\\r"] for a
|
||||
carriage return, octal escapes using @litchar["\\"] followed by up
|
||||
to three octal digits, and hexadimal escapes with @litchar["\\u"]
|
||||
(up to four digits). Unprintable characters in a string normally
|
||||
shown with @schemefont["\\u"] when the string is printed.
|
||||
shown with @litchar["\\u"] when the string is printed.
|
||||
|
||||
@refdetails["mz:parse-string"]{the syntax of strings}
|
||||
|
||||
|
|
|
@ -19,9 +19,9 @@ character datatype is separate from numbers. The
|
|||
@scheme[char->integer] and @scheme[integer->char] procedures convert
|
||||
between scalar-value numbers and the corresponding character.
|
||||
|
||||
A printable character normally prints as @schemefont["#\\"] followed
|
||||
A printable character normally prints as @litchar["#\\"] followed
|
||||
by the represented character. An unprintable character normally prints
|
||||
as @schemefont{#\u} followed by the scalar value as hexdecimal
|
||||
as @litchar{#\u} followed by the scalar value as hexdecimal
|
||||
number. A few characters are printed specially; for example, the space
|
||||
and linefeed characters print as @scheme[#\space] and
|
||||
@scheme[#\newline], respectively.
|
||||
|
|
|
@ -21,10 +21,10 @@ the hash table is created with the @scheme['equal] flag.
|
|||
]
|
||||
|
||||
A literal hash table can be written as an expression by using
|
||||
@schemefont{#hash} (for an @scheme[equal?]-based table) or
|
||||
@schemefont{#hasheq} (for an @scheme[eq?]-based table). A parenthesized
|
||||
sequence must immediately follow @schemefont{#hash} or
|
||||
@schemefont{#hasheq}, where each element is a sequence is a dotted
|
||||
@litchar{#hash} (for an @scheme[equal?]-based table) or
|
||||
@litchar{#hasheq} (for an @scheme[eq?]-based table). A parenthesized
|
||||
sequence must immediately follow @litchar{#hash} or
|
||||
@litchar{#hasheq}, where each element is a sequence is a dotted
|
||||
key--value pair. Literal hash tables are immutable.
|
||||
|
||||
@examples[
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
@title[#:tag "keywords"]{Keywords}
|
||||
|
||||
A @defterm{keyword} is similar to a symbol (see @secref["symbols"]),
|
||||
but its printed form is prefixed with @schemefont{#:}.
|
||||
but its printed form is prefixed with @litchar{#:}.
|
||||
|
||||
@refdetails["mz:parse-keyword"]{the syntax of keywords}
|
||||
|
||||
|
|
|
@ -47,10 +47,10 @@ A Scheme @defterm{number} is either exact or inexact:
|
|||
|
||||
Inexact numbers print with a decimal point or exponent specifier, and
|
||||
exact numbers print as integers and fractions. The same conventions
|
||||
apply for reading number constants, but @schemefont{#e} or
|
||||
@schemefont{#i} can prefix a number to force its parsing as an exact
|
||||
or inexact number. The prefixes @schemefont{#b}, @schemefont{#o}, and
|
||||
@schemefont{#x} specificy binary, octal, and hexadecimal
|
||||
apply for reading number constants, but @litchar{#e} or
|
||||
@litchar{#i} can prefix a number to force its parsing as an exact
|
||||
or inexact number. The prefixes @litchar{#b}, @litchar{#o}, and
|
||||
@litchar{#x} specificy binary, octal, and hexadecimal
|
||||
interprertation of digits.
|
||||
|
||||
@refdetails["mz:parse-number"]{the syntax of numbers}
|
||||
|
|
|
@ -17,7 +17,7 @@ scalar values.
|
|||
Despite the occasional encoding problems, most paths can be converted
|
||||
to and fom strings. Thus, procedures that accept a path argument
|
||||
always accept a string, and the printed form of a path uses the string
|
||||
decodin of the path inside @schemefont{#<path:} and @scheme{>}. The
|
||||
decodin of the path inside @litchar{#<path:} and @litchar{>}. The
|
||||
@scheme[display] form of a path is the same as the @scheme[display]
|
||||
form of its string encodings.
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ values. Unlike a list, a vector supports constant-time access and
|
|||
update of its elements.
|
||||
|
||||
A vector prints similar to a list---as a parenthesized sequence of its
|
||||
elements---but a vector is prefixed with @schemefont{#} and the length
|
||||
elements---but a vector is prefixed with @litchar{#} and the length
|
||||
of the vector. The vector length is optional for a vector as an
|
||||
expression. Also, a vector as an expression implicitly quotes the
|
||||
forms for its content, which means that identifiers and parenthesized
|
||||
|
@ -28,7 +28,7 @@ forms in a vector constant represent symbols and lists.
|
|||
When the last @math{n} vector elements of a vector are the same value
|
||||
(as determined by @scheme[eq?]), then the last @math{n-1} instances
|
||||
are omitted from the printed form. The vector length shown after the
|
||||
leading @scheme{#} effectively indicates when repeated trailing
|
||||
leading @litchar{#} effectively indicates when repeated trailing
|
||||
elements are omitted. The same conventions apply for vectors as
|
||||
expressions.
|
||||
|
||||
|
|
|
@ -52,7 +52,8 @@ A single document is reprsented as a @defterm{part}:
|
|||
output may be collapsed togther or replaced
|
||||
with a line break. In the style
|
||||
@scheme['hspace], all text is converted to
|
||||
uncollapsable spaces.}
|
||||
uncollapsable spaces that cannot be broken
|
||||
across lines.}
|
||||
|
||||
@item{A symbol element is either @scheme['mdash],
|
||||
@scheme['ndash], @scheme['ldquo],
|
||||
|
|
|
@ -16,6 +16,12 @@
|
|||
(build-path main-doc-dir (car names)))])
|
||||
(unless multi?
|
||||
(make-directory* doc-dir))
|
||||
(when multi?
|
||||
(for-each (lambda (name)
|
||||
(let ([out-dir (build-path doc-dir name)])
|
||||
(when (directory-exists? out-dir)
|
||||
(delete-directory/files out-dir))))
|
||||
names))
|
||||
(parameterize ([current-directory dir]
|
||||
[current-dest-directory doc-dir]
|
||||
[current-render-mixin (if multi?
|
||||
|
|
Loading…
Reference in New Issue
Block a user