Hi!
I just tagged StringManipulation.jl v0.2.0 and TerminalPager.jl v0.3.0
StringManipulaion.jl
I realized that some packages that I built were having a lot of duplicated code related to string processing with decorations (escape sequences). For example, in TerminalPager.jl, I need to compute the printable size of a string to check where I can break it to fit the screen. I also need to track the decoration to make it look consistent when the lines are drawn in the screen. All of this should consider UTF-8 characters that can have width higher than 1.
All this duplicated code is now inside StringManipulation.jl. The good side (besides not having to maintain the same thing over and over again) is that I could test almost everything related to string manipulations
This package has some nice features that can be helpful in some context, like highlighting search matches for example:
julia> using StringManipulation
julia> str = """
# In sed validum spumis una quam habet
## Cum ignes tibi
Lorem markdownum [sine](http://huichonesta.net/positamquetransire)! Infans
Sipylumque: venit sui *in* ambiguum petunt regnabat Cerealia quercus! Iussae sic
superas **relinquunt tinguit iustis** quae, **spes iterum precando**. Qua acuta,
vitiataque albas hastilibus Etruscam, ex classe furorem eheu et
[menti](http://www.thermodontiacoaltius.org/) adspexit humilesque similemque
nomen. Ut *vero velant ad* tibi receptae classis manantem laceri iterum, litore.
## Sunt est obsedit virgo
Saepe obvia gentis, pervia Medea genetrix mori currum pyra viri, formosior
quidem Viderat! Quas Alcimedon exuit! Domos biformis virginitas secundum Et
dictis ad annos coniecit: suci uteri, de.
> Satus cur imbris, tum in bracchia digiti *populusque luctante nam* materiam
> spectare: oppidaque potiunda gravidi genitore raptas. Dryantaque **vertere
> metuo**.
""";
julia> highlight_search(str, r"qu") |> println
TerminalPager.jl
The new version of TerminalPager contains a lot of improvements. First, it now uses StringManipulation instead of the custom rendering engine. We have now a much more cleaner codebase that hopefully will help people to contribute with the project
I also modified many things increasing the performance. Some runtime dispatches were fixed thanks to two AMAZING tools: SnoopCompile.jl and JET.jl.
However, we have breaking changes… sorry about that If you use the pager without modifications, everything is fine. However, if you customize keybindings and use some internal options, you will need to adapt the code.
Next steps
The next step will be apply the experience I got and adapt PrettyTables.jl to use StringManipulation.jl. After that, I will perform the same analysis using SnoopCompile and JET trying to improve its performance. In parallel, I am working to finish the HTML and LaTeX backend of PrettyTables.jl so that it can be used by default by DataFrames (sorry @bkamins , I had more problems than I though I would had , but I am working on it).