Compare author strings, not author structures, in `citet'.

original commit: 7f1da76d54864cc56566b1ac14794d077fdba698
This commit is contained in:
Sam Tobin-Hochstadt 2010-11-30 17:44:21 -05:00
commit 1ef3cc89f9
50 changed files with 1419 additions and 968 deletions

View File

@ -1,21 +0,0 @@
#lang racket/base
(provide (except-out (all-from-out racket/base) #%top)
(rename-out [top #%top])
;; to be used as a text language
(all-from-out scribble/text)
;; provide a `text' alias
(rename-out [begin/text text])
;; main functionality
(all-from-out "xml.rkt" "html.rkt" "resource.rkt"))
(require "xml.rkt" "html.rkt" "resource.rkt"
scribble/text (for-syntax racket/base))
(define-syntax (top stx)
(syntax-case stx ()
[(_ . x)
(let ([x* (syntax-e #'x)])
(if (and (symbol? x*) (regexp-match? #rx":$" (symbol->string x*)))
#''x
#'(#%top . x)))]))

View File

@ -8,6 +8,7 @@
scheme/path
setup/main-collects
setup/path-relativize
file/convertible
"render-struct.ss")
(provide render%)
@ -207,7 +208,7 @@
;; marshal info
(define/public (get-serialize-version)
2)
4)
(define/public (serialize-info ri)
(parameterize ([current-serialize-resolve-info ri])
@ -677,6 +678,7 @@
(render-content (traverse-element-content i ri) part ri)]
[(part-relative-element? i)
(render-content (part-relative-element-content i ri) part ri)]
[(convertible? i) (list "???")]
[else (render-other i part ri)]))
(define/public (render-other i part ri)
@ -687,13 +689,15 @@
(define copied-srcs (make-hash))
(define copied-dests (make-hash))
(define/public (install-file fn)
(if refer-to-existing-files
(define/public (install-file fn [content #f])
(if (and refer-to-existing-files
(not content))
(if (string? fn)
(string->path fn)
fn)
(let ([normalized (normal-case-path (simplify-path (path->complete-path fn)))])
(or (hash-ref copied-srcs normalized #f)
(or (and (not content)
(hash-ref copied-srcs normalized #f))
(let ([src-dir (path-only fn)]
[dest-dir (get-dest-directory #t)]
[fn (file-name-from-path fn)])
@ -715,22 +719,26 @@
(let-values ([(dest-file normalized-dest-file)
(let loop ([dest-file dest-file])
(let ([normalized-dest-file
(normal-case-path (simplify-path (path->complete-path dest-file)))])
(if (file-exists? dest-file)
(cond
[(call-with-input-file*
src-file
(lambda (src)
(call-with-input-file*
(normal-case-path (simplify-path (path->complete-path dest-file)))]
[check-same
(lambda (src)
(call-with-input-file*
dest-file
(lambda (dest)
(or (equal? (port-file-identity src)
(port-file-identity dest))
(or (and (not content)
(equal? (port-file-identity src)
(port-file-identity dest)))
(let loop ()
(let ([s (read-bytes 4096 src)]
[d (read-bytes 4096 dest)])
(and (equal? s d)
(or (eof-object? s) (loop))))))))))
(or (eof-object? s) (loop)))))))))])
(if (file-exists? dest-file)
(cond
[(or (and content
(check-same (open-input-bytes content)))
(and (not content)
(call-with-input-file* src-file check-same)))
;; same content at that destination
(values dest-file normalized-dest-file)]
[(hash-ref copied-dests normalized-dest-file #f)
@ -743,10 +751,15 @@
;; new file
(values dest-file normalized-dest-file))))])
(unless (file-exists? dest-file)
(copy-file src-file dest-file))
(if content
(call-with-output-file*
dest-file
(lambda (dest) (write-bytes content dest)))
(copy-file src-file dest-file)))
(hash-set! copied-dests normalized-dest-file #t)
(let ([result (path->string (file-name-from-path dest-file))])
(hash-set! copied-srcs normalized result)
(unless content
(hash-set! copied-srcs normalized result))
result))))))))
;; ----------------------------------------

View File

@ -285,7 +285,7 @@
[image (->* ((or/c path-string? (cons/c 'collects (listof bytes?))))
(#:scale real?
#:suffixes (listof #rx"^[.]"))
#:suffixes (listof (and/c string? #rx"^[.]")))
#:rest (listof content?)
image-element?)])

View File

@ -1,7 +1,8 @@
#lang scheme/base
(require "private/provide-structs.ss"
scheme/serialize
scheme/contract)
scheme/contract
file/convertible)
;; ----------------------------------------
@ -119,7 +120,8 @@
(traverse-element? v)
(part-relative-element? v)
(multiarg-element? v)
(hash-ref content-symbols v #f)))
(hash-ref content-symbols v #f)
(convertible? v)))
(provide element-style?)
(define (element-style? s)

View File

@ -8,6 +8,7 @@
racket/sandbox
racket/promise
racket/string
file/convertible
(for-syntax racket/base))
(provide interaction
@ -38,6 +39,8 @@
(define maxlen 60)
(define-namespace-anchor anchor)
(namespace-require 'racket/base)
(namespace-require '(for-syntax racket/base))
@ -92,40 +95,45 @@
(make-flow (list p))))))
(format-output (cadar val-list+outputs) output-color)
(format-output (caddar val-list+outputs) error-color)
(if (string? (caar val-list+outputs))
;; Error result case:
(map
(lambda (s)
(car (format-output s error-color)))
(filter
(lambda (s) (not (equal? s "")))
(let sloop ([s (caar val-list+outputs)])
(apply
append
(map (lambda (s)
(if ((string-length s) . > . maxlen)
;; break the error message into multiple lines:
(let loop ([pos (sub1 maxlen)])
(cond
[(zero? pos) (cons (substring s 0 maxlen)
(sloop (substring s maxlen)))]
[(char-whitespace? (string-ref s pos))
(cons (substring s 0 pos)
(sloop (substring s (add1 pos))))]
[else (loop (sub1 pos))]))
(list s)))
(regexp-split #rx"\n" s))))))
;; Normal result case:
(let ([val-list (caar val-list+outputs)])
(if (equal? val-list (list (void)))
null
(map (lambda (v)
(list (make-flow (list (make-paragraph
(list
(hspace 2)
(elem #:style result-color
(to-element/no-color v #:expr? (print-as-expression)))))))))
val-list))))
(cond
[(string? (caar val-list+outputs))
;; Error result case:
(map
(lambda (s)
(car (format-output s error-color)))
(filter
(lambda (s) (not (equal? s "")))
(let sloop ([s (caar val-list+outputs)])
(apply
append
(map (lambda (s)
(if ((string-length s) . > . maxlen)
;; break the error message into multiple lines:
(let loop ([pos (sub1 maxlen)])
(cond
[(zero? pos) (cons (substring s 0 maxlen)
(sloop (substring s maxlen)))]
[(char-whitespace? (string-ref s pos))
(cons (substring s 0 pos)
(sloop (substring s (add1 pos))))]
[else (loop (sub1 pos))]))
(list s)))
(regexp-split #rx"\n" s))))))]
[(box? (caar val-list+outputs))
;; Output formatted as string:
(format-output (unbox (caar val-list+outputs)) result-color)]
[else
;; Normal result case:
(let ([val-list (caar val-list+outputs)])
(if (equal? val-list (list (void)))
null
(map (lambda (v)
(list (make-flow (list (make-paragraph
(list
(hspace 2)
(elem #:style result-color
(to-element/no-color v #:expr? (print-as-expression)))))))))
val-list)))])
(loop (cdr expr-paras)
(cdr val-list+outputs)
#f)))))))
@ -137,36 +145,56 @@
[(syntax? s) (loop (syntax-e s) ops)]
[else (loop ((car ops) s) (cdr ops))])))
(define ((do-eval ev) s)
(define (extract-to-evaluate s)
(let loop ([s s][expect #f])
(syntax-case s (code:comment eval:alts eval:check)
[(code:line v (code:comment . rest))
(loop (extract s cdr car) expect)]
[(code:comment . rest)
(list (list (void)) "" "")]
(values #f expect)]
[(eval:alts p e)
(loop (extract s cdr cdr car) expect)]
[(eval:check e expect)
(loop (extract s cdr car)
(list (syntax->datum (datum->syntax #f (extract s cdr cdr car)))))]
[else
(let ([r (with-handlers ([(lambda (x)
(not (exn:break? x)))
(lambda (e)
(list (if (exn? e)
(exn-message e)
(format "uncaught exception: ~s" e))
(get-output ev)
(get-error-output ev)))])
(list (let ([v (do-plain-eval ev s #t)])
(make-reader-graph (copy-value v (make-hasheq))))
(get-output ev)
(get-error-output ev)))])
(when expect
(let ([expect (do-plain-eval ev (car expect) #t)])
(unless (equal? (car r) expect)
(raise-syntax-error 'eval "example result check failed" s))))
r)])))
(values s expect)])))
(define ((do-eval ev) s)
(let-values ([(s expect) (extract-to-evaluate s)])
(if s
(let ([r (with-handlers ([(lambda (x)
(not (exn:break? x)))
(lambda (e)
(list (if (exn? e)
(exn-message e)
(format "uncaught exception: ~s" e))
(get-output ev)
(get-error-output ev)))])
(list (let ([v (do-plain-eval ev s #t)])
(if (call-in-sandbox-context
ev
(let ([cp (current-print)])
(lambda ()
(and (eq? (current-print) cp)
(print-as-expression)))))
(make-reader-graph (copy-value v (make-hasheq)))
(box
(call-in-sandbox-context
ev
(lambda ()
(let ([s (open-output-string)])
(parameterize ([current-output-port s])
(map (current-print) v))
(get-output-string s)))))))
(get-output ev)
(get-error-output ev)))])
(when expect
(let ([expect (do-plain-eval ev (car expect) #t)])
(unless (equal? (car r) expect)
(raise-syntax-error 'eval "example result check failed" s))))
r)
(values (list (list (void)) "" "")))))
(define (install ht v v2)
@ -251,7 +279,12 @@
(parameterize ([sandbox-output 'string]
[sandbox-error-output 'string]
[sandbox-propagate-breaks #f])
(make-evaluator '(begin))))))
(let ([e (make-evaluator '(begin))])
(let ([ns (namespace-anchor->namespace anchor)])
(call-in-sandbox-context e
(lambda ()
(namespace-attach-module ns 'file/convertible))))
e)))))
(define (make-base-eval-factory mod-paths)
(let ([ns (delay (let ([ns (make-base-empty-namespace)])
@ -310,9 +343,11 @@
(define-syntax-rule (quote-expr e) 'e)
(define (do-interaction-eval ev e)
(parameterize ([current-command-line-arguments #()])
(do-plain-eval (or ev (make-base-eval)) e #f))
"")
(let-values ([(e expect) (extract-to-evaluate e)])
(when e
(parameterize ([current-command-line-arguments #()])
(do-plain-eval (or ev (make-base-eval)) e #f)))
""))
(define-syntax interaction-eval
(syntax-rules ()

View File

@ -5,7 +5,9 @@
scribble/srcdoc
(for-syntax scheme/base
scheme/path
scheme/list
syntax/path-spec
syntax/modread
(for-syntax scheme/base)))
(provide include-extracted
@ -34,14 +36,15 @@
n-path)])
(let ([s-exp
(parameterize ([current-namespace (make-base-namespace)]
[read-accept-reader #t]
[current-load-relative-directory
(path-only path)])
(expand
(with-input-from-file path
(lambda ()
(port-count-lines! (current-input-port))
(read-syntax path)))))])
(with-module-reading-parameterization
(lambda ()
(with-input-from-file path
(lambda ()
(port-count-lines! (current-input-port))
(read-syntax path)))))))])
(syntax-case s-exp ()
[(mod name lang
(mod-beg
@ -55,35 +58,41 @@
(syntax->list #'(spec ...))]
[_ null]))
(syntax->list #'(content ...))))]
[(doc-req ...)
(map
strip-context
(append-map (lambda (c)
(syntax-case c (#%plain-app void quote-syntax require/doc)
[(#%plain-app void (quote-syntax (require/doc spec ...)))
(syntax->list #'(spec ...))]
[_ null]))
(syntax->list #'(content ...))))]
[(req ...)
(map
strip-context
(apply
append
(map (lambda (c)
(syntax-case c (#%require #%plain-app void quote-syntax require/doc)
[(#%require spec ...)
(let loop ([specs (syntax->list #'(spec ...))])
(cond
[(null? specs) '()]
[else (let ([spec (car specs)])
(syntax-case spec (for-syntax for-meta)
[(for-syntax . spec) (loop (cdr specs))]
[(for-meta . spec) (loop (cdr specs))]
[(for-template . spec) (loop (cdr specs))]
[(for-label . spec) (loop (cdr specs))]
[(just-meta . spec) (loop (cdr specs))]
[_ (cons #`(for-label #,spec) (loop (cdr specs)))]))]))]
[(#%plain-app void (quote-syntax (require/doc spec ...)))
(syntax->list #'(spec ...))]
[_ null]))
(syntax->list #'(content ...)))))]
(append-map (lambda (c)
(syntax-case c (#%require)
[(#%require spec ...)
(let loop ([specs (syntax->list #'(spec ...))])
(cond
[(null? specs) '()]
[else (let ([spec (car specs)])
(syntax-case spec (for-syntax for-meta)
[(for-syntax . spec) (loop (cdr specs))]
[(for-meta . spec) (loop (cdr specs))]
[(for-template . spec) (loop (cdr specs))]
[(for-label . spec) (loop (cdr specs))]
[(just-meta . spec) (loop (cdr specs))]
[_ (cons #`(for-label #,spec) (loop (cdr specs)))]))]))]
[_ null]))
(syntax->list #'(content ...))))]
[orig-tag (datum->syntax #f 'orig)])
;; This template is matched in `filter-info', below
#`(begin
(#%require (for-label #,(strip-context #'lang))
(for-label #,(strip-context orig-path))
req ...)
(require doc-req ...)
(drop-first (quote-syntax id) (def-it orig-tag content)) ...))]))))
(define-syntax (include-extracted stx)
@ -94,7 +103,7 @@
(define-syntax (provide-extracted stx)
(syntax-case stx ()
[(_ orig-path)
(with-syntax ([(_begin reqs (_drop-first (_quote-syntax id) def) ...)
(with-syntax ([(_begin reqs doc-reqs (_drop-first (_quote-syntax id) def) ...)
(extract #'orig-path stx)])
#'(begin
(require (for-label (only-in orig-path))) ;; creates build dependency
@ -130,6 +139,7 @@
[(box? stx) #`(box #,(loop (unbox stx)))]
[else #`(quote #,stx)]))]))])
#`(begin #,(quote-syntax/loc reqs)
#,(quote-syntax/loc doc-reqs)
#,@(filter
values
(map (lambda (i d)

View File

@ -9,6 +9,7 @@
scheme/port
scheme/list
scheme/string
file/convertible
mzlib/runtime-path
setup/main-doc
setup/main-collects
@ -947,6 +948,15 @@
(cond
[(string? e) (super render-content e part ri)] ; short-cut for common case
[(list? e) (super render-content e part ri)] ; also a short-cut
[(and (convertible? e)
(convert e 'png-bytes))
=> (lambda (bstr)
(let ([w (integer-bytes->integer (subbytes bstr 16 20) #f #t)]
[h (integer-bytes->integer (subbytes bstr 20 24) #f #t)])
`((img ([src ,(install-file "pict.png" bstr)]
[alt "image"]
[width ,(number->string w)]
[height ,(number->string h)])))))]
[(image-element? e)
(let* ([src (main-collects-relative->path (image-element-path e))]
[suffixes (image-element-suffixes e)]
@ -1046,7 +1056,7 @@
(begin
(when #f
(fprintf (current-error-port)
"Undefined link: ~s~n"
"Undefined link: ~s\n"
(tag-key (link-element-tag e) ri)))
`((font ([class "badlink"])
,@(if (empty-content? (element-content e))
@ -1421,7 +1431,12 @@
[full-path (build-path (path-only (current-output-file))
filename)])
(parameterize ([on-separate-page-ok #f])
(with-output-to-file full-path #:exists 'truncate/replace
;; We use 'replace instead of the usual 'truncate/replace
;; to avoid problems where a filename changes only in case,
;; in which case some platforms will see the old file
;; as matching the new name, while others don't. Replacing
;; the file syncs the case with the current uses.
(with-output-to-file full-path #:exists 'replace
(lambda () (render-one-part d ri full-path number)))
null))
(parameterize ([on-separate-page-ok #t])

View File

@ -0,0 +1,14 @@
#lang racket/base
(require "main.rkt" (except-in scribble/text/lang #%top)
scribble/text/syntax-utils)
(provide (except-out (all-from-out scribble/text/lang) #%module-begin)
(rename-out [module-begin #%module-begin])
(all-from-out "main.rkt"))
(require (for-syntax racket/base))
(define-syntax-rule (module-begin expr ...)
(#%plain-module-begin
(port-count-lines! (current-output-port))
(process-begin/text begin output-xml expr ...)))

View File

@ -0,0 +1,11 @@
#lang s-exp syntax/module-reader
scribble/html/lang
#:read scribble:read-inside
#:read-syntax scribble:read-syntax-inside
#:whole-body-readers? #t
#:info (scribble-base-reader-info)
(require (prefix-in scribble: scribble/reader)
(only-in scribble/base/reader scribble-base-reader-info))

View File

@ -0,0 +1,17 @@
#lang racket/base
(require "xml.rkt" "html.rkt" "resource.rkt"
;; includes all of the scribble/text utilities
scribble/text)
(provide (all-from-out "xml.rkt" "html.rkt" "resource.rkt" scribble/text)
(rename-out [top #%top]))
(require (for-syntax racket/base))
(define-syntax (top stx)
(syntax-case stx ()
[(_ . x)
(let ([x* (syntax-e #'x)])
(if (and (symbol? x*) (regexp-match? #rx":$" (symbol->string x*)))
#''x
#'(#%top . x)))]))

View File

@ -47,10 +47,10 @@
(define cached-roots '(#f . #f))
(define (current-url-roots)
;; takes in a (listof (list prefix-string url-string . flags)), and produces
;; an alist with lists of strings for the keys; the prefix-strings are split
;; on "/"s, and the url-strings can be anything at all actually (they are put
;; as-is before the path with a "/" between them).
;; takes `url-roots', a (listof (list prefix-string url-string . flags)), and
;; produces an alist with lists of strings for the keys; the prefix-strings
;; are split on "/"s, and the url-strings can be anything at all actually
;; (they are put as-is before the path with a "/" between them).
(let ([roots (url-roots)])
(unless (eq? roots (car cached-roots))
(set! cached-roots
@ -86,7 +86,7 @@
;; find shared prefix
[(and (pair? t) (pair? c) (equal? (car t) (car c)))
(loop (cdr t) (cdr c) (cons (car t) pfx))]
;; done
;; done with the shared prefix, deal with the root now
;; no roots => always use a relative path (useful for debugging)
[(not roots) `(,@(map (lambda (_) "..") c) ,@t ,file*)]
;; share a root => use a relative path unless its an absolute root
@ -197,16 +197,26 @@
(printf " ~a\n" path)
(renderer filename))))))
(define (url) (relativize filename dirpathlist (rendered-dirpath)))
(define absolute-url
(delay (let ([url (relativize filename dirpathlist '())])
(if (url-roots)
url
;; we're in local build mode, and insist on an absolute url,
;; so construct a `file://' result
(list* "file://" (current-directory) url)))))
(add-renderer path render)
(make-keyword-procedure
(lambda (kws kvs . args) (keyword-apply referrer kws kvs (url) args))
(case-lambda [(x) (if (eq? x get-resource-path) (url) (referrer (url) x))]
(case-lambda [(x) (if (and (pair? x) (eq? (car x) get-path))
(if (cdr x) absolute-url (url))
(referrer (url) x))]
[args (apply referrer (url) args)]))))
;; make it possible to always get the path to a resource
(provide get-resource-path)
(define (get-resource-path resource)
(resource get-resource-path))
(define get-path (gensym))
(define (get-resource-path resource [absolute? #f])
(resource (cons get-path absolute?)))
;; a convenient utility to create renderers from some output function (like
;; `output-xml' or `display') and some content
@ -218,9 +228,11 @@
(provide render-all)
(define (render-all)
(printf "Rendering...\n")
(let loop ()
(let ([todo (get/reset-renderers)])
(define todo (get/reset-renderers))
(if (null? todo)
(printf " Warning: no content to render\n")
(let loop ([todo todo])
(unless (null? todo)
(for-each (lambda (r) (r)) todo)
(loop)))) ; if more were created
(loop (get/reset-renderers))))) ; if more were created
(printf "Rendering done.\n"))

View File

@ -7,3 +7,4 @@
(define raco-commands
'(("scribble" scribble/run "render a Scribble document" #f)))
(define purpose "This collect contains the implementation of scribble.")

View File

@ -14,7 +14,7 @@
(define jfp-extras
(let ([abs (lambda (s)
(path->main-collects-relative
(build-path (collection-path "scribble") "jfp" s)))])
(collection-file-path s "scribble" "jfp")))])
(list
(make-css-addition (abs "jfp.css"))
(make-tex-addition (abs "jfp.tex")))))

View File

@ -9,7 +9,8 @@
scheme/path
scheme/string
scheme/list
setup/main-collects)
setup/main-collects
file/convertible)
(provide render-mixin)
(define current-table-mode (make-parameter #f))
@ -235,18 +236,30 @@
es)]
[style (and (style? es) es)]
[core-render (lambda (e tt?)
(if (and (image-element? e)
(not (disable-images)))
(let ([fn (install-file
(select-suffix
(main-collects-relative->path
(image-element-path e))
(image-element-suffixes e)
'(".pdf" ".ps" ".png")))])
(printf "\\includegraphics[scale=~a]{~a}"
(image-element-scale e) fn))
(parameterize ([rendering-tt (or tt? (rendering-tt))])
(super render-content e part ri))))]
(cond
[(and (image-element? e)
(not (disable-images)))
(let ([fn (install-file
(select-suffix
(main-collects-relative->path
(image-element-path e))
(image-element-suffixes e)
'(".pdf" ".ps" ".png")))])
(printf "\\includegraphics[scale=~a]{~a}"
(image-element-scale e) fn))]
[(and (convertible? e)
(not (disable-images))
(let ([ftag (lambda (v suffix) (and v (list v suffix)))])
(or (ftag (convert e 'pdf-bytes) ".pdf")
(ftag (convert e 'eps-bytes) ".ps")
(ftag (convert e 'png-bytes) ".png"))))
=> (lambda (bstr+suffix)
(let ([fn (install-file (format "pict~a" (cadr bstr+suffix))
(car bstr+suffix))])
(printf "\\includegraphics{~a}" fn)))]
[else
(parameterize ([rendering-tt (or tt? (rendering-tt))])
(super render-content e part ri))]))]
[wrap (lambda (e s tt?)
(printf "\\~a{" s)
(core-render e tt?)
@ -562,11 +575,11 @@
[(symbol? i)
(display (case i
[(nbsp) "~"]
[(mdash) "---"]
[(ndash) "--"]
[(ldquo) "``"]
[(rdquo) "''"]
[(rsquo) "'"]
[(mdash) "{---}"]
[(ndash) "{--}"]
[(ldquo) "{``}"]
[(rdquo) "{''}"]
[(rsquo) "{'}"]
[(prime) "$'$"]
[(rarr) "$\\rightarrow$"]
[(larr) "$\\leftarrow$"]
@ -597,6 +610,9 @@
[(#\>) (if (rendering-tt) "{\\texttt >}" "$>$")]
[(#\<) (if (rendering-tt) "{\\texttt <}" "$<$")]
[(#\|) (if (rendering-tt) "{\\texttt |}" "$|$")]
[(#\-) "{-}"] ;; avoid en- or em-dash
[(#\`) "{`}"] ;; avoid double-quotes
[(#\') "{'}"] ;; avoid double-quotes
[(#\? #\! #\. #\:)
(if (rendering-tt) (format "{\\hbox{\\texttt{~a}}}" c) c)]
[(#\~) "$\\sim$"]

View File

@ -2,6 +2,7 @@
(require "base.ss"
"private/manual-style.ss"
"private/manual-scheme.ss"
"private/manual-code.ss"
"private/manual-mod.ss"
"private/manual-tech.ss"
"private/manual-bib.ss"
@ -18,6 +19,7 @@
(all-from-out "base.ss"
"private/manual-style.ss"
"private/manual-scheme.ss"
"private/manual-code.ss"
"private/manual-mod.ss"
"private/manual-tech.ss"
"private/manual-bib.ss"

View File

@ -0,0 +1,194 @@
#lang racket/base
(require syntax/strip-context
syntax-color/module-lexer
"../racket.rkt"
"../core.rkt"
"../base.rkt"
"manual-scheme.rkt"
(for-syntax racket/base
syntax/parse))
(provide codeblock
typeset-code)
(define-syntax (codeblock stx)
(syntax-parse stx
[(_ (~seq (~or (~optional (~seq #:expand expand-expr:expr)
#:defaults ([expand-expr #'#f])
#:name "#:expand keyword")
(~optional (~seq #:indent indent-expr:expr)
#:defaults ([indent-expr #'2])
#:name "#:expand keyword")
(~optional (~seq #:keep-lang-line? keep-lang-line?-expr:expr)
#:defaults ([keep-lang-line?-expr #'#t])
#:name "#:keep-lang-line? keyword")
(~optional (~seq #:context context-expr:expr)
#:name "#:context keyword"))
...)
str ...)
#`(typeset-code str ...
#:expand expand-expr
#:keep-lang-line? keep-lang-line?-expr
#:indent indent-expr
#:context #,(if (attribute context-expr)
#'context-expr
(or
(let ([v #'(str ...)])
(and (pair? (syntax-e v))
#`#'#,(car (syntax-e v))))
#'#f)))]))
(define (typeset-code #:context [context #f]
#:expand [expand #f]
#:indent [indent 2]
#:keep-lang-line? [keep-lang-line? #t]
. strs)
(let* ([str (apply string-append strs)]
[bstr (string->bytes/utf-8 (regexp-replace* #rx"(?m:^$)" str "\xA0"))]
[in (open-input-bytes bstr)])
(let* ([tokens
(let loop ([mode #f])
(let-values ([(lexeme type data start end backup-delta mode)
(module-lexer in 0 mode)])
(if (eof-object? lexeme)
null
(cons (list type (sub1 start) (sub1 end) 0)
(loop mode)))))]
[substring* (lambda (bstr start [end (bytes-length bstr)])
(bytes->string/utf-8 (subbytes bstr start end)))]
[e (parameterize ([read-accept-reader #t])
((or expand
(lambda (stx)
(if context
(replace-context context stx)
stx)))
(read-syntax 'prog (open-input-bytes bstr))))]
[ids (let loop ([e e])
(cond
[(and (identifier? e)
(syntax-original? e))
(let ([pos (sub1 (syntax-position e))])
(list (list (to-element e)
pos
(+ pos (syntax-span e))
1)))]
[(syntax? e) (append (loop (syntax-e e))
(loop (or (syntax-property e 'origin)
null))
(loop (or (syntax-property e 'disappeared-use)
null)))]
[(pair? e) (append (loop (car e)) (loop (cdr e)))]
[else null]))]
[link-mod (lambda (mp-stx priority #:orig? [always-orig? #f])
(if (or always-orig?
(syntax-original? mp-stx))
(let ([mp (syntax->datum mp-stx)]
[pos (sub1 (syntax-position mp-stx))])
(list (list (racketmodname #,mp)
pos
(+ pos (syntax-span mp-stx))
priority)))
null))]
;; This makes sense when `expand' actually expands, and
;; probably not otherwise:
[mods (let loop ([e e])
(syntax-case e (module require begin)
[(module name lang (mod-beg form ...))
(apply append
(link-mod #'lang 2)
(map loop (syntax->list #'(form ...))))]
[(#%require spec ...)
(apply append
(map (lambda (spec)
;; Need to add support for renaming forms, etc.:
(if (module-path? (syntax->datum spec))
(link-mod spec 2)
null))
(syntax->list #'(spec ...))))]
[(begin form ...)
(apply append
(map loop (syntax->list #'(form ...))))]
[else null]))]
[language (if (regexp-match? #rx"^#lang " bstr)
(let ([m (regexp-match #rx"^#lang ([-a-zA-Z/._+]+)" bstr)])
(if m
(link-mod
#:orig? #t
(datum->syntax #f
(string->symbol (bytes->string/utf-8 (cadr m)))
(vector 'in 1 6 7 (bytes-length (cadr m))))
3)
null))
null)]
[tokens (sort (append ids
mods
language
(filter (lambda (x) (not (eq? (car x) 'symbol)))
;; Drop #lang entry:
(cdr tokens)))
(lambda (a b)
(or (< (cadr a) (cadr b))
(and (= (cadr a) (cadr b))
(> (cadddr a) (cadddr b))))))]
[default-color meta-color])
(table
block-color
((if keep-lang-line? values cdr) ; FIXME: #lang can span lines
(list->lines
indent
(let loop ([pos 0]
[tokens tokens])
(cond
[(null? tokens) (split-lines default-color (substring* bstr pos))]
[(eq? (caar tokens) 'white-space) (loop pos (cdr tokens))]
[(= pos (cadar tokens))
(append (let ([style (caar tokens)])
(if (symbol? style)
(let ([scribble-style
(case style
[(symbol) symbol-color]
[(parenthesis) paren-color]
[(constant string) value-color]
[(comment) comment-color]
[else default-color])])
(split-lines scribble-style
(substring* bstr (cadar tokens) (caddar tokens))))
(list (caar tokens))))
(loop (caddar tokens) (cdr tokens)))]
[(> pos (cadar tokens))
(loop pos (cdr tokens))]
[else (append
(split-lines default-color (substring* bstr pos (cadar tokens)))
(loop (cadar tokens) tokens))]))))))))
(define (split-lines style s)
(cond
[(regexp-match-positions #rx"(?:\r\n|\r|\n)" s)
=> (lambda (m)
(list* (element style (substring s 0 (caar m)))
'newline
(split-lines style (substring s (cdar m)))))]
[(regexp-match-positions #rx" +" s)
=> (lambda (m)
(append (split-lines style (substring s 0 (caar m)))
(list (hspace (- (cdar m) (caar m))))
(split-lines style (substring s (cdar m)))))]
[else (list (element style s))]))
(define omitable (make-style #f '(omitable)))
(define (list->lines indent-amt l)
(define (make-line accum-line) (list (paragraph omitable
(cons indent-elem
(reverse accum-line)))))
(define indent-elem (hspace indent-amt))
(let loop ([l l] [accum-line null])
(cond
[(null? l) (if (null? accum-line)
null
(list (make-line accum-line)))]
[(eq? 'newline (car l))
(cons (make-line accum-line)
(loop (cdr l) null))]
[else (loop (cdr l) (cons (car l) accum-line))])))

View File

@ -18,6 +18,7 @@
scheme/list
(for-syntax racket/base)
(for-label racket/base
racket/contract
racket/class))
(provide defproc defproc* defstruct defstruct*

View File

@ -8,12 +8,18 @@
(provide/contract
[deftech (() (#:style? boolean?) #:rest (listof pre-content?) . ->* . element?)]
[tech (() (#:doc (or/c module-path? false/c) #:tag-prefixes (or/c (listof string?) false/c)) #:rest (listof pre-content?) . ->* . element?)]
[techlink (() (#:doc (or/c module-path? false/c) #:tag-prefixes (or/c (listof string?) false/c)) #:rest (listof pre-content?) . ->* . element?)])
[tech (()
(#:doc (or/c module-path? false/c) #:tag-prefixes (or/c (listof string?) false/c) #:key (or/c string? #f))
#:rest (listof pre-content?)
. ->* . element?)]
[techlink (()
(#:doc (or/c module-path? false/c) #:tag-prefixes (or/c (listof string?) false/c) #:key (or/c string? #f))
#:rest (listof pre-content?)
. ->* . element?)])
(define (*tech make-elem style doc prefix s)
(define (*tech make-elem style doc prefix s key)
(let* ([c (decode-content s)]
[s (string-foldcase (content->string c))]
[s (string-foldcase (or key (content->string c)))]
[s (regexp-replace #rx"ies$" s "y")]
[s (regexp-replace #rx"s$" s "")]
[s (regexp-replace* #px"[-\\s]+" s " ")])
@ -23,7 +29,7 @@
(let* ([e (if style?
(apply defterm s)
(make-element #f (decode-content s)))]
[t (*tech make-target-element #f #f #f (list e))])
[t (*tech make-target-element #f #f #f (list e) #f)])
(make-index-element #f
(list t)
(target-element-tag t)
@ -31,14 +37,14 @@
(list e)
'tech)))
(define (tech #:doc [doc #f] #:tag-prefixes [prefix #f] . s)
(define (tech #:doc [doc #f] #:tag-prefixes [prefix #f] #:key [key #f] . s)
(*tech (lambda (style c tag)
(make-link-element
style
(list (make-element "techinside" c))
tag))
"techoutside"
doc prefix s))
doc prefix s key))
(define (techlink #:doc [doc #f] #:tag-prefixes [prefix #f] . s)
(*tech make-link-element #f doc prefix s))
(define (techlink #:doc [doc #f] #:tag-prefixes [prefix #f] #:key [key #f] . s)
(*tech make-link-element #f doc prefix s key))

View File

@ -8,6 +8,7 @@
mzlib/for
syntax/modresolve
syntax/modcode
file/convertible
(for-syntax racket/base))
(provide define-code
@ -215,7 +216,8 @@
quote-depth)])
(if (or (element? (syntax-e c))
(delayed-element? (syntax-e c))
(part-relative-element? (syntax-e c)))
(part-relative-element? (syntax-e c))
(convertible? (syntax-e c)))
(out (syntax-e c) #f)
(out (if (and (identifier? c)
color?
@ -441,7 +443,7 @@
(let ([l (syntax->list c)]
[h? highlight?])
(unless (and l (= 2 (length l)))
(error "bad code:redex: ~e" (syntax->datum c)))
(error "bad code:redex: ~.s" (syntax->datum c)))
(advance c init-line!)
(set! src-col (syntax-column (cadr l)))
(hash-set! next-col-map src-col dest-col)
@ -604,7 +606,10 @@
[(mpair? (syntax-e c))
(syntax-e c)]
[else c])]
[first-expr? (and expr? (not (struct-proxy? (syntax-e c))) (not no-cons?))]
[first-expr? (and expr?
(or (zero? quote-depth)
(not (struct-proxy? (syntax-e c))))
(not no-cons?))]
[dotted? #f])
(cond
[(and (syntax? l)
@ -1088,14 +1093,15 @@
(list (do-syntax-ize (car v) col line ht #f qq #f)
c)
(vector #f line col (+ 1 col)
(+ 1
(if (and qq (zero? qq)) 1 0)
(+ delta
(syntax-span c))))))]
[(or (list? v)
(vector? v)
(and (struct? v)
(or (and qq
;; Watch out for partially transparent subtypes of `element':
;; Watch out for partially transparent subtypes of `element'
;; or convertible values:
(not (convertible? v))
(not (element? v)))
(prefab-struct-key v))))
(let ([orig-ht (unbox ht)]
@ -1115,10 +1121,10 @@
[else 0])]
[delta (if (and qq (zero? qq))
(cond
[(vector? v) 8]
[(struct? v) 1]
[no-cons? 1]
[else 5])
[(vector? v) 8] ; `(vector '
[(struct? v) 1] ; '('
[no-cons? 1] ; '('
[else 6]) ; `(list '
1)]
[r (let ([l (let loop ([col (+ col delta vec-sz graph-sz)]
[v (cond

View File

@ -35,22 +35,22 @@
(->* () () #:rest (listof pre-content?)
content?)])
(provide preprint 10pt
(provide preprint 10pt nocopyright onecolumn noqcourier notimes
include-abstract)
(define-syntax (preprint stx)
(raise-syntax-error #f
"option must appear on the same line as `#lang scribble/sigplan'"
stx))
(define-syntax (10pt stx)
(raise-syntax-error #f
"option must appear on the same line as `#lang scribble/sigplan'"
stx))
(define-syntax-rule (defopts name ...)
(begin (define-syntax (name stx)
(raise-syntax-error #f
"option must appear on the same line as `#lang scribble/sigplan'"
stx))
...
(provide name ...)))
(defopts preprint 10pt nocopyright onecolumn noqcourier notimes)
(define sigplan-extras
(let ([abs (lambda (s)
(path->main-collects-relative
(build-path (collection-path "scribble") "sigplan" s)))])
(collection-file-path s "scribble" "sigplan")))])
(list
(make-css-addition (abs "sigplan.css"))
(make-tex-addition (abs "sigplan.tex")))))

View File

@ -4,6 +4,7 @@
scribble/base
scribble/decode
scribble/sigplan
racket/list
"../private/defaults.ss"
(for-syntax scheme/base))
(provide (except-out (all-from-out scribble/doclang) #%module-begin)
@ -15,35 +16,65 @@
(syntax-case stx ()
[(_ id . body)
(let ([preprint? #f]
[10pt? #f])
[10pt? #f]
[onecolumn? #f]
[nocopyright? #f]
[times? #t]
[qcourier? #t])
(let loop ([stuff #'body])
(syntax-case* stuff (preprint 10pt) (lambda (a b) (eq? (syntax-e a) (syntax-e b)))
(syntax-case* stuff (onecolumn preprint 10pt nocopyright notimes noqcourier) (lambda (a b) (eq? (syntax-e a) (syntax-e b)))
[(ws . body)
;; Skip intraline whitespace to find options:
(and (string? (syntax-e #'ws))
(regexp-match? #rx"^ *$" (syntax-e #'ws)))
(loop #'body)]
[(preprint . body)
(set! preprint? #t)
(set! preprint? "preprint")
(loop #'body)]
[(onecolumn . body)
(set! onecolumn? "onecolumn")
(loop #'body)]
[(nocopyright . body)
(set! nocopyright? "nocopyrightspace")
(loop #'body)]
[(10pt . body)
(set! 10pt? #t)
(set! 10pt? "10pt")
(loop #'body)]
[(noqcourier . body)
(set! qcourier? #f)
(loop #'body)]
[(notimes . body)
(set! times? #f)
(loop #'body)]
[body
#`(#%module-begin id (post-process #,preprint? #,10pt?) () . body)])))]))
#`(#%module-begin id (post-process #,times? #,qcourier? #,preprint? #,10pt? #,nocopyright? #,onecolumn?) () . body)])))]))
#|
(define ((post-process preprint? 10pt?) doc)
(let ([options
(cond
[(and preprint? 10pt?) "[preprint, 10pt]"]
[preprint? "[preprint]"]
[10pt? "[10pt]"]
[else ""])])
The docs for the times.sty package suggests that it should not be used
so maybe we want to disable it permanently (or replace it with something else).
Read here for more:
http://www.ctan.org/tex-archive/macros/latex/required/psnfss/psnfss2e.pdf
|#
(define ((post-process times? qcourier? . opts) doc)
(let ([options
(if (ormap values opts)
(format "[~a]" (apply string-append (add-between (filter values opts) ", ")))
"")])
(add-sigplan-styles
(add-defaults doc
(string->bytes/utf-8
(format "\\documentclass~a{sigplanconf}\n\\usepackage{times}\n\\usepackage{qcourier}\n"
options))
(format "\\documentclass~a{sigplanconf}\n~a~a"
options
(if times?
"\\usepackage{times}\n"
"")
(if qcourier?
"\\usepackage{qcourier}\n"
"")))
(scribble-file "sigplan/style.tex")
(list (scribble-file "sigplan/sigplanconf.cls"))
#f))))

File diff suppressed because it is too large Load Diff

View File

@ -53,12 +53,21 @@
p/c ...
(void (quote-syntax (provide/doc (for-docs id) ...)))))))]))
(define-for-syntax (remove->i-deps stx)
(syntax-case stx ()
[(id (id2 ...) ctc)
#'(id ctc)]
[(id ctc)
#'(id ctc)]
[else
(error 'remove->i-deps "unknown thing ~s" stx)]))
(define-provide/doc-transformer proc-doc
(lambda (stx)
(syntax-case stx ()
[(_ id contract desc)
(with-syntax ([(header result (body-stuff ...))
(syntax-case #'contract (->d -> values)
(syntax-case #'contract (->d ->i -> values)
[(->d (req ...) () (values [name res] ...))
#'((id req ...) (values res ...) ())]
[(->d (req ...) () #:pre-cond condition (values [name res] ...))
@ -82,6 +91,42 @@
(format "unsupported ->d contract form for ~a" (syntax->datum #'id))
stx
#'contract)]
[(->i (req ...) () (values ress ...))
(with-syntax ([(req ...) (map remove->i-deps (syntax->list #'(req ...)))]
[([name res] ...) (map remove->i-deps (syntax->list #'(req ...)))])
#'((id req ...) (values res ...) ()))]
[(->i (req ...) () #:pre (pre-id ...) condition (values ress ...))
(with-syntax ([(req ...) (map remove->i-deps (syntax->list #'(req ...)))]
[([name res] ...) (map remove->i-deps (syntax->list #'(req ...)))])
#'((id req ...) (values res ...) ((bold "Pre-condition: ") (scheme condition) "\n" "\n")))]
[(->i (req ...) () res)
(with-syntax ([(req ...) (map remove->i-deps (syntax->list #'(req ...)))]
[[name res] (remove->i-deps #'res)])
#'((id req ...) res ()))]
[(->i (req ...) () #:pre (pre-id ...) condition [name res])
(with-syntax ([(req ...) (map remove->i-deps (syntax->list #'(req ...)))]
[[name res] (remove->i-deps #'res)])
#'((id req ...) res ((bold "Pre-condition: ") (scheme condition) "\n" "\n" )))]
[(->i (req ...) () #:rest rest res)
(with-syntax ([(req ...) (map remove->i-deps (syntax->list #'(req ...)))]
[[name res] (remove->i-deps #'res)]
[[name-t rest-ctc] (remove->i-deps #'rest)])
#'((id req ... [name-t rest-ctc] (... ...)) res ()))]
[(->i (req ...) (one more ...) whatever)
(raise-syntax-error
#f
(format "unsupported ->i contract form for ~a, optional arguments non-empty, must use proc-doc/names"
(syntax->datum #'id))
stx
#'contract)]
[(->i whatever ...)
(raise-syntax-error
#f
(format "unsupported ->i contract form for ~a" (syntax->datum #'id))
stx
#'contract)]
[(-> result)
#'((id) result ())]
[(-> whatever ...)

View File

@ -1,5 +1,4 @@
#lang racket/base
(require racket/promise "text/output.ss" "text/syntax-utils.ss")
(provide (all-from-out racket/promise "text/output.ss")
begin/text include/text)
(require "text/main.rkt")
(provide (all-from-out "text/main.rkt"))

View File

@ -0,0 +1,9 @@
#lang racket/base
(require "syntax-utils.ss" "output.ss"
racket/promise racket/list racket/string)
(provide (except-out (all-from-out racket/base) #%module-begin)
(all-from-out "output.ss" racket/promise racket/list racket/string)
(rename-out [module-begin/text #%module-begin]
[begin/text text] [include/text include]))

View File

@ -1,12 +1,11 @@
#lang s-exp syntax/module-reader
scribble/text/textlang
scribble/text/lang
#:read scribble:read-inside
#:read-syntax scribble:read-syntax-inside
#:whole-body-readers? #t
#:info (scribble-base-reader-info)
(require (prefix-in scribble: "../../reader.ss")
(only-in scribble/base/reader
scribble-base-reader-info))
(require (prefix-in scribble: scribble/reader)
(only-in scribble/base/reader scribble-base-reader-info))

View File

@ -0,0 +1,7 @@
#lang racket/base
(require "output.ss" "syntax-utils.ss"
racket/promise racket/list racket/string)
(provide (all-from-out "output.ss" racket/promise racket/list racket/string)
begin/text include/text)

View File

@ -2,8 +2,8 @@
(require "output.ss" (for-syntax scheme/base syntax/kerncase))
(provide module-begin/text begin/text include/text
begin/collect)
(provide module-begin/text begin/text include/text begin/collect
process-begin/text)
(begin-for-syntax
(define definition-ids ; ids that don't require forcing

View File

@ -1,9 +0,0 @@
#lang racket/base
(require "syntax-utils.ss" "output.ss" racket/promise)
(provide (except-out (all-from-out racket/base) #%module-begin)
(all-from-out "output.ss" racket/promise)
begin/text
(rename-out [module-begin/text #%module-begin]
[include/text include]))

View File

@ -233,12 +233,13 @@ beginning of each line.
The @racket[str]s are @emph{not} decoded with @racket[decode-content],
so @racket[(verbatim "---")] renders with three hyphens instead of an
em-dash. Beware, however, that @litchar["@"] for a @racket[verbatim]
call performs some processing before delivering arguments to
@racket[verbatim]. The @racket[verbatim] form is typically used with
@litchar["|{"]...@litchar["}|"] or similar brackets to disable
@litchar["@"] notation within the @racket[verbatim] argument, like
this:
em-dash. Beware, however, that @emph{reading}
@litchar["@"]@racket[verbatim] converts @litchar["@"] syntax
within the argument, and such reading occurs well before
arguments to @racket[verbatim] are delivered at run-time. To disable simple
@litchar["@"] notation within the @racket[verbatim] argument,
@racket[verbatim] is typically used with
@litchar["|{"]...@litchar["}|"] or similar brackets, like this:
@verbatim[#:indent 2]|{
@verbatim|{
@ -253,8 +254,8 @@ which renders as
}|
Even with @litchar["|{"]...@litchar["}|"], beware that consistent
leading whitespace is removed; see @secref["alt-body-syntax"] for more
information.
leading whitespace is removed by the parser; see
@secref["alt-body-syntax"] for more information.
See also @racket[literal].}
@ -333,14 +334,18 @@ See also @racket[verbatim].}
@exec{setup-plt} and @exec{scribble} to the directory of the main
document file. The @racket[path] argument also can be a result of
@racket[path->main-collects-relative].
The strings in @racket[suffixes] are filtered to those supported by
given renderer, and then the acceptable suffixes are tried in
order. The HTML renderer supports @racket[".png"] and
@racket[".gif"], while the Latex renderer supports @racket[".png"],
@racket[".pdf"], and @racket[".ps"] (but @racket[".ps"] works only
when converting Latex output to DVI, and @racket[".png"] and
@racket[".pdf"] work only for converting Latex output to PDF).}
@racket[".pdf"] work only for converting Latex output to PDF).
Note that when the @racket[suffixes] library is non-empty, then
the @racket[path] argument should not have a suffix.
}
@; ------------------------------------------------------------------------

View File

@ -1,6 +1,7 @@
#lang scribble/doc
@(require scribble/manual
"utils.ss"
scribble/bnf
(for-label scribble/bnf))
@title[#:tag "bnf"]{BNF Grammars}
@ -8,6 +9,40 @@
@defmodule[scribble/bnf]{The @racket[scribble/bnf] library
provides utilities for typesetting grammars.}
For example,
@verbatim[#:indent 2]|{
@(let ([open @litchar{(}]
[close @litchar{)}])
@BNF[(list @nonterm{expr}
@nonterm{id}
@BNF-seq[open @kleeneplus[@nonterm{expr}] close]
@BNF-seq[open @litchar{lambda}
open @kleenestar[@nonterm{id}] close
@nonterm{expr} close]
@nonterm{val})
(list @nonterm{val}
@BNF-alt[@nonterm{number} @nonterm{primop}])
(list @nonterm{id}
@elem{any name except for @litchar{lambda}})])
}|
produces the output
@(let ([open @litchar{(}]
[close @litchar{)}])
@BNF[(list @nonterm{expr}
@nonterm{id}
@BNF-seq[open @kleeneplus[@nonterm{expr}] close]
@BNF-seq[open @litchar{lambda}
open @kleenestar[@nonterm{id}] close
@nonterm{expr} close]
@nonterm{val})
(list @nonterm{val}
@BNF-alt[@nonterm{number} @nonterm{primop}])
(list @nonterm{id}
@elem{any name except for @litchar{lambda}})])
See also @racket[racketgrammar].
@defproc[(BNF [prod (cons element? (listof element?))] ...) table?]{

View File

@ -943,8 +943,9 @@ otherwise.}
Returns @racket[#t] if @racket[v] is a string, symbol,
@racket[element], @racket[multiarg-element],
@racket[traverse-element], @racket[delayed-element],
@racket[part-relative-element], or list of @tech{content}, @racket[#f]
otherwise.}
@racket[part-relative-element], a convertible value in
the sense of @racket[convertible?], or list of @tech{content}.
Otherwise, it returns @racket[#f].}
@defstruct[style ([name (or/c string? symbol? #f)]

View File

@ -25,12 +25,24 @@ set to @racket['string]. If @racket[eval] is not provided, an
evaluator is created using @racket[make-base-eval]. See also
@racket[make-eval-factory].
If the value of @racket[current-print] in the sandbox is changed from
its default value, or if @racket[print-as-expression] in the sandbox
is set to @racket[#f], then each evaluation result is formatted to a
string by applying @racket[(current-print)] to the value (with the
output port set to a string port). Otherwise, result values are
typeset using @racket[to-element/no-color].
Uses of @racket[code:comment] and @racketidfont{code:blank} are
stipped from each @racket[datum] before evaluation.
If a @racket[datum] has the form @racket[(@#,indexed-racket[eval:alts]
#,(svar show-datum) #,(svar eval-datum))], then @svar[show-datum] is
typeset, while @svar[eval-datum] is evaluated.}
typeset, while @svar[eval-datum] is evaluated.
If a @racket[datum] has the form
@racket[(@#,indexed-racket[eval:check] #,(svar eval-datum) #,(svar
expect-datum))], then both @svar[eval-datum] and @svar[check-datum]
are evaluated, and an error is raised if they are not @racket[equal?].}
@defform*[[(interaction-eval datum)
@ -90,8 +102,8 @@ prompt, and with line of space after it.}
@defproc[(make-base-eval) (any/c . -> . any)]{
Creates an evaluator using @racket[(make-evaluator 'racket/base)],
setting sandbox parameters to disable limits, set the outputs to
@racket['string], and not add extra security guards.}
setting sandbox parameters to disable limits, setting the outputs to
@racket['string], and not adding extra security guards.}
@defproc[(make-base-eval-factory [mod-paths (listof module-path?)]) (-> (any/c . -> . any))]{
@ -105,7 +117,7 @@ time) and then attached to each evaluator that is created.}
@defproc[(make-eval-factory [mod-paths (listof module-path?)]) (-> (any/c . -> . any))]{
Like @racket[make-base-eval-factor], but each module in @racket[mod-paths] is
Like @racket[make-base-eval-factory], but each module in @racket[mod-paths] is
also required into the top-level environment for each generated evaluator.}

View File

@ -2,9 +2,15 @@
@(require scribble/manual
scribble/bnf
"utils.ss"
(for-label scriblib/figure))
(for-label scriblib/figure
scribble/base
scribble/sigplan))
@(define (sample . text) (nested #:style 'inset (apply verbatim text)))
@(define-syntax-rule (samplemod . text) (codeblock . text))
@(define-syntax-rule (sample a . text) (codeblock #:context #'a
#:keep-lang-line? #f
"#lang scribble/base" "\n"
a . text))
@(define (result . text) (apply nested #:style 'inset text))
@title[#:tag "getting-started"]{Getting Started}
@ -18,7 +24,7 @@ goal-specific advice on how to continue.
Create a file @filepath{mouse.scrbl} with this content:
@sample|{
@samplemod|{
#lang scribble/base
@title{On the Cookie-Eating Habits of Mice}
@ -65,7 +71,7 @@ for the kind of document that you want as output:
Add more text to @filepath{mouse.scrbl} so that it looks like this:
@sample|{
@samplemod|{
#lang scribble/base
@title{On the Cookie-Eating Habits of Mice}
@ -111,7 +117,7 @@ larger document.
To split the example document into multiple files, change
@filepath{mouse.scrbl} to just
@sample|{
@samplemod|{
#lang scribble/base
@title{On the Cookie-Eating Habits of Mice}
@ -126,7 +132,7 @@ To split the example document into multiple files, change
Create @filepath{milk.scrbl} and @filepath{straw.scrbl} in the same
directory as @filepath{mouse.scrbl}. In @filepath{milk.scrbl}, put
@sample|{
@samplemod|{
#lang scribble/base
@title{The Consequences of Milk}
@ -136,7 +142,7 @@ directory as @filepath{mouse.scrbl}. In @filepath{milk.scrbl}, put
and in @filepath{straw.scbl}, put
@sample|{
@samplemod|{
#lang scribble/base
@title{Not the Last Straw}
@ -167,14 +173,14 @@ the paper to a workshop on programming languages, then---well, you
probably need a different topic. But you can start making the current
content look right by changing the first line to
@sample|{
@samplemod|{
#lang scribble/sigplan
}|
If you're instead working toward Racket library documentation,
try changing the first line to
@sample|{
@samplemod|{
#lang scribble/manual
}|
@ -191,7 +197,7 @@ version number---but it changes the set of bindings available in the
document body. For example, with @racketmodname[scribble/sigplan], the
introductory text can be marked as an abstract:
@sample|{
@samplemod|{
#lang scribble/sigplan
@title{On the Cookie-Eating Habits of Mice}
@ -467,7 +473,7 @@ For example the text-mode stream
@section[#:tag "poetry"]{Of Mice and Cookies}
See @secref["milk"].
@section[#:tag "milk"]{@italic{Important} Stuff About Milk}
@section[#:tag "milk"]{@italic{Important} Milk Supplies}
@figure["straw" @elem{A straw}]{@image["straw.png"]}
}|
@ -573,9 +579,9 @@ renders as
because the source is equivalent to
@sample|{
@racketblock[
(verbatim (number->string (+ 1 2)))
}|
]
where @racket[(number->string (+ 1 2))] is evaluated to produce the
argument to @racket[verbatim]. The @litchar["|{"]...@litchar["}|"]

View File

@ -379,6 +379,3 @@ include introductory text before the call of
important and when when local table of contents is short, putting the
introductory text after the call of @racket[local-table-of-contents]
may be appropriate.
@;----------------------------------------
@include-section["style.scrbl"]

View File

@ -30,6 +30,60 @@ includes a @racket[latex-defaults] @tech{style property}.
@; ------------------------------------------------------------------------
@section[#:tag "scribble:manual:code"]{Typesetting Code}
@defform/subs[(codeblock option ... str-expr ...+)
([option (code:line #:indent indent-expr)
(code:line #:expand expand-expr)
(code:line #:context context-expr)
(code:line #:keep-lang-line? keep-expr)])
#:contracts ([indent-expr exact-nonnegative-integer?]
[expand-expr (or/c #f (syntax-object? . -> . syntax-object?))]
[context-expr syntax-object?]
[keep-expr any/c])]{
Parses the code formed by the strings produced by the
@racket[str-expr]s as a Racket module and produces a @tech{block} that
typesets the code. The code is indented by the amount specified by
@racket[indent-expr], which defaults to @racket[2].
When @racket[expand-expr] produces @racket[#f] (which is the default),
identifiers in the typeset code are colored and linked based on
for-label bindings in the lexical environment of the syntax object
provided by @racket[context-expr]. The default @racket[context-expr]
has the same lexical context as the first @racket[str-expr].
When @racket[expand-expr] produces a procedure, it is used to
macro-expand the parsed program, and syntax coloring is based on the
parsed program.
When @racket[keep-lang-line?-expr] produces a true value (the
default), the @hash-lang[] line in the input is preserved in the
typeset output, otherwise the first line is dropped.
For example,
@codeblock[#:keep-lang-line? #f]|<|{
#lang scribble/manual
@codeblock|{
#lang scribble/manual
@codeblock{
#lang scribble/manual
@title{Hello}
}
}|
}|>|
produces the typeset result
@codeblock|{
#lang scribble/manual
@codeblock{
#lang scribble/manual
@title{Hello}
}
}|
}
@defform[(racketblock datum ...)]{
Typesets the @racket[datum] sequence as a table of Racket code inset
@ -1022,16 +1076,19 @@ If @racket[style?] is true, then @racket[defterm] is used on
@racket[pre-content].}
@defproc[(tech [pre-content pre-content?] ...
[#:doc module-path (or/c module-path? false/c) #f]
[#:tag-prefixes prefixes (or/c (listof string?) false/c) #f])
[#:key key (or/c string? #f) #f]
[#:doc module-path (or/c module-path? #f) #f]
[#:tag-prefixes prefixes (or/c (listof string?) #f) #f])
element?]{
Produces an element for the @tech{decode}d @racket[pre-content], and
hyperlinks it to the definition of the content as established by
@racket[deftech]. The content's string form is normalized in the same
way as for @racket[deftech]. The @racket[#:doc] and
@racket[#:tag-prefixes] arguments support cross-document and
section-specific references, like in @racket[secref].
hyperlinks it to the definition of the key as established by
@racket[deftech]. If @racket[key] is false, the decoded content is
converted to a string (using @racket[content->string]) to use as a
key; in either case, the key is normalized in the same way as for
@racket[deftech]. The @racket[#:doc] and @racket[#:tag-prefixes]
arguments support cross-document and section-specific references, like
in @racket[secref].
With the default style files, the hyperlink created by @racket[tech]
is somewhat quieter than most hyperlinks: the underline in HTML output
@ -1045,11 +1102,12 @@ defined, but a sentence uses the term ``binding,'' the latter can be
linked to the former using @racketfont["@tech{bind}ing"].}
@defproc[(techlink [pre-content pre-content?] ...
[#:doc module-path (or/c module-path? false/c) #f]
[#:tag-prefixes prefixes (or/c (listof string?) false/c) #f])
[#:key key (or/c string? #f) #f]
[#:doc module-path (or/c module-path? #f) #f]
[#:tag-prefixes prefixes (or/c (listof string?) #f) #f])
element?]{
Like @racket[tech], but the link is not a quiet. For example, in HTML
Like @racket[tech], but the link is not quiet. For example, in HTML
output, a hyperlink underline appears even when the mouse is not over
the link.}
@ -1122,12 +1180,12 @@ which is created with @racket[bib-entry]. The entries are typeset in
order as given.}
@defproc[(bib-entry [#:key key string?]
[#:title title (or/c false/c pre-content?)]
[#:title title (or/c #f pre-content?)]
[#:is-book? is-book? boolean? #f]
[#:author author (or/c false/c pre-content?) #f]
[#:location location (or/c false/c pre-content?) #f]
[#:date date (or/c false/c pre-content?) #f]
[#:url url (or/c false/c pre-content?) #f])
[#:author author (or/c #f pre-content?) #f]
[#:location location (or/c #f pre-content?) #f]
[#:date date (or/c #f pre-content?) #f]
[#:url url (or/c #f pre-content?) #f])
bib-entry?]{
Creates a bibliography entry. The @racket[key] is used to refer to the

View File

@ -16,6 +16,7 @@ relevant libraries and APIs in detail.
@local-table-of-contents[]
@include-section["how-to.scrbl"]
@include-section["style.scrbl"]
@include-section["manual.scrbl"]
@include-section["scheme.scrbl"]
@include-section["eval.scrbl"]

View File

@ -12,7 +12,7 @@ file that is included with Scribble.}
@defidform[preprint]{
Enables the @tt{preprint} option. Use @racket[preprint] only on the
same line as @hash-lang[], with only whitespace between
same line as @hash-lang[], with only whitespace (or other options) between
@racketmodname[scribble/sigplan] and @racket[preprint]:
@verbatim[#:indent 2]|{
@ -22,15 +22,59 @@ same line as @hash-lang[], with only whitespace between
@defidform[10pt]{
Enables the @tt{10pt} option. Use @racket[10pt] only on the
same line as @hash-lang[], with only whitespace between
same line as @hash-lang[], with only whitespace (or other options) between
@racketmodname[scribble/sigplan] and @racket[10pt]:
@verbatim[#:indent 2]|{
#lang scribble/sigplan @10pt
}|
The @racket[10pt] and @racket[preprint] options can be
used together and may appear in any order.
@defidform[nocopyright]{
Enables the @tt{nocopyright} option. Use @racket[nocopyright] only on the
same line as @hash-lang[], with only whitespace (or other options) between
@racketmodname[scribble/sigplan] and @racket[nocopyright]:
@verbatim[#:indent 2]|{
#lang scribble/sigplan @nocopyright
}|}
@defidform[onecolumn]{
Enables the @tt{onecolumn} option. Use @racket[onecolumn] only on the
same line as @hash-lang[], with only whitespace (or other options) between
@racketmodname[scribble/sigplan] and @racket[onecolumn]:
@codeblock|{
#lang scribble/sigplan @onecolumn
}|}
@defidform[notimes]{
Disables the use of @tt{\usepackage@"{"times@"}"} in the generated LaTeX output.
Use @racket[onecolumn] only on the
same line as @hash-lang[], with only whitespace (or other options) between
@racketmodname[scribble/sigplan] and @racket[notimes]:
@codeblock|{
#lang scribble/sigplan @notimes
}|}
@defidform[noqcourier]{
Disables the use of @tt{\usepackage@"{"qcourier@"}"} in the generated LaTeX output.
Use @racket[onecolumn] only on the
same line as @hash-lang[], with only whitespace (or other options) between
@racketmodname[scribble/sigplan] and @racket[noqcourier]:
@codeblock|{
#lang scribble/sigplan @noqcourier
}|}
The @racket[10pt], @racket[preprint], @racket[nocopyright],
@racket[onecolumn], @racket[notimes], and @racket[noqcourier]
options can be used together and may appear in any order.
}

View File

@ -2,10 +2,22 @@
@(require scribble/manual
scribble/eval
"utils.ss"
(for-label scribble/manual))
(for-label scribble/manual
scribble/eval))
@title[#:tag "reference-style"]{Style Guide}
Consistent style---for terms, typesetting, and prose---makes
documentation clearer. As much as possible, follow the rules listed in
this section. Many of the rules are arbitrary in the sense that a
different choice of rule could work fine, but the only way to make our
documentation consistent is to pick one of the choices.
There are too many rules to absorb easily on a first reading. Re-read
this section after writing documentation for a library or two, and
revisit the section periodically to refresh your memory and check for
new rules.
@section{Prose and Terminology}
In the descriptive body of @racket[defform], @racket[defproc], etc.,
@ -24,6 +36,18 @@ or a ``symbol.'' Do not use the word ``expression'' for a form that is
a definition or might be a definition; use the word ``form,'' instead.
Prefer ``function'' to ``procedure.''
Use the word ``list'' only when you mean a run-time value consisting
of the empty list and cons cells; use the word ``sequence'' in other
cases, if you must use any word. For example, do not write that
@racket[begin] has a ``list of sub-forms;'' instead, it has a
``sequence of subforms.'' Similarly, do not refer to a ``list of
arguments'' in a function call; just write ``arguments'' if possible,
or write ``sequence of argument expressions.'' (Unfortunately,
``@tech[#:doc '(lib
"scribblings/reference/reference.scrbl")]{sequence}'' has acquired a
specific run-time meaning, too, but the collision is less severe than
the historical confusion between lists and other entities in Lisp.)
Avoid cut-and-paste for descriptive text. If two functions are
similar, consider documenting them together with
@racket[deftogether]. To abstract a description, consider using
@ -40,7 +64,8 @@ Use @racketidfont{id} or a name that ends @racketidfont{-id} in
@racketidfont{symbol}. Similarly, use @racketidfont{expr} or something
that ends @racketidfont{-expr} for an expression position within a
syntactic form. Use @racketidfont{body} for a form (definition or
expression) in an internal-definition position. Do not use
expression) in an internal-definition position---always followed by
@racket[...+] in a grammar description. Do not use
@racketidfont{expr} for something that isn't exactly an expression,
@racket[id] for something that isn't exactly an identifier, etc.;
instead, use @racket[defform/subs] to define a new non-terminal.
@ -89,7 +114,7 @@ When showing example evaluations, use the REPL-snapshot style:
]
}|
See also the @racket[scribble/eval] library.
See also the @racket[scribble/eval] library and @secref["examples-style"].
Use four dots, @litchar{....}, in place of omitted code, since
@litchar{...} means repetition.
@ -108,6 +133,7 @@ in HTML output. Use American style for quotation marks and punctuation
@; and there's no harm in doing the more logical thing of putting
@; the punctuations outside quotations and parens. Just like you
@; did at the end of this sentence...
@; [Matthew] See intro of this section.
at the end of quotation marks (i.e., a sentence-terminating period
goes inside the quotation marks). Of course, this rule does not apply
for quotation marks that are part of code.
@ -130,3 +156,43 @@ the key word is primarily an executable name, use @racket[exec]
instead of @racket[bold]. Optionally add further descriptive text in
the title after a colon, where the text starting with the colon is not
in boldface.
@section{Indexing}
Document and section titles, identifiers that are documented with
@racket[defproc], @racket[defform], etc. are automatically indexed, as
are terms defined with @racket[deftech].
Symbols are not indexed automatically. Use @racket[indexed-racket]
instead of @racket[racket] for the instance of a symbol that roughly
defines the use. For an example, try searching for ``truncate'' to
find @racket['truncate] as used with @racket[open-output-file]. Do no
use something like @racket[(index "'truncate")] to index a symbol,
because it will not typeset correctly (i.e., in a fixed-width font
with the color of a literal).
Use @racket[index], @racket[as-index], and @racket[section-index] as a
last resort. Create index entries for terms that are completely
different from terms otherwise indexed. Do not try to index minor
variations of a term or phrase in an attempt to improve search
results; if search fails to find a word or phrase due to a minor
variation, then the search algorithm should be fixed, not the index
entry.
@section[#:tag "examples-style"]{Examples}
Strive to include examples (using @racket[examples]) with the
documentation of every function and syntactic form. When writing
examples, refrain from using nonsense words like ``foo'' and ``bar.''
For example, when documenting @racket[member], resist the temptation
to write
@interaction[
(member "foo" '("bar" "foo" "baz"))
]
and instead write something like
@interaction[
(member "Groucho" '("Harpo" "Groucho" "Zeppo"))
]

View File

@ -1,5 +1,6 @@
#lang at-exp racket/base
(require scribble/manual
racket/list
scribble/core
scribble/decode
scribble/html-properties
@ -16,7 +17,7 @@
(define autobib-style-extras
(let ([abs (lambda (s)
(path->main-collects-relative
(build-path (collection-path "scriblib") s)))])
(collection-file-path s "scriblib")))])
(list
(make-css-addition (abs "autobib.css"))
(make-tex-addition (abs "autobib.tex")))))
@ -46,8 +47,10 @@
(define (add-inline-cite group bib-entries)
(for ([i bib-entries]) (hash-set! (bib-group-ht group) i #t))
(when (and (pair? (cdr bib-entries)) (not (apply equal? (map auto-bib-author bib-entries))))
(error 'citet "citet must be used with identical authors, given ~a" (map auto-bib-author bib-entries)))
(when (and (pair? (cdr bib-entries))
(not (apply equal? (map (compose author-element-names auto-bib-author) bib-entries))))
(error 'citet "citet must be used with identical authors, given ~a"
(map (compose author-element-names auto-bib-author) bib-entries)))
(make-element
#f
(list (add-cite group (car bib-entries) 'autobib-author #f)
@ -64,34 +67,44 @@
")")))
(define (add-cites group bib-entries)
(define groups (for/fold ([h (hash)]) ([b (reverse bib-entries)])
(hash-update h (author-element-names (auto-bib-author b))
(lambda (cur) (cons b cur)) null)))
(make-element
#f
(list 'nbsp
"("
(let loop ([keys bib-entries])
(if (null? (cdr keys))
(make-element
#f
(list
(add-cite group (car keys) 'autobib-author #f)
" "
(add-cite group (car keys) 'autobib-date #t)))
(make-element
#f
(list (loop (list (car keys)))
"; "
(loop (cdr keys))))))
")")))
(append
(list 'nbsp "(")
(add-between
(for/list ([(k v) groups])
(make-element
#f
(list*
(add-cite group (car v) 'autobib-author #f)
" "
(add-between
(for/list ([b v]) (add-cite group b 'autobib-date #t))
", "))))
"; ")
(list ")"))))
(define (extract-bib-key b)
(author-element-names (auto-bib-author b)))
(define (extract-bib-year b)
(string->number (auto-bib-date b)))
(define (gen-bib tag group)
(let* ([author<? (lambda (a b)
(string<? (extract-bib-key a) (extract-bib-key b)))]
(let* ([author/date<?
(lambda (a b)
(or
(string<? (extract-bib-key a) (extract-bib-key b))
(and (string=? (extract-bib-key a) (extract-bib-key b))
(extract-bib-year a) (extract-bib-year b)
(< (extract-bib-year a) (extract-bib-year b)))))]
[bibs (sort (hash-map (bib-group-ht group)
(lambda (k v) k))
author<?)])
author/date<?)])
(make-part
#f
`((part ,tag))

View File

@ -17,7 +17,8 @@
(define figure-style-extras
(let ([abs (lambda (s)
(build-path (collection-path "scriblib") s))])
(path->main-collects-relative
(collection-file-path s "scriblib")))])
(list (make-css-addition (abs "figure.css"))
(make-tex-addition (abs "figure.tex")))))

View File

@ -5,6 +5,7 @@
scribble/html-properties
scribble/latex-properties
racket/promise
setup/main-collects
"private/counter.ss")
(provide note
@ -12,7 +13,8 @@
(define footnote-style-extras
(let ([abs (lambda (s)
(build-path (collection-path "scriblib") s))])
(path->main-collects-relative
(collection-file-path s "scriblib")))])
(list (make-css-addition (abs "footnote.css"))
(make-tex-addition (abs "footnote.tex")))))

View File

@ -0,0 +1,3 @@
#lang setup/infotab
(define purpose "This collect contains auxiliary scribble libraries, they have their own documentation linked from the top level.")

View File

@ -114,7 +114,7 @@ Combines elements to generate an element that is suitable for
describing a technical report's location.}
@defproc[(dissertation-location [#:institution institution edition any/c]
[#:number degree any/c "PhD"])
[#:degree degree any/c "PhD"])
element?]{
Combines elements to generate an element that is suitable for

View File

@ -22,7 +22,7 @@ rendering support.}
)]{
Creates a figure. The given @scheme[tag] is for use with
@scheme[figure-ref] or @scheme[fFgure-ref]. The @scheme[caption] is an
@scheme[figure-ref] or @scheme[Figure-ref]. The @scheme[caption] is an
element. The @scheme[pre-flow] is decoded as a flow.
For HTML output, the @scheme[figure*] and @scheme[figure*] functions

View File

@ -91,7 +91,13 @@ fo@o -@-> fo@o
---
@[foo] -@-> (foo)
---
@|{blah}| -@-> {"blah"}
@{@foo bar} -@-> (foo " bar")
---
@|{blah}| -@-> ("blah")
---
@|{blah|@foo bleh}| -@-> ("blah" foo " bleh")
---
@|{|@meh blah|@foo bleh}| -@-> (meh " blah" foo " bleh")
---
;; -------------------- newlines and spaces in text
---
@ -871,7 +877,7 @@ END-OF-TESTS
[(column=) syntax-column]
[(position=) syntax-position]
[(span=) syntax-span]
[else (error 'syntax-test "unknown test form: ~e" (car y))])
[else (error 'syntax-test "unknown test form: ~.s" (car y))])
x)
(cadr y))
(check-stx x (cddr y))]

View File

@ -1,196 +0,0 @@
data 'BNDL' (128) {
$"4D72 5374 0000 0001 4652 4546 0001 0000" /* MrSt....FREF.... */
$"0080 0001 0081 4943 4E23 0001 0000 0082" /* .€...<EFBFBD>ICN#..... */
$"0001 0000" /* .... */
};
data 'cmdl' (128) {
$"2D65 2027 2864 6973 706C 6179 2022 6869" /* -e '(display "hi */
$"2229 27" /* ")' */
};
data 'ALRT' (128) {
$"0065 0054 00EF 0184 0080 5555 300A" /* .e.T.ï..€UU0Â */
};
data 'DITL' (128) {
$"0002 0000 0000 006C 0089 0080 00C3 0402" /* .......l..€.Ã.. */
$"4F4B 0000 0000 0007 000C 0039 0122 8802" /* OK.........9."ˆ. */
$"5E30 0000 0000 003A 000C 0064 0122 8802" /* ^0.....:...d."ˆ. */
$"5E31" /* ^1 */
};
data 'icl8' (130) {
$"0000 0000 0000 0000 0000 0000 00F5 2BF7" /* .............õ+÷ */
$"F7F7 F500 0000 0000 0000 0000 0000 0000" /* ÷÷õ............. */
$"0000 0000 0000 0000 0000 F8FB F2F1 D4EB" /* ..........øûòñÔë */
$"ECD3 EEAA 802B 0000 0000 0000 0000 0000" /* ìÓ+.......... */
$"0000 0000 0000 0000 56FB FAF7 F5F5 F7AB" /* ........Vûú÷õõ÷« */
$"D2D2 D2D2 D2D3 AAF7 0000 0000 0000 0000" /* ÒÒÒÒÒÓª÷........ */
$"0000 0000 0000 F688 885D 6464 F900 00F5" /* ......öˆˆ]ddù..õ */
$"AAD2 D2D2 D2D2 D2D3 FBF5 0000 0000 0000" /* ªÒÒÒÒÒÒÓûõ...... */
$"0000 0000 00F7 6B23 2323 2323 D9F7 0000" /* .....÷k#####Ù÷.. */
$"F7D3 D2D2 D2D2 D2D2 D2AA F600 0000 0000" /* ÷ÓÒÒÒÒÒÒÒªö..... */
$"0000 0000 F7DA 2323 2323 2323 23DB 0000" /* ....÷Ú#######Û.. */
$"00AA D2D2 D2D2 D2D2 D2D2 D4F6 0000 0000" /* .ªÒÒÒÒÒÒÒÒÔö.... */
$"0000 00F6 6B23 2323 2323 2323 23D8 F800" /* ...ök########Øø. */
$"00F9 D2D2 D2D2 D2D2 D2D2 D2AB 0000 0000" /* .ùÒÒÒÒÒÒÒÒÒ«.... */
$"0000 0088 2323 2323 2323 2323 2323 6400" /* ...ˆ##########d. */
$"00F6 EED2 D2D2 D2D2 D2D2 D2D2 8000 0000" /* .öîÒÒÒÒÒÒÒÒÒ... */
$"0000 56D8 2323 2323 2323 2323 2323 6B00" /* ..VØ##########k. */
$"0000 AAD2 D2D2 D2D2 D2D2 D2D2 D32B 0000" /* ..ªÒÒÒÒÒÒÒÒÒÓ+.. */
$"0000 DB23 2323 2323 2323 2323 2323 472B" /* ..Û###########G+ */
$"0000 F9D2 D2D2 D2D2 D2D2 D2D2 D2AA 0000" /* ..ùÒÒÒÒÒÒÒÒÒÒª.. */
$"00F8 D723 2323 2323 2323 2323 2323 D7F8" /* ×###########×ø */
$"0000 F6EE D2D2 D2D2 D2D2 D2D2 D2ED 2B00" /* ..öîÒÒÒÒÒÒÒÒÒí+. */
$"0064 2323 2323 2323 2323 2323 2323 D7F8" /* .d############×ø */
$"0000 00AA D2D2 D2D2 D2D2 D2D2 D2D2 FA00" /* ...ªÒÒÒÒÒÒÒÒÒÒú. */
$"006B 2323 2323 2323 2323 2323 2323 D9F6" /* .k############Ùö */
$"0000 00F8 ECD2 D2D2 D2D2 D2D2 D2D2 AA00" /* ...øìÒÒÒÒÒÒÒÒÒª. */
$"F6D9 2323 2323 2323 2323 2323 2323 DB00" /* öÙ############Û. */
$"F600 0000 D4D2 D2D2 D2D2 D2D2 D2D2 D400" /* ö...ÔÒÒÒÒÒÒÒÒÒÔ. */
$"F7D7 2323 2323 2323 2323 2323 2323 FA5D" /* ÷×############ú] */
$"DBF6 0000 FAD2 D2D2 D2D2 D2D2 D2D2 EDF6" /* Ûö..úÒÒÒÒÒÒÒÒÒíö */
$"56D7 2323 2323 2323 2323 2323 23DA 2B6B" /* V×###########Ú+k */
$"235D 0000 F6ED D2D2 D2D2 D2D2 D2D2 D32B" /* #]..öíÒÒÒÒÒÒÒÒÓ+ */
$"56D7 2323 2323 2323 2323 2323 235D F9D7" /* V×###########]ù× */
$"236B F500 00AA D2D2 D2D2 D2D2 D2D2 D32B" /* #kõ..ªÒÒÒÒÒÒÒÒÓ+ */
$"F7D8 2323 2323 2323 2323 2323 6BF6 6423" /* ÷Ø##########köd# */
$"2323 F900 00F8 EBD2 D2D2 D2D2 D2D2 EEF5" /* ##ù..øëÒÒÒÒÒÒÒîõ */
$"F6D9 2323 2323 2323 2323 23D7 FAF8 D823" /* öÙ#########×úøØ# */
$"2323 6400 0000 EFD2 D2D2 D2D2 D2D2 D400" /* ##d...ïÒÒÒÒÒÒÒÔ. */
$"006B 2323 2323 2323 2323 23DB 0064 2323" /* .k#########Û.d## */
$"2323 47F7 0000 F9EB D2D2 D2D2 D2D2 AA00" /* ##G÷..ùëÒÒÒÒÒÒª. */
$"0064 2323 2323 2323 2323 D856 F6DA 2323" /* .d########ØVöÚ## */
$"2323 235D 0000 00D4 D2D2 D2D2 D2D2 8000" /* ###]...ÔÒÒÒÒÒÒ€. */
$"00F8 D823 2323 2323 2323 6400 5D23 2323" /* .øØ#######d.]### */
$"2323 236B F500 00F9 EBD2 D2D2 D2ED 2B00" /* ###kõ..ùëÒÒÒÒí+. */
$"0000 DB23 2323 2323 2347 F7F5 6B23 2323" /* ..Û######G÷õk### */
$"2323 23D7 5600 00F5 D4D2 D2D2 D2AB 0000" /* ###×V..õÔÒÒÒÒ«.. */
$"0000 56D8 2323 2323 2388 00F9 D723 2323" /* ..VØ#####ˆ.ù×### */
$"2323 2323 6400 0000 F9EB E3E3 ED2B 0000" /* ####d...ùëããí+.. */
$"0000 0088 2323 2323 DA2B 0064 2323 2323" /* ...ˆ####Ú+.d#### */
$"2323 2323 D9F6 0000 F5EF E3CB E300 0000" /* ####Ùö..õïãËã... */
$"0000 00F6 6B23 2323 5D00 F7D8 2323 2323" /* ...ök###].÷Ø#### */
$"2323 2323 23E3 E3E3 E3E3 E3CB CBE3 0000" /* #####ããããããËËã.. */
$"0000 0000 F7DA 236B F500 6423 2323 2323" /* ....÷Ú#kõ.d##### */
$"2323 2323 23E3 CBCB CBCB CBCB CBCB E300" /* #####ãËËËËËËËËã. */
$"0000 0000 00F7 DB56 00F7 D923 2323 2323" /* .....÷ÛV.÷Ù##### */
$"2323 2323 23E3 CBCB CBCB CBCB CBCB CBE3" /* #####ãËËËËËËËËËã */
$"0000 0000 0000 F6FC 8FD9 2323 2323 2323" /* ......öü<EFBFBD>Ù###### */
$"2323 2323 23E3 CBCB CBCB CBCB CBCB E300" /* #####ãËËËËËËËËã. */
$"0000 0000 0000 0000 F864 4723 2323 2323" /* ........ødG##### */
$"2323 2323 23E3 E3E3 E3E3 E3CB CBE3 0000" /* #####ããããããËËã.. */
$"0000 0000 0000 0000 0000 F75D DBDA 47D7" /* ..........÷]ÛÚG× */
$"D747 6B64 5D2B 0000 0000 E3CB E300 0000" /* ×Gkd]+....ãËã... */
$"0000 0000 0000 0000 0000 0000 00F5 2B2B" /* .............õ++ */
$"2B2B 0000 0000 0000 0000 E3E3 0000 0000" /* ++........ãã.... */
};
data 'icl4' (130) {
$"0000 0000 0000 00CC CC00 0000 0000 0000" /* .......ÌÌ....... */
$"0000 0000 00CE FF66 6665 DC00 0000 0000" /* .....ÎÿffeÜ..... */
$"0000 0000 DEDC 00CE 6666 665C 0000 0000" /* ....ÞÜ.Îfff\.... */
$"0000 00CE EBBB D000 5666 6666 E000 0000" /* ...Îë»Ð.Vfffà... */
$"0000 0C33 3333 3C00 C666 6666 65C0 0000" /* ...333<.ÆfffeÀ.. */
$"0000 C333 3333 3300 0566 6666 666C 0000" /* ..Ã3333..ffffl.. */
$"000C 3333 3333 33C0 0D66 6666 666E 0000" /* ..33333À.ffffn.. */
$"000E 3333 3333 33B0 0C66 6666 6666 D000" /* ..33333°.fffffÐ. */
$"00D3 3333 3333 3330 0056 6666 6666 6C00" /* .Ó333330.Vffffl. */
$"0033 3333 3333 333C 00D6 6666 6666 6500" /* .333333<.Öffffe. */
$"0C33 3333 3333 333C 00C6 6666 6666 66C0" /* .333333<.ÆfffffÀ */
$"0B33 3333 3333 333C 0005 6666 6666 66D0" /* .333333<..fffffÐ */
$"0333 3333 3333 333C 000C 6666 6666 6650" /* .333333<..fffffP */
$"C333 3333 3333 3330 C000 6666 6666 6660" /* Ã3333330À.fffff` */
$"C333 3333 3333 33DB 3C00 D666 6666 666C" /* Ã333333Û<.Öffffl */
$"D333 3333 3333 33C3 3B00 C666 6666 666C" /* Ó333333Ã;.Æffffl */
$"D333 3333 3333 3BD3 3300 0566 6666 666C" /* Ó33333;Ó3..ffffl */
$"C333 3333 3333 3CB3 33D0 0C66 6666 6660" /* Ã33333<³3Ð.ffff` */
$"C333 3333 3333 DC33 33B0 0066 6666 6660" /* Ã33333Ü33°.ffff` */
$"0333 3333 3333 0B33 333C 00D6 6666 6650" /* .33333.33<.ÖfffP */
$"0B33 3333 333D C333 333B 0006 6666 66D0" /* .3333=Ã33;..fffÐ */
$"0C33 3333 33B0 B333 3333 000D 6666 66C0" /* .3333°³333..fffÀ */
$"0033 3333 33C0 3333 3333 D000 6666 6E00" /* .3333À3333Ð.ffn. */
$"00D3 3333 3E0D 3333 3333 B000 D688 6C00" /* .Ó33>.3333°ˆl. */
$"000E 3333 3C0B 3333 3333 3C00 0689 8000" /* ..33<.3333<..‰€. */
$"000C 3333 B0C3 3333 3333 3888 8889 9800" /* ..33°Ã33338ˆˆ‰˜. */
$"0000 C333 00B3 3333 3333 3899 9999 9980" /* ..Ã3.³33338™™™™€ */
$"0000 0C3D 0C33 3333 3333 3899 9999 9998" /* ...=.333338™™™™˜ */
$"0000 00CE A333 3333 3333 3899 9999 9980" /* ...Σ333338™™™™€ */
$"0000 0000 CB33 3333 3333 3888 8889 9800" /* ....Ë333338ˆˆ‰˜. */
$"0000 0000 00CB 3333 333B BC00 0089 8000" /* .....Ë333;¼..‰€. */
$"0000 0000 0000 00CC CC00 0000 0088 0000" /* .......ÌÌ....ˆ.. */
};
data 'ICN#' (130) {
$"001F F800 0075 5600 01FE AB80 0341 5540" /* ..ø..uV..þ«€.AU@ */
$"06B8 AAA0 0D54 D550 1AAC 6AA8 3556 5554" /* .¸ª .TÕP.¬j¨5VUT */
$"2AAA 2AAC 5555 3556 6AAB 1AAA D555 1555" /* *ª*¬UU5Vj«.ªÕU.U */
$"AAAB 0AAB D555 0D55 AAAA 46AB D556 C555" /* ª«Â«ÕU.UªªF«ÕVÅU */
$"AAAC A2AB D555 6355 AAA9 A1AB D55B 5155" /* ª¬¢«ÕUcUª©¡«Õ[QU */
$"AAB2 B0AB 5555 58D6 6AA6 A86A 356D 547C" /* ª²°«UUXÖj¦¨j5mT| */
$"2ACA AC2C 1555 57E4 0A9A AC02 05B5 5401" /* *ʬ,.UW䚬..µT. */
$"03EA AC02 01D5 57E4 006A AB28 001F FC30" /* ¬..ÕWä.j«(..ü0 */
$"001F F800 007F FE00 01FF FF80 03FF FFC0" /* ..ø...þ..ÿÿ.ÿÿÀ */
$"07FF FFE0 0FFF FFF0 1FFF FFF8 3FFF FFFC" /* .ÿÿà.ÿÿð.ÿÿø?ÿÿü */
$"3FFF FFFC 7FFF FFFE 7FFF FFFE FFFF FFFF" /* ?ÿÿü.ÿÿþ.ÿÿþÿÿÿÿ */
$"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF" /* ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ */
$"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF" /* ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ */
$"FFFF FFFF 7FFF FFFE 7FFF FFFE 3FFF FFFC" /* ÿÿÿÿ.ÿÿþ.ÿÿþ?ÿÿü */
$"3FFF FFFC 1FFF FFFC 0FFF FFFE 07FF FFFF" /* ?ÿÿü.ÿÿü.ÿÿþ.ÿÿÿ */
$"03FF FFFE 01FF FFFC 007F FF38 001F FC30" /* .ÿÿþ.ÿÿü..ÿ8..ü0 */
};
data 'ics#' (130) {
$"07E0 1FF8 39FC 7EFE 7E7E FF7F FF3F FE3F" /* .à.ø9ü~þ~~ÿ.ÿ?þ? */
$"FC9F FDDF F9CF 7BEE 73FA 37E1 1FFA 07E4" /* üŸýßùÏ{îsú7á.ú.ä */
$"07E0 1FF8 3FFC 7FFE 7FFE FFFF FFFF FFFF" /* .à.ø?ü.þ.þÿÿÿÿÿÿ */
$"FFFF FFFF FFFF 7FFE 7FFE 3FFF 1FFE 07E4" /* ÿÿÿÿÿÿ.þ.þ?ÿ.þ.ä */
};
data 'ics4' (130) {
$"0000 0FFF FFF0 0000 000F F666 666F F000" /* ...ÿÿð....öffoð. */
$"00F3 3006 6666 6F00 0F33 3330 6666 66F0" /* .ó0.ffo..330fffð */
$"0F33 3330 0666 66F0 F333 3333 0666 666F" /* .330.ffðó333.ffo */
$"F333 3333 0066 666F F333 3330 0066 666F" /* ó333.ffoó330.ffo */
$"F333 3300 3006 666F F333 3303 3306 666F" /* ó33.0.foó33.3.fo */
$"F333 3003 3300 666F 0F33 3033 3330 68F0" /* ó30.3.fo.30330hð */
$"0F33 0033 3388 8980 00F3 0333 3389 9998" /* .3.33ˆ‰€.ó.33‰™˜ */
$"000F F333 3388 8980 0000 0FFF FFF0 0800" /* ..ó33ˆ‰€...ÿÿð.. */
};
data 'ics8' (130) {
$"0000 0000 00FF FFFF FFFF FF00 0000 0000" /* .....ÿÿÿÿÿÿ..... */
$"0000 00FF FFD2 D2D2 D2D2 D2FF FF00 0000" /* ...ÿÿÒÒÒÒÒÒÿÿ... */
$"0000 FF23 2300 00D2 D2D2 D2D2 D2FF 0000" /* ..ÿ##..ÒÒÒÒÒÒÿ.. */
$"00FF 2323 2323 2300 D2D2 D2D2 D2D2 FF00" /* .ÿ#####.ÒÒÒÒÒÒÿ. */
$"00FF 2323 2323 2300 00D2 D2D2 D2D2 FF00" /* .ÿ#####..ÒÒÒÒÒÿ. */
$"FF23 2323 2323 2323 00D2 D2D2 D2D2 D2FF" /* ÿ#######.ÒÒÒÒÒÒÿ */
$"FF23 2323 2323 2323 0000 D2D2 D2D2 D2FF" /* ÿ#######..ÒÒÒÒÒÿ */
$"FF23 2323 2323 2300 0000 D2D2 D2D2 D2FF" /* ÿ######...ÒÒÒÒÒÿ */
$"FF23 2323 2323 0000 2300 00D2 D2D2 D2FF" /* ÿ#####..#..ÒÒÒÒÿ */
$"FF23 2323 2323 0023 2323 00D2 D2D2 D2FF" /* ÿ#####.###.ÒÒÒÒÿ */
$"FF23 2323 2300 0023 2323 0000 D2D2 D2FF" /* ÿ####..###..ÒÒÒÿ */
$"00FF 2323 2300 2323 2323 2300 ECE3 FF00" /* .ÿ###.#####.ìãÿ. */
$"00FF 2323 0000 2323 2323 E3E3 E3CB E300" /* .ÿ##..####ãããËã. */
$"0000 FF23 0023 2323 2323 E3CB CBCB CBE3" /* ..ÿ#.#####ãËËËËã */
$"0000 00FF FF23 2323 2323 E3E3 E3CB E300" /* ...ÿÿ#####ãããËã. */
$"0000 0000 00FF FFFF FFFF FF00 00E3 0000" /* .....ÿÿÿÿÿÿ..ã.. */
};
data 'MrSt' (0, "Owner resource") {
$"00" /* . */
};
data 'FREF' (128) {
$"4150 504C 0000 00" /* APPL... */
};
data 'FREF' (129) {
$"2A2A 2A2A 0001 00" /* ****... */
};
data 'SIZE' (-1) {
$"58F0 0007 A120 0007 A120" /* Xð..¡ ..¡ */
};