fgallaire
Is there are text wrapping library for Elixir?
Hello everybody,
I’m new to elixir and I don’t find a text wrapping library, something
like Python textwrap.
Is it missing ? If yes, is there a will to have it ?
Cheers
Most Liked
kokolegorille
Welcome,
The best way to search for a specific lib is to look at hex.pm
For example… with text as search key.
I am not sure this one compares to TextWrap, but it seems to help with text format.
You might also enjoy this read, if You are in the mood of rewriting it, and don’t mind reading some Erlang code.
ferd
Be aware of the big wrapping dangers of Unicode. U+FDFD is a single very wide character: ﷽ in some fonts, and a reasonably large one in others. Ask your library to wrap, and if it has no knowledge of font widths (and you’re not using a monospace font), you’ll end up with lines that are guaranteed to blow everything up.
I would generally maintain healthy skepticism when someone attempts to wrap text without knowing how it is going to be rendered, although the rest of the functionality of the textwrap module in python are quite useful.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance










