mikupad icon indicating copy to clipboard operation
mikupad copied to clipboard

[Feature request] Custom regex rule-based text styling

Open BugReporterZ opened this issue 10 months ago • 1 comments

It can be incredibly helpful for readability, especially in those circumstances where Mikupad is used to hand-craft data for training or in-context learning (which most often needs to be formatted in a specific or at least in a consistent way) to have some form of syntax highlighting, in a way similar to what SillyTavern does for dialogue and actions. However, given the free-form nature of text completion, it would be useful if customizable rules could be used instead of fixed ones.

To make UI implementation simpler, every Mikupad theme could come bundled a number of predefined "style classes" (designed to work properly with the theme and affecting things like back/foreground color, bold/italic/underline or even size, etc), and the custom regex matches could then be associated with them.

As a demonstration of the general idea, below is an example of a short chat-like formatted text with various portions styled for easy recognition. The styled example is from a text editor with syntax highlighting (+ additional image editing).

image

BugReporterZ avatar Apr 05 '24 14:04 BugReporterZ