automatic icon indicating copy to clipboard operation
automatic copied to clipboard

[Feature]: prompt syntax highlighting

Open acorderob opened this issue 2 years ago • 5 comments

Feature description

A syntax highlighter for the prompt fields (and where prompt is displayed) would be great. I know this is probably not easy due to gradio and the additional syntax added by extensions (some kind of pluggable syntax so the extensions can add their specifics would be even greater).

Version Platform Description

No response

acorderob avatar May 15 '23 11:05 acorderob

can you describe this in a bit more detail - what would highlighter actually do?

vladmandic avatar May 15 '23 11:05 vladmandic

Colorize the parentheses, colon, and weight in (blue:1.5), or the brackets and colons in [blue:red], or the additional network format <lora:xxxx:1>, or the wildcard like __colors__. Any syntax that is not just regular tokens.

acorderob avatar May 15 '23 11:05 acorderob

I have been looking for the right javascript library and i might tackle this myself in an extension, but I'm not sure i will be able to succeed, so i decided to create the issue just in case.

acorderob avatar May 15 '23 11:05 acorderob

that's fair - if you manage to get something working, let me know. and its ok to have a feature request open to track it.

vladmandic avatar May 15 '23 11:05 vladmandic

I'd like to have this, too.

It should also highlight BREAK.

{}()[]:<float>|,.

I know that , totally gets ignored by parsers, but it's a visual separator for the user and should be highlighted.

Tillerz avatar Mar 22 '25 13:03 Tillerz