generic Highlighter for Mudlet

edited August 2021 in Mechanic's Corner
I realized I hadn't written a post for my generic highlighter package here yet, and if a stranger releases a package on GitHub and doesn't tell anyone about it, does it make a sound? I think NOT!

NDB (whether through mmf or stand alone) is very good at looking up, categorizing, and highlighting names. And I would never try to replace it for such. But all it highlights is names. And it only works here.

So I made a highlighter package that isn't tied to any game or system. The project is hosted on GitHub and the latest release can always be grabbed from here. 

It comes with aliases as well as Lua API for adding, removing, and adjusting highlighter categories, and adding or removing the highlighter items. It also comes with Lua functions to format a string passed with with your highlights, formatted for cecho, decho, or hecho. The cecho one it will use the closest color in the color table for your highlights, even if you specify them in "<R,G,B>" decimal or "#rrggbb" hex format in your highlighter config. 

The following picture is a raw decho(str) to show the original, then decho(Highlighter:dhighlight(str)) to show highlighting for echo functions, and then dfeedTriggers(str) to show it highlighted by the same process used for data coming in from the game. the Highlighter:c/d/hhighlight functions have some issues with background color bleedthrough if you have a background color configured as part of the highlight, still working on that.


Comments

Sign In or Register to comment.