DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:syntaxhighlightjs

SyntaxHighlightJS Plugin

Compatible with DokuWiki

  • 2017-02-19 "Frusterick Manners" unknown
  • 2016-06-26 "Elenor Of Tsort" unknown
  • 2015-08-10 "Detritus" yes
  • 2014-09-29 "Hrun" yes

plugin Syntax Highlighter for DokuWiki with highlight.js

Last updated on
2015-12-27
Provides
Syntax, Helper, Action
Repository
Source
Conflicts with
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

Download and install the plugin using the Plugin Manager using the URL given above. 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

ToDo/Wish List

  • Support line-number
  • Support in the editing toolbar

FAQ

  • Not yet

Credits

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: 2015-12-31 23:57 by ach