Home

Awesome

Code Syntax Highlight

An extension for oobabooga's text-generation-webui to highlight code snippets

[!NOTE] Versions of text-generation-webui released after the 26th of April 2024 support syntax highlighting of code snippets by default without needing this extension

code_syntax_highlight_extension-oobabooga-text-generation-webui

Features

<br>

Installation

The extension can be installed by cloning this repository inside the ../text-generation-webui/extensions folder:

cd text-generation-webui/extensions
git clone https://github.com/DavG25/text-generation-webui-code_syntax_highlight code_syntax_highlight

It's also possible to install the extension by directly downloading the latest version from the releases page and extracting the ZIP archive inside the ../text-generation-webui/extensions folder

<br>

Updates

To check for updates, simply compare the currently installed extension version in the web UI with the latest available version in the releases page

If the available version is higher than the installed one, run the following command:

cd text-generation-webui/extensions
git pull

If the extension was installed by downloading the ZIP archive, delete the currently installed version in the ../text-generation-webui/extensions folder and extract the new version ZIP archive in the same location

<br>

Configuration and persistent settings

The extension can be enabled directly in the Interface mode tab inside the web UI once installed

To automatically load the extension when starting the web UI, either specify it in the --extensions command-line flag or add it in the settings.yaml file in the ../text-generation-webui folder:

default_extensions: 
- code_syntax_highlight
<br>

For settings to persist over web UI restarts and reloads, add the following lines to the settings.yaml file:

code_syntax_highlight-activate: true
code_syntax_highlight-inline_highlight: false
code_syntax_highlight-copy_button: false
code_syntax_highlight-performance_mode: true

Change the values (true / false) according to the preferred settings