Coder Social home page Coder Social logo

d-groenewegen / highlightjs_integration Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nicolas01/highlightjs_integration

0.0 0.0 0.0 304 KB

A MediaWiki extension to use the client-side syntax highlighter highlight.js

License: GNU Affero General Public License v3.0

JavaScript 27.20% PHP 64.31% CSS 8.49%

highlightjs_integration's Introduction

This extension allows source code to be syntax highlighted on the wiki pages.
This README file might be out of date, have a look at the extension page
for updated informations:

    https://www.mediawiki.org/wiki/Extension:Highlightjs_Integration

== Requirements ==

This version of the extension has been tested with highlight.js 11.5.1 and
MediaWiki 1.35.6.

== Installation ==

Add this line to your LocalSettings.php:

    wfLoadExtension( 'Highlightjs_Integration' );

This extension will use a bundled copy of highlight.js 11.5.1 with the common 
languages.
If you would like to use a different copy of the library, you can download it
on the highlight.js website and replace the
'extensions/MediaWiki/HighlightJS/highlight' folder.

=== Bug Uncaught SyntaxError: unterminated regular expression literal ===

The load of the highlight.min.js script in this extension raises a syntax 
error.
As a workaround, the highlight.min.js script is loaded from the CDNJS url 
instead of the file provided with this extension.

== Usage ==

On the wiki page, you can use "syntaxhighlight" or "source" elements:

<syntaxhighlight>
<?php
// some php code
</syntaxhighlight>

== Parameters ==

* lang;     Defines the language.
* inline;   The source code should be inline as part of a paragraph.

<syntaxhighlight lang="php">
<?php
// some php code
</syntaxhighlight>

<syntaxhighlight lang="cs" inline>var c = new Class();</syntaxhighlight>

highlightjs_integration's People

Contributors

nicolas01 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.