Advertisement:

Navigation

SMF Mod Site

Mod Name:
Code Highlighting
Created By:
Bugo
Type:
BBC
First Created:
February 01, 2011, 07:55:41 AM
Last Modified:
March 24, 2021, 06:54:18 AM
Latest Version:
1.4.1 (2.0), 0.9 (2.1)
Compatible With:
2.0.18, 2.1 RC3
Total Downloads:
4058

Download this mod

code_highlighting_1.4.1_smf20.zip (147kB) [21]
code_highlighting_0.9_smf21.zip (124kB) [10]
Manual Install Instructions for SMF


Below are some preview images of what the mod looks like when being used

Description:

This script highlights syntax in code examples on your forum.
It is very easy to use because it works automatically: finds blocks of code, detects a language, highlights it.
Supported languages: HTML/XML, Javascript, CSS, PHP, Ruby, Perl, Python, C++, C#, Java, SQL, Bash, etc.


All supported languages and styles

How to use? Very simply!
[code]your code[/code]

Advanced using
[code=language]your code[/code]

Features:

  • You can choose code formatting scheme
  • You can choose font size within code blocks
  • Highlighting works automatically: finds blocks of code, detects a language, highlights it — you don't need to specify any language

Edit this CSS in /Themes/default/css/highlight.css to customize line numbers:
Code: [Select]
.hljs-ln-numbers {
text-align: center;
color: #f36;
border-right: 1px solid #f36;
vertical-align: top;
min-width: 25px;
}

You should install the New Hooks package to properly work the "display line numbers" feature in SMF 2.0

Available translations:
  • English
  • Russian
  • French
  • Spanish