Lightweight, robust, elegant syntax highlighting.
Go to file
Michael Schmidt f5458431a0
ESLint: Allow `Map` and `Set` in ES5 code (#3328)
2022-02-10 12:32:49 +01:00
.github Added regex coverage (#3138) 2021-10-19 19:34:41 +02:00
assets Website: Improved readability (#3177) 2021-11-08 12:52:43 +01:00
benchmark Added benchmark suite (#2153) 2021-08-16 20:08:13 +02:00
components PureBasic: Added missing keyword and fixed constants ending with `$` (#3320) 2022-02-04 00:41:10 +01:00
docs Core: Added better error message for missing grammars (#3311) 2022-02-02 11:53:16 +01:00
examples Added UO Razor Script (#3309) 2022-01-28 17:13:21 +01:00
gulpfile.js ESLint: Added `regexp/no-useless-flag` rule (#3150) 2021-10-14 14:01:11 +02:00
plugins Command Line: Added span around command and output (#3312) 2022-02-02 13:20:48 +01:00
tests PureBasic: Added missing keyword and fixed constants ending with `$` (#3320) 2022-02-04 00:41:10 +01:00
themes Coy: Set z-index to make shadows visible in colored table cells (#3161) 2021-10-24 16:50:01 +02:00
.editorconfig Set default indentation size (#1516) 2018-08-19 10:56:44 -04:00
.eslintrc.js ESLint: Allow `Map` and `Set` in ES5 code (#3328) 2022-02-10 12:32:49 +01:00
.gitattributes Tests: Automatically normalize line ends (#2934) 2021-06-13 22:00:43 +02:00
.gitignore Added benchmark suite (#2153) 2021-08-16 20:08:13 +02:00
.jsdoc.json Added JSDoc (#1782) 2020-06-28 01:34:29 +02:00
.npmignore Added benchmark suite (#2153) 2021-08-16 20:08:13 +02:00
CHANGELOG.md Updated changelog for v1.26.0 (#3292) 2022-01-06 18:36:21 +01:00
CNAME Added CNAME file 2012-07-31 11:59:25 +12:00
LICENSE Fixing to initial copyright year 2016-01-18 21:53:13 +05:30
README.md Readme: Clarify usage of our build system (#3239) 2021-12-02 10:51:17 +01:00
benchmark.html Added benchmark suite (#2153) 2021-08-16 20:08:13 +02:00
bower.json Added benchmark suite (#2153) 2021-08-16 20:08:13 +02:00
components.js Added UO Razor Script (#3309) 2022-01-28 17:13:21 +01:00
components.json Added UO Razor Script (#3309) 2022-01-28 17:13:21 +01:00
composer.json Name in composer.json set to lowercase (#1824) 2019-03-24 12:42:17 -04:00
dangerfile.js ESLint: Added curly rule (#2901) 2021-05-25 12:46:45 +02:00
dependencies.js ESLint: Added JSDoc plugin (#2869) 2021-05-01 14:40:00 +02:00
download.html Update download.html 2021-12-22 08:03:11 -05:00
examples.html Update test and example pages to use Autoloader (#1936) 2021-10-05 12:53:51 +02:00
extending.html Document standard tokens and provide examples (#3104) 2021-10-21 19:46:08 +02:00
faq.html Document standard tokens and provide examples (#3104) 2021-10-21 19:46:08 +02:00
index.html Website: Improved CDN usage URLs (#3285) 2021-12-31 13:28:50 +01:00
known-failures.html Website: Moved remaining vendor files into `vendor` folder (#2829) 2021-05-01 14:57:39 +02:00
package-lock.json Bump node-fetch from 2.6.1 to 3.1.1 (#3307) 2022-01-24 11:58:35 +01:00
package.json Bump node-fetch from 2.6.1 to 3.1.1 (#3307) 2022-01-24 11:58:35 +01:00
prism.js Core: Added better error message for missing grammars (#3311) 2022-02-02 11:53:16 +01:00
test-suite.html Tests: Added `.html.test` files for replace `.js` language tests (#3148) 2021-10-19 14:59:04 +02:00
test.html Website: Repositioned theme selector (#3146) 2021-10-19 14:52:13 +02:00
tokens.html Document standard tokens and provide examples (#3104) 2021-10-21 19:46:08 +02:00

README.md

Prism

Build Status npm

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

You can learn more on prismjs.com.

Why another syntax highlighter?

More themes for Prism!

Contribute to Prism!

Prism depends on community contributions to expand and cover a wider array of use cases. If you like it, consider giving back by sending a pull request. Here are a few tips:

  • Read the documentation. Prism was designed to be extensible.
  • Do not edit prism.js, its just the version of Prism used by the Prism website and is built automatically. Limit your changes to the unminified files in the components/ folder. prism.js and all minified files are generated by our build system (see below).
  • Use npm ci to install Prism's dependencies. Do not use npm install because it will cause non-deterministic builds.
  • The build system uses gulp to minify the files and build prism.js. With all of Prism's dependencies installed, you just need to run the command npm run build.
  • Please follow the code conventions used in the files already. For example, I use tabs for indentation and spaces for alignment. Opening braces are on the same line, closing braces on their own line regardless of construct. There is a space before the opening brace. etc etc.
  • Please try to err towards more smaller PRs rather than a few huge PRs. If a PR includes changes that I want to merge and also changes that I don't, handling it becomes difficult.
  • My time is very limited these days, so it might take a long time to review bigger PRs (small ones are usually merged very quickly), especially those modifying the Prism Core. This doesn't mean your PR is rejected.
  • If you contribute a new language definition, you will be responsible for handling bug reports about that language definition.
  • If you add a new language definition or plugin, you need to add it to components.json as well and rebuild Prism by running npm run build, so that it becomes available to the download build page. For new languages, please also add a few tests and an example in the examples/ folder.
  • Go to prism-themes if you want to add a new theme.

Thank you so much for contributing!!

Software requirements

Prism will run on almost any browser and Node.js version but you need the following software to contribute:

  • Node.js >= 10.x
  • npm >= 6.x

Translations