{"size": 2415, "ext": "scrbl", "max_stars_repo_path": "unstable-doc/scribblings/pretty.scrbl", "max_stars_repo_name": "racket/unstable", "max_stars_repo_stars_event_min_datetime": "2018-08-24T22:01:32.000Z", "max_stars_repo_stars_event_max_datetime": "2018-08-24T22:01:32.000Z", "max_issues_repo_path": "unstable-doc/scribblings/pretty.scrbl", "max_issues_repo_name": "racket/unstable", "max_issues_repo_issues_event_min_datetime": "2020-06-25T14:58:07.000Z", "max_issues_repo_issues_event_max_datetime": "2020-06-25T19:01:25.000Z", "max_forks_repo_path": "unstable-doc/scribblings/pretty.scrbl", "max_forks_repo_name": "racket/unstable", "max_forks_repo_forks_event_min_datetime": "2015-01-20T15:40:24.000Z", "max_forks_repo_forks_event_max_datetime": "2018-08-24T22:01:34.000Z"}
{"max_stars_count": 1, "max_issues_count": 2, "max_forks_count": 4, "avg_line_length": 32.2, "max_line_length": 124, "alphanum_fraction": 0.6364389234}
#lang scribble/manual
@(require scribble/eval "utils.rkt" (for-label racket unstable/pretty))

@(define the-eval (make-base-eval))
@(the-eval '(require racket/pretty unstable/pretty))

@title{Pretty-Printing}
@deprecated[@racketmodname[racket/pretty]]{}

@defmodule[unstable/pretty]

This module provides tools for pretty-printing.

@defproc[(pretty-format/write [x any/c]
                              [columns
                               (or/c exact-nonnegative-integer? 'infinity)
                               (pretty-print-columns)])
         string?]{

This procedure behaves like @racket[pretty-format], but it formats values
consistently with @racket[write] instead of @racket[print].

@examples[#:eval the-eval
(struct both [a b] #:transparent)
(pretty-format/write (list (both (list 'a 'b) (list "a" "b"))))
]

}

@defproc[(pretty-format/display [x any/c]
                                [columns
                                 (or/c exact-nonnegative-integer? 'infinity)
                                 (pretty-print-columns)])
         string?]{

This procedure behaves like @racket[pretty-format], but it formats values
consistently with @racket[display] instead of @racket[print].

@examples[#:eval the-eval
(struct both [a b] #:transparent)
(pretty-format/display (list (both (list 'a 'b) (list "a" "b"))))
]

}

@defproc[(pretty-format/print [x any/c]
                              [columns
                               (or/c exact-nonnegative-integer? 'infinity)
                               (pretty-print-columns)])
         string?]{

This procedure behaves the same as @racket[pretty-format], but is named
more explicitly to describe how it formats values.  It is included for
symmetry with @racket[pretty-format/write] and @racket[pretty-format/display].

@examples[#:eval the-eval
(struct both [a b] #:transparent)
(pretty-format/print (list (both (list 'a 'b) (list "a" "b"))))
]

}

@addition{@author+email["Vincent St-Amour" "stamourv@racket-lang.org"]}
@defproc[(break-lines [s string?] [columns exact-nonnegative-integer? (pretty-print-columns)])
         string?]{
Splits the string @racket[s] into multiple lines, each of width at most
@racket[columns], splitting only at whitespace boundaries.
@examples[#:eval the-eval
(display (break-lines "This string is more than 80 characters long. It is 98 characters long, nothing more, nothing less."))
]
}


@(close-eval the-eval)
