Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/itemconsulting/xp-highlight
Code highlighting macro for Enonic XP
https://github.com/itemconsulting/xp-highlight
Last synced: about 2 months ago
JSON representation
Code highlighting macro for Enonic XP
- Host: GitHub
- URL: https://github.com/itemconsulting/xp-highlight
- Owner: ItemConsulting
- License: bsd-3-clause
- Created: 2019-09-26T11:08:36.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-02-16T23:56:48.000Z (almost 2 years ago)
- Last Synced: 2023-02-28T10:01:38.956Z (almost 2 years ago)
- Language: JavaScript
- Size: 199 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Code Highlighting Macro for Enonic XPs HTML Editor
[![](https://jitpack.io/v/no.item/xp-highlight.svg)](https://jitpack.io/#no.item/xp-highlight)
## 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](https://github.com/highlightjs/highlight.js/tree/master/src/styles) (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 written between `[highlight]` and `[/highlight]`:
```html
[highlight language="javascript"]
function demo() {
return "This is a demo";
}
[/highlight]
```
6. The resulting web page will have box containing a highlighted code:
![Resulting code on webpage](./docs/demo.png)## Deploying
### Building
To build he project run the following code
```bash
./gradlew build
```### Deploy locally
Deploy locally for testing purposes:
```bash
./gradlew publishToMavenLocal
```## Deploy to Jitpack
Go to the [Jitpack page for xp-highlight](https://jitpack.io/#no.item/xp-highlight) to deploy from Github.