Skip to content

ItemConsulting/xp-highlight

Repository files navigation

Code Highlighting Macro for Enonic XP

Icon

Usage

Installation

  1. Install the application through the Applications-app in Enonic XP 7.x.
  2. Add the "Code Highlighting Macro"-application to your site.
  3. You can optionally configure which code highlighting style you want to use in the site config. It should be the name of one of the included css-files in highlight.js (e.g github.css).

Usage in Content Studio:

  1. Enter an HTML-editor in Content Studio
  2. Select Insert Macro on the toolbar
  3. Select Code Highlighting, and pick a language.
  4. Your code will now contain the following macro: [highlight language="javascript"/]
  5. Code now can be inserted between [highlight] and [/highlight]:
    [highlight language="javascript"]
    <pre>
    function demo() {
     return "This is a demo";
    }
    </pre>
    [/highlight]
  6. The resulting web page will have box containing a highlighted code: Resulting code on webpage

Deploying

Building

To build the project, run the following command

enonic project build

You will find the jar-file at ./build/libs/item.jar

Deploying locally

To deploy to a local sandbox, run the following command

enonic project deploy

Deploy to Maven

./gradlew publish -P com.enonic.xp.app.production=true

About

Code highlighting macro for Enonic XP

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •