marick
Is there a Hex package similar to Apple's NSAttributedString?
I’d like to be able to attach attributes to ranges within a string. Since I’m writing prototypes/spikes in Elixir for an eventual MacOS app, it’d be nice if the capabilities were similar to NSAttributedString - even better, a process that makes a mutable version of that (equivalent to NSMutableAttributedString). However, anything that saves me the trouble of dealing with all the fiddly cases around maintaining attributes as the underlying string changes is more than fine.
Most Liked
marick
Consider a text editor, which manages a mutable string. Ranges of characters can be assigned particular attributes. Conceptually, every character in the string comes with a key/value map named “attributes”. Some keys are predefined, but apps can define their own custom attributes.
You can ask questions like:
- What attributes does the 34th Unicode character in the string have?
- What’s the largest contiguous Range of characters that all have the same attributes as character 34?
- Is the
:italicattribute set for character 34? - For what range around character 34 is the
:italicattribute set?
I’m writing an app to explore coding in a style inspired by ecological and embodied cognition. Mainly for fun and to keep me off the streets.
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









