Description
smart_truncate is a simple Rails gem that truncates text like a human. Ever wanted to truncate some text till the Ntn character only to find a word or sentence was cut in half? SmartTruncate fixes that."
SmartTruncate alternatives and similar gems
Based on the "Misc" category.
Alternatively, view SmartTruncate alternatives based on common mentions on social networks and blogs.
-
Gollum
A simple, Git-powered wiki with a sweet API and local frontend. -
Guard
Guard is a command line tool to easily handle events on file system modifications. -
Betty
Friendly English-like interface for your command line. Don't remember a command? Ask Betty. -
auto_html
Collection of filters that transform plain text into HTML code. -
DeepPluck
Allow you to pluck attributes from nested associations without loading a bunch of records. -
Clipboard
Ruby access to the clipboard on Windows, Linux, macOS, Java, Cygwin, and WSL 📋︎ -
Ruby Operators
Webpage to show interesting names of different Ruby operators. -
PluggableJs
Page-specific javascript for Rails applications with the ability of passing data.
Collect and Analyze Billions of Data Points in Real Time
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of SmartTruncate or a related project?
README
SmartTruncate
smart_truncate is a simple Rails gem that truncates text like a human. Ever wanted to truncate some text till the Ntn character only to find a word or sentence was cut in half? SmartTruncate fixes that."
INSTALL
gem install smart_truncate
BASIC smart_truncate USE
# truncate by characters and it will end in a meaningful word
SmartTruncate.by_chars("I am a nice sentance… Previous sentence is not with a proper multicolon ending.",26,'!')
# => "I am a nice sentance… Previous!"
# truncate by sentence
SmartTruncate.by_sentences("I am a nice sentance ... Previous sentence is not with a proper multicolon ending.",1)
# => "I am a nice sentance ..."
# truncate mixed by both sentence and characters/words
SmartTruncate.by_mixed("I am a nice sentance. Previous sentence is with a proper multicolon ending.",2,10)
# => "I am a nice."
SmartTruncate.by_mixed("I am a nice sentance. Previous sentence is with a proper multicolon ending.",1,100)
# => "I am a nice sentance."
LICENSE
This project uses MIT-LICENSE.
*Note that all licence references and agreements mentioned in the SmartTruncate README section above
are relevant to that project's source code only.