CuBoulder/code_syntax_highlighting_bundle

Name: code_syntax_highlighting_bundle

Owner: University of Colorado Boulder

Description: Adds a shortcode for using HighlightJS in the WYSIWYG editor.

Created: 2018-05-18 20:31:24.0

Updated: 2018-05-18 20:48:34.0

Pushed: 2018-05-18 20:48:33.0

Homepage: null

Size: 102

Language: CSS

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

code_syntax_highlighting_bundle

Adds a shortcode for using HighlightJS in the WYSIWYG editor.

How To Use

Enable the bundle like any Drupal module. When you edit a node using the WYSIWYG text filter, you'll see button with brackets that allows you to enter code syntax.

screen shot 2018-05-18 at 2 38 01 pm

Once the dialog window is open, you can choose the language and insert the code syntax.

screen shot 2018-05-18 at 2 43 26 pm

Then you will see a shortcode [code lang="php"]$foo = "bar";[/code] inserted into the body field with line breaks and indentation preserved.

screen shot 2018-05-18 at 2 43 58 pm

Once saved, the code is rendered with syntax highlighting. You can change the theme by setting a variable, drush vset csh_theme sunburst, and the themes are located at https://highlightjs.org/static/demo/.

screen shot 2018-05-18 at 2 44 25 pm


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.