Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

An XBlock for adding code highlighting via the PrismJS library.

License

Notifications You must be signed in to change notification settings

correlation-one/xblock-prismjs

 
 

Repository files navigation

xblock-prismjs

XBlock for Syntax Highlighting with Prism.js

LMS Final Output Examples:

  • Javascript in Light theme Screenshot

  • Python in Dark theme Screenshot

Installation

This XBlock was tested & designed to work with Juniper release.

git clone [email protected]:appsembler/xblock-prismjs.git

Features

  • 2 themes for Syntax Highlighting via PrismJS:
    • Light (Default)
    • Dark (Tomorrow Night)
  • Supported Languages:
    • Bash
    • C-like, CSS
    • Go
    • Java, Javascript, JSON
    • Lua
    • Markup
    • Python
    • Ruby
    • Shell, SQL
    • YAML

Usage

Step 1: From Studio, add "prism" in the "Advanced Module List"

Screenshot

Step 2: Add "Syntax Highlighter" from your unit

Prism XBlock will display as "Syntax Highlighter" Gif

Step 3: Customize your code block

Edit the code, set a maximum height, select a language, select a theme Gif

Step 4: Publish

When you're happy with the changes, click the Publish button then View Live Version to view the changes in LMS Screenshot

About

An XBlock for adding code highlighting via the PrismJS library.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 93.8%
  • CSS 3.4%
  • Python 2.1%
  • HTML 0.7%