Skip to content
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

Add interactive word-wrapping demo #218

Merged
merged 1 commit into from
Nov 1, 2020
Merged

Add interactive word-wrapping demo #218

merged 1 commit into from
Nov 1, 2020

Conversation

mgeisler
Copy link
Owner

@mgeisler mgeisler commented Nov 1, 2020

The goal of the demo is to let you to play with the word-wrapping options in a very simple text editor. You can change the wrapping width, you can toggle break_words and you can change the WordSplitter used.

Clone the textwrap repository and use

cargo run --example interactive

to run the demo. It only work on Unix systems right now, but please let me know if you want to help port it to Windows.

@mgeisler mgeisler force-pushed the interactive-demo branch 3 times, most recently from 37466b4 to 4ddf181 Compare November 1, 2020 09:41
The goal of the demo is to let you to play with the word-wrapping
options in a very simple text editor. You can change the wrapping
width, you can toggle `break_words` and you can change the
`WordSplitter` used.

Clone the `textwrap` repository and use

    cargo run --example interactive

to run the demo. It only work on Unix systems right now, but please
let me know if you want to help port it to Windows.
@mgeisler mgeisler merged commit fe5b491 into master Nov 1, 2020
Cryptjar added a commit to Cryptjar/textwrap that referenced this pull request Nov 1, 2020
This commit back-ports the interactive demo from mgeisler#218 to v0.12.
Additionally, it adds `splitter` method, that clones `&self` and replaces
the splitter with the given one. This made it conforming to become a
`const fn`, allowing `Wrapper::new(w).splitter(s)` idiom in const & static
context, as well as allowing to port the interactive demo.
@mgeisler mgeisler deleted the interactive-demo branch January 30, 2021 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant