8000 GitHub - apiaryio/prism: Lightweight, robust, elegant syntax highlighting. A spin-off project from Dabblet.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Nov 8, 2024. It is now read-only.
/ prism Public archive
forked from PrismJS/prism

Lightweight, robust, elegant syntax highlighting. A spin-off project from Dabblet.

License

Notifications You must be signed in to change notification settings

apiaryio/prism

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prism

Build Status

Apiary's fork of Prism.

Prism is a lightweight, robust, elegant syntax highlighting library. It's a 6B0C spin-off project from Dabblet.

Differences

  • Tests
  • AMD support (RequireJS)
  • Optional encoding (_.util.encode)
  • Parallelism with Web Workers (if available)
  • No automatic highlighting, you have to use the highlight method
  • Low-level API (tokenize, Token, ...)

API

require([
  'languages/clike',
  'languages/bash',
  'languages/javascript'
  'prism'
], function(
  cLikeGrammar
  bashGrammar
  javaScriptGrammar
  prism
) {
  // Add the languages to Prism.
  cLikeGrammar(prism);
  bashGrammar(prism);
  javaScriptGrammar(prism);

  // Highlight the code.
  prism.highlight('alert("Hello!");', prism.languages.javascript)
});

highlight(code, grammar, options)

Tests

npm test

About

Lightweight, robust, elegant syntax highlighting. A spin-off project from Dabblet.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%
0