From e8ce285e5ae2d5a79193d536a9b8650e15d4be11 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Wed, 2 Feb 2011 16:09:21 -0700 Subject: [PATCH 1/5] fix typo original commit: d704f9565b8db7cf456dac84c025b188425c06c9 --- collects/scribblings/scribble/manual.scrbl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/collects/scribblings/scribble/manual.scrbl b/collects/scribblings/scribble/manual.scrbl index cdf1288b..c3baaea8 100644 --- a/collects/scribblings/scribble/manual.scrbl +++ b/collects/scribblings/scribble/manual.scrbl @@ -208,7 +208,7 @@ without insetting the code.} @defform[(RACKETRESULTBLOCK0 datum ...)] )]{ -Like @racketblock[racketblock], etc., but colors the typeset text as a +Like @racket[racketblock], etc., but colors the typeset text as a result (i.e., a single color with no hyperlinks) instead of code.} @deftogether[( From c41c11a64b4038f7bb211ba44653f49fb01c4d13 Mon Sep 17 00:00:00 2001 From: Sam Tobin-Hochstadt Date: Mon, 31 Jan 2011 10:44:59 -0500 Subject: [PATCH 2/5] codeblock: fix language regexp to accept numbers in #lang original commit: 6099806a7209d0d9e4ba85412dac0e13d8910111 --- collects/scribble/private/manual-code.rkt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/collects/scribble/private/manual-code.rkt b/collects/scribble/private/manual-code.rkt index 1ad662ad..6c083517 100644 --- a/collects/scribble/private/manual-code.rkt +++ b/collects/scribble/private/manual-code.rkt @@ -121,7 +121,7 @@ [else null]))] [has-hash-lang? (regexp-match? #rx"^#lang " bstr)] [language (if has-hash-lang? - (let ([m (regexp-match #rx"^#lang ([-a-zA-Z/._+]+)" bstr)]) + (let ([m (regexp-match #rx"^#lang ([-0-9a-zA-Z/._+]+)" bstr)]) (if m (link-mod #:orig? #t From 55de128d836bf4fcf29d3085fe18e6e7828a7fbb Mon Sep 17 00:00:00 2001 From: David Van Horn Date: Fri, 4 Feb 2011 16:46:32 -0500 Subject: [PATCH 3/5] Fixes more spelling errors. original commit: 760a58b65df2b91010d2bcc2739ddab2a4489729 --- collects/scribblings/scribble/srcdoc.scrbl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/collects/scribblings/scribble/srcdoc.scrbl b/collects/scribblings/scribble/srcdoc.scrbl index a5048c36..5968c39d 100644 --- a/collects/scribblings/scribble/srcdoc.scrbl +++ b/collects/scribblings/scribble/srcdoc.scrbl @@ -9,7 +9,7 @@ The @racketmodname[scribble/srcdoc] and @racketmodname[scribble/extract] libraries support writing -documentation withing the documentation code along with an export +documentation within the documentation code along with an export contract, similar to using @as-index{JavaDoc}. With this approach, a single contract specification is used both for the run-time contract and the documentation of an exported binding. From 8ce5125d6c1d3cdb013f6efd2c4432a679d3f08d Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Mon, 14 Feb 2011 07:12:14 -0700 Subject: [PATCH 4/5] Scribble: fix multi-line print output Closes PR 11735 original commit: 1a5f41fd712384b409c760d15961af7b83e000ff --- collects/scribble/eval.rkt | 2 +- collects/tests/scribble/docs.rkt | 35 +++++++++++++++++++ .../tests/scribble/docs/print-lines.scrbl | 21 +++++++++++ collects/tests/scribble/docs/print-lines.txt | 18 ++++++++++ 4 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 collects/tests/scribble/docs.rkt create mode 100644 collects/tests/scribble/docs/print-lines.scrbl create mode 100644 collects/tests/scribble/docs/print-lines.txt diff --git a/collects/scribble/eval.rkt b/collects/scribble/eval.rkt index 4d6da7a2..de9e834d 100644 --- a/collects/scribble/eval.rkt +++ b/collects/scribble/eval.rkt @@ -113,7 +113,7 @@ #f (map (lambda (l) (list (make-flow (list l)))) - flow-accum))))))))] + (reverse flow-accum)))))))))] [(equal? #\newline v) (loop #f #f (add-line (add-string string-accum line-accum) flow-accum))] diff --git a/collects/tests/scribble/docs.rkt b/collects/tests/scribble/docs.rkt new file mode 100644 index 00000000..86ca59b5 --- /dev/null +++ b/collects/tests/scribble/docs.rkt @@ -0,0 +1,35 @@ +#lang racket/base + +;; Use text renderer to check some Scribble functionality + +;; ---------------------------------------- + +(require scribble/base-render + racket/file + racket/class + (prefix-in text: scribble/text-render)) + +(define (build-text-doc src-file dest-file) + (define dir (find-system-path 'temp-dir)) + (let ([renderer (new (text:render-mixin render%) + [dest-dir dir])]) + (let* ([docs (list (dynamic-require `(file ,src-file) 'doc))] + [fns (list (build-path dir dest-file))] + [fp (send renderer traverse docs fns)] + [info (send renderer collect docs fns fp)]) + (let ([r-info (send renderer resolve docs fns info)]) + (send renderer render docs fns r-info))))) + +(define (check-text-build name) + (define src-file (string-append "docs/" name ".scrbl")) + (define expect-file (string-append "docs/" name ".txt")) + (build-text-doc src-file "gen.txt") + (unless (string=? (file->string expect-file) + (file->string (build-path (find-system-path 'temp-dir) + "gen.txt"))) + (error 'check-text-build "mismatch from: ~e expected: ~e" + src-file expect-file))) + +;; ---------------------------------------- + +(check-text-build "print-lines") diff --git a/collects/tests/scribble/docs/print-lines.scrbl b/collects/tests/scribble/docs/print-lines.scrbl new file mode 100644 index 00000000..20f4fc99 --- /dev/null +++ b/collects/tests/scribble/docs/print-lines.scrbl @@ -0,0 +1,21 @@ +#lang scribble/manual + +@(require scribble/eval) + +@title{Pretty-Print-Handler Bug Example} + +@(define the-eval (make-base-eval)) +@(interaction-eval + #:eval the-eval + (begin + (require racket/pretty) + (current-print pretty-print-handler))) + +@examples[#:eval the-eval +'((x "positional 1") + (rest ("positional 2" "positional 3")) + (a ()) + (b ("b-arg")) + (c (("first c1" "second c1") ("first c2" "second c2"))) + (d #f) + (e ()))] diff --git a/collects/tests/scribble/docs/print-lines.txt b/collects/tests/scribble/docs/print-lines.txt new file mode 100644 index 00000000..707a419e --- /dev/null +++ b/collects/tests/scribble/docs/print-lines.txt @@ -0,0 +1,18 @@ + +Pretty-Print-Handler Bug Example + +Example: + > '((x "positional 1") + (rest ("positional 2" "positional 3")) + (a ()) + (b ("b-arg")) + (c (("first c1" "second c1") ("first c2" "second c2"))) + (d #f) + (e ())) + '((x "positional 1") + (rest ("positional 2" "positional 3")) + (a ()) + (b ("b-arg")) + (c (("first c1" "second c1") ("first c2" "second c2"))) + (d #f) + (e ())) \ No newline at end of file From 1c13277c98798aba14267c202db070de8725ed86 Mon Sep 17 00:00:00 2001 From: Kevin Tew Date: Wed, 16 Feb 2011 09:26:17 -0700 Subject: [PATCH 5/5] [Scribble] Fix width of multicolumn table cells original commit: f7d89009a42559e65fcabc93e68d083d0527962d --- collects/scribble/latex-render.rkt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/collects/scribble/latex-render.rkt b/collects/scribble/latex-render.rkt index f88f3042..81a7cc32 100644 --- a/collects/scribble/latex-render.rkt +++ b/collects/scribble/latex-render.rkt @@ -468,7 +468,7 @@ (loop (cdr flows) (add1 n))] [else n]))]) (unless (= cnt 1) (printf "\\multicolumn{~a}{l}{" cnt)) - (render-table-cell (car flows) part ri twidth (car cell-styles)) + (render-table-cell (car flows) part ri (/ twidth cnt) (car cell-styles)) (unless (= cnt 1) (printf "}")) (unless (null? (list-tail flows cnt)) (printf " &\n")))) (unless (null? (cdr flows)) (loop (cdr flows)