Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pristap/smart-text
Parsing #hashtags & @mentions from plain text.
https://github.com/pristap/smart-text
elm elm-lang parsing-combinators
Last synced: 26 days ago
JSON representation
Parsing #hashtags & @mentions from plain text.
- Host: GitHub
- URL: https://github.com/pristap/smart-text
- Owner: pristap
- License: bsd-3-clause
- Created: 2017-12-13T14:29:43.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-02T17:48:15.000Z (almost 7 years ago)
- Last Synced: 2024-10-21T18:46:39.691Z (2 months ago)
- Topics: elm, elm-lang, parsing-combinators
- Language: Elm
- Size: 58.6 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Summary
SmartText is an Elm library for parsing hashtags & mentions from plain text input.
## Usage
SmartText is simple to use, it has only 1 function exposed - `parse` which does all the job.
It takes plain text & returns a list of `Element`s divided as plain text, mentions & hashtags for You to further appropriately display it.> tweet = SmartText.parse "Sample #smart_text 👨🏻💻 with ❤️ by @kexoth."
[Text "Sample ",HashTag "#smart_text",Text " 👨🏻💻 with ❤️ by ",Mention "@kexoth",Text "."]
: List SmartText.ElementThere is also a sample program in `examples/` to try it out.