Syntax Highlighter

Client side code highlighter. This is ready-to-use Cotonti port of SyntaxHighlighter by Alex Gorbatchev.

Client side code highlighter. This is ready-to-use Cotonti port of SyntaxHighlighter by Alex Gorbatchev.

Authors:

GitHub: https://github.com/Cotonti-Extensions/syntax-highlighter

 

#1. Installation

  • Download the plugin and extract "syntaxhighlighter" folder into your Cotonti plugins folder.
  • Go to Administration / Extensions and install the SyntaxHighlighter plugin.
  • Go to the plugin configuration and select the desired theme and set other options if you need

 

#2. Usage

Usage with HTML parsing: To highlight source code with some specific language, use HTML tags like this:

<pre class="brush:language;">
    Your code here
</pre>

 

The list of available brushes and themes: https://github.com/syntaxhighlighter/syntaxhighlighter/wiki/Brushes-and-Themes

Plugin for CKEditor: https://ckeditor.com/cke4/addon/syntaxhighlight, https://github.com/dbrain/ckeditor-syntaxhighlight

 

#3. Color themes

Plugin bundled with a pack of predefined color themes. But you can adjust some of it to suit you needs with Cotonti theme colors. To do that copy theme CSS file from syntaxhighlighter/lib/ folder to your theme sub folder named stylesthemes/theme-name/styles. File name shoud have prefix syntaxhighlighter-. For example custom theme file full name can be like this: themes/theme-name/styles/syntaxhighlighter-my-awesome-theme.css.
Now you can change it for your needs or create your own. All CSS files located in themes/theme-name/styles folder override default ones with same names.

 

#4. Examples

Default theme:
SyntaxHighlighter

 

Cotonti theme:
SyntaxHighlighter Cotonti theme


1. Kort  2024-04-08 06:12

Вот там есть такой интересный файл override.css, который грузится из папки с плагином. Конечно для своего сайта каждый захочет свои модификации. Может быть сделать настраиваемый путь загрузки этих стилей? Чтобы не перезаписать при обновлении?

Only registered users can post new comments