plugin:syntaxhighlightjs
Table of Contents
SyntaxHighlightJS Plugin
Compatible with DokuWiki
2014-09-29 2015-08-10
This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.
Similar to syntaxhighlighter3
This plugin gives you the ability to highlight the code(using Highlight.JS Plugin) inside containers (pre > code) with following options:
- a programming language
- a width
- a certain class (with loads of useful preset classes, ex. center, round)
Installation
Search and install the plugin using the Extension Manager. Refer to Plugins on how to install plugins manually.
Syntax
Basic Syntax:
<sxh language width classes> source code </sxh>
Examples
A simple usage:
<sxh python> from sys import exit def main(): sys.exit(0) if __name__ == '__main__': main() </sxh>
Some more complex usage
<sxh js 70%> var gulp = require('gulp'); gulp.task('default', function() { // place code for your default task here }); </sxh>
<sxh cs 60% center> Private newPropertyValue As String Public Property NewProperty() As String Get Return newPropertyValue End Get Set(ByVal value As String) newPropertyValue = value End Set End Property </sxh>
<sxh cpp round> #if 0 #include "pch.h" // or whatever line you had selected #endif // 0 </sxh>
- Screenshot
Configuration and Settings
Option | Description | Default value |
---|---|---|
syntax | Which name to use for syntax | sxh |
theme | theme for styling your code | default |
restrictedClasses | restrict usage of plugin to these (comma separated) classes | (empty) |
Development
Change Log
- 2015-12-27
- Initial release
Known Bugs and Issues
- Please use an issue board on GitHub project page.
ToDo/Wish List
- Support line-number
- Support in the editing toolbar
FAQ
- Not yet
Credits
- The code reuses parts of the wrap plugin by Anika Henke.
- Thanks to all contributors.
Discussion
Before reporting any issues (bugs or requests), please first take a look at the FAQ on plugin problems.
You can report any issues either on the Issue Tracker or on the separate discussion page.
plugin/syntaxhighlightjs.txt · Last modified: by Klap-in