Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

sublemon

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

sublemon

syntax hightlight made easy

unpublished
latest
Source
npmnpm
Version
1.1.2
Version published
Maintainers
1
Created
Source

sublemon

#sublemon Build Status

Another syntax highlighter that support mixed language content by default.

usage

with webpack, you can require this module and get

var sublemon = require('sublemon');

var html = sublemon('your code here');

// client side render
document.body.innerHTML = html;

for simpler browser side usage, you can just load dist/sublemon.min.js and theme.css in your browser and

sublemon.init()

this will automagically highlight all code in an element with class name sublemon

why use sublemon ?

  • if you want to highlight mixed language content
  • if you have create your own programming language and have a hard time make other highlight library work for your language
  • you try to highlight your css4 code but found that your highlight library only support css3

when not to use sublemon: If you know you only want to highlight java code, then you want to use more robust solutions like syntax highlight or highlight.js.

screenshot

Since sublemon is a very generic highlighter, things will not look perfect.
You can take a look at screen shots in screenshot directory to decide if you want to use this library. sublemon

install

npm install --save sublemon

inspiration

Microlight : highlights code in any programming language.
This is where I get idea for this project. It's great if you want to have a small foot print.
But I want more an isomorphic solution that can be styled via css.

Acorn : A small, fast, JavaScript-based JavaScript parser.
This is where I get inspiration for my parser.

license

MIT

Keywords

syntax

FAQs

Package last updated on 29 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts