racket / scribble

Other
194 stars 90 forks source link

scribble/text-render: support `(linebreak)` #334

Closed LiberalArtist closed 2 years ago

LiberalArtist commented 2 years ago

Here's an attempt at an implementation, tested so far only on my current draft of https://github.com/racket/racket/pull/4301.

Related to https://github.com/racket/racket/pull/4301 Closes https://github.com/racket/scribble/issues/333

LiberalArtist commented 2 years ago

I've fixed the commit message here (thanks @sorawee!).

mflatt commented 2 years ago

For testing, probably there should be a new document that uses linebreak in scribble/scribble-test/tests/scribble/docs. (Run docs.rkt to run each .scrbl document in docs and compare against the expected output in the corresponding .txt file).

LiberalArtist commented 2 years ago

Thanks, I've added a test.

samth commented 2 years ago

I don't know this code at all, but is the extra complexity all about line-wrapping? And is the character-at-a-time communication this now has going to be a performance issue?

mflatt commented 2 years ago

I don't think this will be a performance issue compared to everything else that goes into running and rendering a document, and I wasn't able to detect a performance change by trying some tests and the build guide.