Lightweight, robust, elegant syntax highlighting.
Go to file
RunDevelopment 59e5a34713 1.29.0 2022-08-23 12:41:49 +02:00
.github Bump actions/setup-node from 1 to 3 (#3472) 2022-06-13 09:42:22 +00:00
assets Website: Improved readability (#3177) 2021-11-08 12:52:43 +01:00
benchmark Got rid of `simple-git` warning (#3405) 2022-03-21 20:38:26 +01:00
components Bash: Added "sh" alias (#3509) 2022-08-18 15:43:17 +02:00
docs Added PR stop notice (#3532) 2022-08-23 12:23:49 +02:00
examples Cilk: Add support for Cilk (with C/C++) (#3522) 2022-08-17 20:49:11 +02:00
gulpfile.js Use terser (#3407) 2022-03-22 22:32:52 +01:00
plugins Line Highlight: Account for offset when clamping ranges (#3518) 2022-08-23 10:58:45 +02:00
tests Cilk: Add support for Cilk (with C/C++) (#3522) 2022-08-17 20:49:11 +02: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 Updated npmignore to include new MD files (#3534) 2022-08-23 12:36:53 +02:00
CHANGELOG.md Added changelog for v1.29.0 (#3533) 2022-08-23 12:15:45 +02: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
MAINTAINERS.md Added list of maintainers (#3410) 2022-07-26 20:59:01 +02:00
README.md Added PR stop notice (#3532) 2022-08-23 12:23:49 +02:00
SECURITY.md Added security policy (#3070) 2022-07-27 10:36:55 +02: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 Bash: Added "sh" alias (#3509) 2022-08-18 15:43:17 +02:00
components.json Bash: Added "sh" alias (#3509) 2022-08-18 15:43:17 +02:00
composer.json Name in composer.json set to lowercase (#1824) 2019-03-24 12:42:17 -04:00
dangerfile.js Got rid of `simple-git` warning (#3405) 2022-03-21 20:38:26 +01: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 More documentation for language definitons (#3427) 2022-04-17 14:05:54 +02:00
faq.html Document standard tokens and provide examples (#3104) 2021-10-21 19:46:08 +02:00
index.html Website: Added third-party tutorial for Pug template (#3459) 2022-08-18 15:38:46 +02:00
known-failures.html Website: Moved remaining vendor files into `vendor` folder (#2829) 2021-05-01 14:57:39 +02:00
package-lock.json 1.29.0 2022-08-23 12:41:49 +02:00
package.json 1.29.0 2022-08-23 12:41:49 +02:00
prism.js Markup: Fixed quotes in HTML attribute values (#3442) 2022-04-29 12:13:01 +02: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!

Important Notice

We are currently working on Prism v2 and will only accept security-relevant PRs for the time being.

Once work on Prism v2 is sufficiently advanced, we will accept PRs again. This will be announced on our Discussion page and mentioned in the roadmap discussion.

Prism v1 contributing notes

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