-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider phrase breaks? #24
Comments
(From @ivanistheone in #13:) I was excited to try this package but it didn't wrap things accoring to semantic -- e.g. on commas and or other logical clauses. Expected:
Observed after reformat + wrap:
specifically I'd expect the |
Current intended behavior is It's possible though that breaking on longer phrases is a good idea, but we'd need simple rules. It might also be harder to explain and get used to. @ivanistheone did you have any thoughts or use cases on why you'd prefer phrase breaks to sentence breaks? This could also be a flag, but that comes at a cost too. |
The high-level reason is that phrases are the smallest coherent unit, so it makes sense to see them each on their own line. Similar to how one paragraph contains one idea, each phrase is one coherent building block used to construct that idea. There are also several pracrical, low-level reasons for the one-phrase-per-line approach:
|
Thanks! Yes, am familiar with most of goals (some more discussion here if you're interested). Your first benefit is interesting, for sure, and perhaps better with phrase breaks than sentence breaks. The 2nd and 3rd are interesting as well, but I'm not sure every editor would share this perception, so I'd hesitate to make it default always. Note the 4th and 5th are mostly already benefits with sentence-per-line-with-wrap-on-overflow, the current behavior. At Holloway, we use Flowmark on large documents with several committers pretty effectively and I've found it's a good, realistic compromise so far that balances semantic editing and stability with keeping the text sane looking. But will leave this open; perhaps this could be a setting in the future, and glad to see if anyone else asks for it! |
This form of semantic break would be useful in formatting markdown documentation. For example, a heuristic that splits-on-semantic-breaks at >%~60 of maximum text width, Eg:
|
As a quick follow-up... the compromise I've played around with it with this test data, https://observablehq.com/d/59be2e7af575c8ad, and it definitely has warts but could be a good start. |
Some seem to desire breaks on phrases like commas or clauses. This might or might not be a good idea, so listing here to track+discuss.
The text was updated successfully, but these errors were encountered: