All Projects β†’ speed-highlight β†’ core

speed-highlight / core

Licence: CC0-1.0 License
🌈 light, fast, and easy to use, dependencies free javascript syntax highlighter, with automatic language detection

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects
shell
77523 projects

Projects that are alternatives of or similar to core

Server Manager
This repository holds the IntISP Interface. It can be rebuilt to interface with any other hosting panel.
Stars: ✭ 31 (-22.5%)
Mutual labels:  fast, simple, small
KodeEditor
A simple code editor with syntax highlighting and pinch to zoom
Stars: ✭ 60 (+50%)
Mutual labels:  syntax-highlighting, highlighter, highlighting
Wondercms
WonderCMS - fast and small flat file CMS (5 files)
Stars: ✭ 330 (+725%)
Mutual labels:  fast, simple, small
kirby-highlight
Themeable server-side syntax highlighting for Kirby
Stars: ✭ 14 (-65%)
Mutual labels:  syntax-highlighting, highlighting, highlightjs
node-perj
A fast, flexible JSON logger.
Stars: ✭ 16 (-60%)
Mutual labels:  fast, simple
KeyLighter
Yet another syntax highlighter for PHP
Stars: ✭ 29 (-27.5%)
Mutual labels:  syntax-highlighting, highlighter
koa-better-router
❀️ Stable and lovely router for `koa`, using `path-match`. Foundation for building powerful, flexible and RESTful APIs easily.
Stars: ✭ 88 (+120%)
Mutual labels:  fast, small
core
πŸš€Fast, πŸ’ŽLightweight Angular alternative with the same modern API thats compile directly to WebComponents
Stars: ✭ 49 (+22.5%)
Mutual labels:  fast, small
pixie
Tiny template functions.
Stars: ✭ 14 (-65%)
Mutual labels:  fast, small
logquacious
Logquacious (lq) is a fast and simple log viewer.
Stars: ✭ 55 (+37.5%)
Mutual labels:  fast, simple
greptile
Fast grep implementation in python, with recursive search and replace
Stars: ✭ 17 (-57.5%)
Mutual labels:  fast, regex
ByteCopy
Simple C99 program and API for copying files.
Stars: ✭ 16 (-60%)
Mutual labels:  fast, simple
base64.c
Base64 Library in C
Stars: ✭ 60 (+50%)
Mutual labels:  fast, simple
CodeView
Android Library to make it easy to create an Code editor or IDE that support any languages and themes, with auto complete, auto indenting, snippets and more features
Stars: ✭ 254 (+535%)
Mutual labels:  syntax-highlighting, highlighting
QArchive
Async C++ Cross-Platform library that modernizes libarchive using Qt5 πŸš€. Simply extracts 7z πŸ”, Tarballs 🎱 and other supported formats by libarchive. ❀️
Stars: ✭ 66 (+65%)
Mutual labels:  simple, small
6502-npp-syntax
Notepad++ Syntax Highlighting for 6502 Assembly (and NESASM)
Stars: ✭ 21 (-47.5%)
Mutual labels:  syntax-highlighting, highlighting
wotpp
A small macro language for producing and manipulating strings.
Stars: ✭ 75 (+87.5%)
Mutual labels:  fast, small
splash
🌊 Highlight source code embedded in HTML with a splash of color
Stars: ✭ 19 (-52.5%)
Mutual labels:  syntax-highlighting, highlighting
dowels
πŸ”¨ a tiny but powerful javascript library that performs client-side routing, templating, and REST API communication to help you get your single-page web applications running in seconds
Stars: ✭ 13 (-67.5%)
Mutual labels:  fast, small
smk
SMK - Simple multimedia kit - C++ WebAssembly
Stars: ✭ 89 (+122.5%)
Mutual labels:  fast, simple

Speed-highlight JS

Light, fast, and easy to use, dependencies free javascript syntax highlighter, with automatic language detection, try it out here

Light πŸ“¦

  • The core is about 1kB (gzipped & minified)
  • Languages definition are from a few bytes to 1kB
  • Themes are about 1kB
  • Language rules needed are automatically loaded

Fast ⚑

Blazing fast highlighting using regex

Simple setup πŸš€

Web

Style/theme (in the header of your html file):

<link rel="stylesheet" href="/path/dist/themes/default.css">

In the body of your html file:

<div class='shj-lang-[code-language]'>[code]</div>
or
<code class='shj-lang-[code-language]'>[inline code]</code>

Highlight the code (in your javascript):

import { highlightAll } from '/path/dist/index.js'
highlightAll();

Auto language detection

import { highlightElement } from '../src/index.js';
import { detectLanguage } from '../src/detect.js';

elm.textContent = code;
highlightElement(elm, detectLanguage(code));

CDN

import ... from 'https://unpkg.com/@speed-highlight/core/dist/index.js'
import ... from 'https://cdn.jsdelivr.net/gh/speed-highlight/core/dist/index.js'

Deno

Use the deno module

import { setTheme, printHighlight } from 'https://x.nest.land/speed_highlight_js/dist/term.js';

await setTheme('default');
printHighlight('console.log("hello")', 'js');

Node

Use the npm package

npm i @speed-highlight/core
const { setTheme, printHighlight } = require('@speed-highlight/core/dist/node/term.js');

setTheme('default')
printHighlight('console.log("hello")', 'js');

Languages supported 🌐

Name Class name Support Language detection
bash shj-lang-bash βœ…
brainfuck shj-lang-bf increment, operator, print, comment ❌
css shj-lang-css comment, str, selector, units, function, ... βœ…
csv shj-lang-csv punctuation, ... ❌
diff shj-lang-diff βœ…
git shj-lang-git comment, insert, deleted, string, ... ❌
html shj-lang-html βœ…
http shj-lang-http keywork, string, punctuation, variable, version βœ…
ini shj-lang-ini ❌
javascipt shj-lang-js basic syntax, regex, jsdoc, json, template literals βœ…
jsdoc shj-lang-jsdoc ❌
json shj-lang-json string, number, bool, ... ❌
leanpub-md shj-lang-leanpub-md ❌
log shj-lang-log number, string, comment, errors ❌
lua shj-lang-lua βœ…
makefile shj-lang-make βœ…
markdown shj-lang-md βœ…
perl shj-lang-pl βœ…
plain shj-lang-plain ❌
python shj-lang-py βœ…
regex shj-lang-regex count, set, ... ❌
sql shj-lang-sql number, string, function, ... βœ…
todo shj-lang-todo ❌
toml shj-lang-toml comment, table, string, bool, variable ❌
typescript shj-lang-ts js syntax, ts keyword, types βœ…
uri shj-lang-uri βœ…
yaml shj-lang-yaml comment, numbers, variable, string, bool ❌
docker shj-lang-docker βœ…
c shj-lang-c βœ…
xml shj-lang-xml βœ…
rust shj-lang-rs βœ…
go shj-lang-go βœ…
java shj-lang-java βœ…
asm shj-lang-asm βœ…

Themes 🌈

A modern theme by default

Name Terminal Web
default βœ… βœ…
github-dark ❌ βœ…
github-light ❌ βœ…
github-dim ❌ βœ…
atom-dark ❌ βœ…
visual-studio-dark ❌ βœ…

Wiki πŸ‘€

Further in-depth documentation for the API and other topics is in our Wiki

License πŸ“ƒ

Shj is released under the Creative Commons Zero License. See our LICENSE file for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].