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

View File

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

View File

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

View File

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

View File

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

View File

@ -9,6 +9,7 @@
scheme/port scheme/port
scheme/list scheme/list
scheme/string scheme/string
file/convertible
mzlib/runtime-path mzlib/runtime-path
setup/main-doc setup/main-doc
setup/main-collects setup/main-collects
@ -947,6 +948,15 @@
(cond (cond
[(string? e) (super render-content e part ri)] ; short-cut for common case [(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 [(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) [(image-element? e)
(let* ([src (main-collects-relative->path (image-element-path e))] (let* ([src (main-collects-relative->path (image-element-path e))]
[suffixes (image-element-suffixes e)] [suffixes (image-element-suffixes e)]
@ -1046,7 +1056,7 @@
(begin (begin
(when #f (when #f
(fprintf (current-error-port) (fprintf (current-error-port)
"Undefined link: ~s~n" "Undefined link: ~s\n"
(tag-key (link-element-tag e) ri))) (tag-key (link-element-tag e) ri)))
`((font ([class "badlink"]) `((font ([class "badlink"])
,@(if (empty-content? (element-content e)) ,@(if (empty-content? (element-content e))
@ -1421,7 +1431,12 @@
[full-path (build-path (path-only (current-output-file)) [full-path (build-path (path-only (current-output-file))
filename)]) filename)])
(parameterize ([on-separate-page-ok #f]) (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))) (lambda () (render-one-part d ri full-path number)))
null)) null))
(parameterize ([on-separate-page-ok #t]) (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 cached-roots '(#f . #f))
(define (current-url-roots) (define (current-url-roots)
;; takes in a (listof (list prefix-string url-string . flags)), and produces ;; takes `url-roots', a (listof (list prefix-string url-string . flags)), and
;; an alist with lists of strings for the keys; the prefix-strings are split ;; produces an alist with lists of strings for the keys; the prefix-strings
;; on "/"s, and the url-strings can be anything at all actually (they are put ;; are split on "/"s, and the url-strings can be anything at all actually
;; as-is before the path with a "/" between them). ;; (they are put as-is before the path with a "/" between them).
(let ([roots (url-roots)]) (let ([roots (url-roots)])
(unless (eq? roots (car cached-roots)) (unless (eq? roots (car cached-roots))
(set! cached-roots (set! cached-roots
@ -86,7 +86,7 @@
;; find shared prefix ;; find shared prefix
[(and (pair? t) (pair? c) (equal? (car t) (car c))) [(and (pair? t) (pair? c) (equal? (car t) (car c)))
(loop (cdr t) (cdr c) (cons (car t) pfx))] (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) ;; no roots => always use a relative path (useful for debugging)
[(not roots) `(,@(map (lambda (_) "..") c) ,@t ,file*)] [(not roots) `(,@(map (lambda (_) "..") c) ,@t ,file*)]
;; share a root => use a relative path unless its an absolute root ;; share a root => use a relative path unless its an absolute root
@ -197,16 +197,26 @@
(printf " ~a\n" path) (printf " ~a\n" path)
(renderer filename)))))) (renderer filename))))))
(define (url) (relativize filename dirpathlist (rendered-dirpath))) (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) (add-renderer path render)
(make-keyword-procedure (make-keyword-procedure
(lambda (kws kvs . args) (keyword-apply referrer kws kvs (url) args)) (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)])))) [args (apply referrer (url) args)]))))
;; make it possible to always get the path to a resource ;; make it possible to always get the path to a resource
(provide get-resource-path) (provide get-resource-path)
(define (get-resource-path resource) (define get-path (gensym))
(resource get-resource-path)) (define (get-resource-path resource [absolute? #f])
(resource (cons get-path absolute?)))
;; a convenient utility to create renderers from some output function (like ;; a convenient utility to create renderers from some output function (like
;; `output-xml' or `display') and some content ;; `output-xml' or `display') and some content
@ -218,9 +228,11 @@
(provide render-all) (provide render-all)
(define (render-all) (define (render-all)
(printf "Rendering...\n") (printf "Rendering...\n")
(let loop () (define todo (get/reset-renderers))
(let ([todo (get/reset-renderers)]) (if (null? todo)
(printf " Warning: no content to render\n")
(let loop ([todo todo])
(unless (null? todo) (unless (null? todo)
(for-each (lambda (r) (r)) todo) (for-each (lambda (r) (r)) todo)
(loop)))) ; if more were created (loop (get/reset-renderers))))) ; if more were created
(printf "Rendering done.\n")) (printf "Rendering done.\n"))

View File

@ -7,3 +7,4 @@
(define raco-commands (define raco-commands
'(("scribble" scribble/run "render a Scribble document" #f))) '(("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 (define jfp-extras
(let ([abs (lambda (s) (let ([abs (lambda (s)
(path->main-collects-relative (path->main-collects-relative
(build-path (collection-path "scribble") "jfp" s)))]) (collection-file-path s "scribble" "jfp")))])
(list (list
(make-css-addition (abs "jfp.css")) (make-css-addition (abs "jfp.css"))
(make-tex-addition (abs "jfp.tex"))))) (make-tex-addition (abs "jfp.tex")))))

View File

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

View File

@ -2,6 +2,7 @@
(require "base.ss" (require "base.ss"
"private/manual-style.ss" "private/manual-style.ss"
"private/manual-scheme.ss" "private/manual-scheme.ss"
"private/manual-code.ss"
"private/manual-mod.ss" "private/manual-mod.ss"
"private/manual-tech.ss" "private/manual-tech.ss"
"private/manual-bib.ss" "private/manual-bib.ss"
@ -18,6 +19,7 @@
(all-from-out "base.ss" (all-from-out "base.ss"
"private/manual-style.ss" "private/manual-style.ss"
"private/manual-scheme.ss" "private/manual-scheme.ss"
"private/manual-code.ss"
"private/manual-mod.ss" "private/manual-mod.ss"
"private/manual-tech.ss" "private/manual-tech.ss"
"private/manual-bib.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 scheme/list
(for-syntax racket/base) (for-syntax racket/base)
(for-label racket/base (for-label racket/base
racket/contract
racket/class)) racket/class))
(provide defproc defproc* defstruct defstruct* (provide defproc defproc* defstruct defstruct*

View File

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

View File

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

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

@ -53,12 +53,21 @@
p/c ... p/c ...
(void (quote-syntax (provide/doc (for-docs id) ...)))))))])) (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 (define-provide/doc-transformer proc-doc
(lambda (stx) (lambda (stx)
(syntax-case stx () (syntax-case stx ()
[(_ id contract desc) [(_ id contract desc)
(with-syntax ([(header result (body-stuff ...)) (with-syntax ([(header result (body-stuff ...))
(syntax-case #'contract (->d -> values) (syntax-case #'contract (->d ->i -> values)
[(->d (req ...) () (values [name res] ...)) [(->d (req ...) () (values [name res] ...))
#'((id req ...) (values res ...) ())] #'((id req ...) (values res ...) ())]
[(->d (req ...) () #:pre-cond condition (values [name res] ...)) [(->d (req ...) () #:pre-cond condition (values [name res] ...))
@ -82,6 +91,42 @@
(format "unsupported ->d contract form for ~a" (syntax->datum #'id)) (format "unsupported ->d contract form for ~a" (syntax->datum #'id))
stx stx
#'contract)] #'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) [(-> result)
#'((id) result ())] #'((id) result ())]
[(-> whatever ...) [(-> whatever ...)

View File

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

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 #lang s-exp syntax/module-reader
scribble/text/textlang scribble/text/lang
#:read scribble:read-inside #:read scribble:read-inside
#:read-syntax scribble:read-syntax-inside #:read-syntax scribble:read-syntax-inside
#:whole-body-readers? #t #:whole-body-readers? #t
#:info (scribble-base-reader-info) #:info (scribble-base-reader-info)
(require (prefix-in scribble: "../../reader.ss") (require (prefix-in scribble: scribble/reader)
(only-in scribble/base/reader (only-in scribble/base/reader scribble-base-reader-info))
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)) (require "output.ss" (for-syntax scheme/base syntax/kerncase))
(provide module-begin/text begin/text include/text (provide module-begin/text begin/text include/text begin/collect
begin/collect) process-begin/text)
(begin-for-syntax (begin-for-syntax
(define definition-ids ; ids that don't require forcing (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], The @racket[str]s are @emph{not} decoded with @racket[decode-content],
so @racket[(verbatim "---")] renders with three hyphens instead of an so @racket[(verbatim "---")] renders with three hyphens instead of an
em-dash. Beware, however, that @litchar["@"] for a @racket[verbatim] em-dash. Beware, however, that @emph{reading}
call performs some processing before delivering arguments to @litchar["@"]@racket[verbatim] converts @litchar["@"] syntax
@racket[verbatim]. The @racket[verbatim] form is typically used with within the argument, and such reading occurs well before
@litchar["|{"]...@litchar["}|"] or similar brackets to disable arguments to @racket[verbatim] are delivered at run-time. To disable simple
@litchar["@"] notation within the @racket[verbatim] argument, like @litchar["@"] notation within the @racket[verbatim] argument,
this: @racket[verbatim] is typically used with
@litchar["|{"]...@litchar["}|"] or similar brackets, like this:
@verbatim[#:indent 2]|{ @verbatim[#:indent 2]|{
@verbatim|{ @verbatim|{
@ -253,8 +254,8 @@ which renders as
}| }|
Even with @litchar["|{"]...@litchar["}|"], beware that consistent Even with @litchar["|{"]...@litchar["}|"], beware that consistent
leading whitespace is removed; see @secref["alt-body-syntax"] for more leading whitespace is removed by the parser; see
information. @secref["alt-body-syntax"] for more information.
See also @racket[literal].} See also @racket[literal].}
@ -333,14 +334,18 @@ See also @racket[verbatim].}
@exec{setup-plt} and @exec{scribble} to the directory of the main @exec{setup-plt} and @exec{scribble} to the directory of the main
document file. The @racket[path] argument also can be a result of document file. The @racket[path] argument also can be a result of
@racket[path->main-collects-relative]. @racket[path->main-collects-relative].
The strings in @racket[suffixes] are filtered to those supported by The strings in @racket[suffixes] are filtered to those supported by
given renderer, and then the acceptable suffixes are tried in given renderer, and then the acceptable suffixes are tried in
order. The HTML renderer supports @racket[".png"] and order. The HTML renderer supports @racket[".png"] and
@racket[".gif"], while the Latex renderer supports @racket[".png"], @racket[".gif"], while the Latex renderer supports @racket[".png"],
@racket[".pdf"], and @racket[".ps"] (but @racket[".ps"] works only @racket[".pdf"], and @racket[".ps"] (but @racket[".ps"] works only
when converting Latex output to DVI, and @racket[".png"] and 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 #lang scribble/doc
@(require scribble/manual @(require scribble/manual
"utils.ss" "utils.ss"
scribble/bnf
(for-label scribble/bnf)) (for-label scribble/bnf))
@title[#:tag "bnf"]{BNF Grammars} @title[#:tag "bnf"]{BNF Grammars}
@ -8,6 +9,40 @@
@defmodule[scribble/bnf]{The @racket[scribble/bnf] library @defmodule[scribble/bnf]{The @racket[scribble/bnf] library
provides utilities for typesetting grammars.} 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]. See also @racket[racketgrammar].
@defproc[(BNF [prod (cons element? (listof element?))] ...) table?]{ @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, Returns @racket[#t] if @racket[v] is a string, symbol,
@racket[element], @racket[multiarg-element], @racket[element], @racket[multiarg-element],
@racket[traverse-element], @racket[delayed-element], @racket[traverse-element], @racket[delayed-element],
@racket[part-relative-element], or list of @tech{content}, @racket[#f] @racket[part-relative-element], a convertible value in
otherwise.} the sense of @racket[convertible?], or list of @tech{content}.
Otherwise, it returns @racket[#f].}
@defstruct[style ([name (or/c string? symbol? #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 evaluator is created using @racket[make-base-eval]. See also
@racket[make-eval-factory]. @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 Uses of @racket[code:comment] and @racketidfont{code:blank} are
stipped from each @racket[datum] before evaluation. stipped from each @racket[datum] before evaluation.
If a @racket[datum] has the form @racket[(@#,indexed-racket[eval:alts] If a @racket[datum] has the form @racket[(@#,indexed-racket[eval:alts]
#,(svar show-datum) #,(svar eval-datum))], then @svar[show-datum] is #,(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) @defform*[[(interaction-eval datum)
@ -90,8 +102,8 @@ prompt, and with line of space after it.}
@defproc[(make-base-eval) (any/c . -> . any)]{ @defproc[(make-base-eval) (any/c . -> . any)]{
Creates an evaluator using @racket[(make-evaluator 'racket/base)], Creates an evaluator using @racket[(make-evaluator 'racket/base)],
setting sandbox parameters to disable limits, set the outputs to setting sandbox parameters to disable limits, setting the outputs to
@racket['string], and not add extra security guards.} @racket['string], and not adding extra security guards.}
@defproc[(make-base-eval-factory [mod-paths (listof module-path?)]) (-> (any/c . -> . any))]{ @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))]{ @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.} also required into the top-level environment for each generated evaluator.}

View File

@ -2,9 +2,15 @@
@(require scribble/manual @(require scribble/manual
scribble/bnf scribble/bnf
"utils.ss" "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)) @(define (result . text) (apply nested #:style 'inset text))
@title[#:tag "getting-started"]{Getting Started} @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: Create a file @filepath{mouse.scrbl} with this content:
@sample|{ @samplemod|{
#lang scribble/base #lang scribble/base
@title{On the Cookie-Eating Habits of Mice} @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: Add more text to @filepath{mouse.scrbl} so that it looks like this:
@sample|{ @samplemod|{
#lang scribble/base #lang scribble/base
@title{On the Cookie-Eating Habits of Mice} @title{On the Cookie-Eating Habits of Mice}
@ -111,7 +117,7 @@ larger document.
To split the example document into multiple files, change To split the example document into multiple files, change
@filepath{mouse.scrbl} to just @filepath{mouse.scrbl} to just
@sample|{ @samplemod|{
#lang scribble/base #lang scribble/base
@title{On the Cookie-Eating Habits of Mice} @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 Create @filepath{milk.scrbl} and @filepath{straw.scrbl} in the same
directory as @filepath{mouse.scrbl}. In @filepath{milk.scrbl}, put directory as @filepath{mouse.scrbl}. In @filepath{milk.scrbl}, put
@sample|{ @samplemod|{
#lang scribble/base #lang scribble/base
@title{The Consequences of Milk} @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 and in @filepath{straw.scbl}, put
@sample|{ @samplemod|{
#lang scribble/base #lang scribble/base
@title{Not the Last Straw} @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 probably need a different topic. But you can start making the current
content look right by changing the first line to content look right by changing the first line to
@sample|{ @samplemod|{
#lang scribble/sigplan #lang scribble/sigplan
}| }|
If you're instead working toward Racket library documentation, If you're instead working toward Racket library documentation,
try changing the first line to try changing the first line to
@sample|{ @samplemod|{
#lang scribble/manual #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 document body. For example, with @racketmodname[scribble/sigplan], the
introductory text can be marked as an abstract: introductory text can be marked as an abstract:
@sample|{ @samplemod|{
#lang scribble/sigplan #lang scribble/sigplan
@title{On the Cookie-Eating Habits of Mice} @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} @section[#:tag "poetry"]{Of Mice and Cookies}
See @secref["milk"]. 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"]} @figure["straw" @elem{A straw}]{@image["straw.png"]}
}| }|
@ -573,9 +579,9 @@ renders as
because the source is equivalent to because the source is equivalent to
@sample|{ @racketblock[
(verbatim (number->string (+ 1 2))) (verbatim (number->string (+ 1 2)))
}| ]
where @racket[(number->string (+ 1 2))] is evaluated to produce the where @racket[(number->string (+ 1 2))] is evaluated to produce the
argument to @racket[verbatim]. The @litchar["|{"]...@litchar["}|"] 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 important and when when local table of contents is short, putting the
introductory text after the call of @racket[local-table-of-contents] introductory text after the call of @racket[local-table-of-contents]
may be appropriate. 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} @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 ...)]{ @defform[(racketblock datum ...)]{
Typesets the @racket[datum] sequence as a table of Racket code inset 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].} @racket[pre-content].}
@defproc[(tech [pre-content pre-content?] ... @defproc[(tech [pre-content pre-content?] ...
[#:doc module-path (or/c module-path? false/c) #f] [#:key key (or/c string? #f) #f]
[#:tag-prefixes prefixes (or/c (listof string?) false/c) #f]) [#:doc module-path (or/c module-path? #f) #f]
[#:tag-prefixes prefixes (or/c (listof string?) #f) #f])
element?]{ element?]{
Produces an element for the @tech{decode}d @racket[pre-content], and Produces an element for the @tech{decode}d @racket[pre-content], and
hyperlinks it to the definition of the content as established by hyperlinks it to the definition of the key as established by
@racket[deftech]. The content's string form is normalized in the same @racket[deftech]. If @racket[key] is false, the decoded content is
way as for @racket[deftech]. The @racket[#:doc] and converted to a string (using @racket[content->string]) to use as a
@racket[#:tag-prefixes] arguments support cross-document and key; in either case, the key is normalized in the same way as for
section-specific references, like in @racket[secref]. @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] With the default style files, the hyperlink created by @racket[tech]
is somewhat quieter than most hyperlinks: the underline in HTML output 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"].} linked to the former using @racketfont["@tech{bind}ing"].}
@defproc[(techlink [pre-content pre-content?] ... @defproc[(techlink [pre-content pre-content?] ...
[#:doc module-path (or/c module-path? false/c) #f] [#:key key (or/c string? #f) #f]
[#:tag-prefixes prefixes (or/c (listof string?) false/c) #f]) [#:doc module-path (or/c module-path? #f) #f]
[#:tag-prefixes prefixes (or/c (listof string?) #f) #f])
element?]{ 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 output, a hyperlink underline appears even when the mouse is not over
the link.} the link.}
@ -1122,12 +1180,12 @@ which is created with @racket[bib-entry]. The entries are typeset in
order as given.} order as given.}
@defproc[(bib-entry [#:key key string?] @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] [#:is-book? is-book? boolean? #f]
[#:author author (or/c false/c pre-content?) #f] [#:author author (or/c #f pre-content?) #f]
[#:location location (or/c false/c pre-content?) #f] [#:location location (or/c #f pre-content?) #f]
[#:date date (or/c false/c pre-content?) #f] [#:date date (or/c #f pre-content?) #f]
[#:url url (or/c false/c pre-content?) #f]) [#:url url (or/c #f pre-content?) #f])
bib-entry?]{ bib-entry?]{
Creates a bibliography entry. The @racket[key] is used to refer to the 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[] @local-table-of-contents[]
@include-section["how-to.scrbl"] @include-section["how-to.scrbl"]
@include-section["style.scrbl"]
@include-section["manual.scrbl"] @include-section["manual.scrbl"]
@include-section["scheme.scrbl"] @include-section["scheme.scrbl"]
@include-section["eval.scrbl"] @include-section["eval.scrbl"]

View File

@ -12,7 +12,7 @@ file that is included with Scribble.}
@defidform[preprint]{ @defidform[preprint]{
Enables the @tt{preprint} option. Use @racket[preprint] only on the 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]: @racketmodname[scribble/sigplan] and @racket[preprint]:
@verbatim[#:indent 2]|{ @verbatim[#:indent 2]|{
@ -22,15 +22,59 @@ same line as @hash-lang[], with only whitespace between
@defidform[10pt]{ @defidform[10pt]{
Enables the @tt{10pt} option. Use @racket[10pt] only on the 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]: @racketmodname[scribble/sigplan] and @racket[10pt]:
@verbatim[#:indent 2]|{ @verbatim[#:indent 2]|{
#lang scribble/sigplan @10pt #lang scribble/sigplan @10pt
}| }|
The @racket[10pt] and @racket[preprint] options can be @defidform[nocopyright]{
used together and may appear in any order.
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 @(require scribble/manual
scribble/eval scribble/eval
"utils.ss" "utils.ss"
(for-label scribble/manual)) (for-label scribble/manual
scribble/eval))
@title[#:tag "reference-style"]{Style Guide} @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} @section{Prose and Terminology}
In the descriptive body of @racket[defform], @racket[defproc], etc., 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. a definition or might be a definition; use the word ``form,'' instead.
Prefer ``function'' to ``procedure.'' 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 Avoid cut-and-paste for descriptive text. If two functions are
similar, consider documenting them together with similar, consider documenting them together with
@racket[deftogether]. To abstract a description, consider using @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 @racketidfont{symbol}. Similarly, use @racketidfont{expr} or something
that ends @racketidfont{-expr} for an expression position within a that ends @racketidfont{-expr} for an expression position within a
syntactic form. Use @racketidfont{body} for a form (definition or 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, @racketidfont{expr} for something that isn't exactly an expression,
@racket[id] for something that isn't exactly an identifier, etc.; @racket[id] for something that isn't exactly an identifier, etc.;
instead, use @racket[defform/subs] to define a new non-terminal. 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 Use four dots, @litchar{....}, in place of omitted code, since
@litchar{...} means repetition. @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 @; and there's no harm in doing the more logical thing of putting
@; the punctuations outside quotations and parens. Just like you @; the punctuations outside quotations and parens. Just like you
@; did at the end of this sentence... @; 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 at the end of quotation marks (i.e., a sentence-terminating period
goes inside the quotation marks). Of course, this rule does not apply goes inside the quotation marks). Of course, this rule does not apply
for quotation marks that are part of code. 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 instead of @racket[bold]. Optionally add further descriptive text in
the title after a colon, where the text starting with the colon is not the title after a colon, where the text starting with the colon is not
in boldface. 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 #lang at-exp racket/base
(require scribble/manual (require scribble/manual
racket/list
scribble/core scribble/core
scribble/decode scribble/decode
scribble/html-properties scribble/html-properties
@ -16,7 +17,7 @@
(define autobib-style-extras (define autobib-style-extras
(let ([abs (lambda (s) (let ([abs (lambda (s)
(path->main-collects-relative (path->main-collects-relative
(build-path (collection-path "scriblib") s)))]) (collection-file-path s "scriblib")))])
(list (list
(make-css-addition (abs "autobib.css")) (make-css-addition (abs "autobib.css"))
(make-tex-addition (abs "autobib.tex"))))) (make-tex-addition (abs "autobib.tex")))))
@ -46,8 +47,10 @@
(define (add-inline-cite group bib-entries) (define (add-inline-cite group bib-entries)
(for ([i bib-entries]) (hash-set! (bib-group-ht group) i #t)) (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)))) (when (and (pair? (cdr bib-entries))
(error 'citet "citet must be used with identical authors, given ~a" (map auto-bib-author 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 (make-element
#f #f
(list (add-cite group (car bib-entries) 'autobib-author #f) (list (add-cite group (car bib-entries) 'autobib-author #f)
@ -64,34 +67,44 @@
")"))) ")")))
(define (add-cites group bib-entries) (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 (make-element
#f #f
(list 'nbsp (append
"(" (list 'nbsp "(")
(let loop ([keys bib-entries]) (add-between
(if (null? (cdr keys)) (for/list ([(k v) groups])
(make-element (make-element
#f #f
(list (list*
(add-cite group (car keys) 'autobib-author #f) (add-cite group (car v) 'autobib-author #f)
" " " "
(add-cite group (car keys) 'autobib-date #t))) (add-between
(make-element (for/list ([b v]) (add-cite group b 'autobib-date #t))
#f ", "))))
(list (loop (list (car keys))) "; ")
"; " (list ")"))))
(loop (cdr keys))))))
")")))
(define (extract-bib-key b) (define (extract-bib-key b)
(author-element-names (auto-bib-author b))) (author-element-names (auto-bib-author b)))
(define (extract-bib-year b)
(string->number (auto-bib-date b)))
(define (gen-bib tag group) (define (gen-bib tag group)
(let* ([author<? (lambda (a b) (let* ([author/date<?
(string<? (extract-bib-key a) (extract-bib-key b)))] (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) [bibs (sort (hash-map (bib-group-ht group)
(lambda (k v) k)) (lambda (k v) k))
author<?)]) author/date<?)])
(make-part (make-part
#f #f
`((part ,tag)) `((part ,tag))

View File

@ -17,7 +17,8 @@
(define figure-style-extras (define figure-style-extras
(let ([abs (lambda (s) (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")) (list (make-css-addition (abs "figure.css"))
(make-tex-addition (abs "figure.tex"))))) (make-tex-addition (abs "figure.tex")))))

View File

@ -5,6 +5,7 @@
scribble/html-properties scribble/html-properties
scribble/latex-properties scribble/latex-properties
racket/promise racket/promise
setup/main-collects
"private/counter.ss") "private/counter.ss")
(provide note (provide note
@ -12,7 +13,8 @@
(define footnote-style-extras (define footnote-style-extras
(let ([abs (lambda (s) (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")) (list (make-css-addition (abs "footnote.css"))
(make-tex-addition (abs "footnote.tex"))))) (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.} describing a technical report's location.}
@defproc[(dissertation-location [#:institution institution edition any/c] @defproc[(dissertation-location [#:institution institution edition any/c]
[#:number degree any/c "PhD"]) [#:degree degree any/c "PhD"])
element?]{ element?]{
Combines elements to generate an element that is suitable for 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 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. element. The @scheme[pre-flow] is decoded as a flow.
For HTML output, the @scheme[figure*] and @scheme[figure*] functions For HTML output, the @scheme[figure*] and @scheme[figure*] functions

View File

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