Lightweight, robust, elegant syntax highlighting.
Go to file
RunDevelopment ffab2edc5b Use safe navigation 2024-02-10 17:16:16 +01:00
.github Re-enabled CI build workflow 2022-09-09 14:41:58 +02:00
benchmark V2 TypeScript (#3687) 2023-05-31 11:31:05 +02:00
scripts Updated terser plugin 2023-06-01 15:36:47 +02:00
src Use safe navigation 2024-02-10 17:16:16 +01:00
tests V2 TypeScript (#3687) 2023-05-31 11:31:05 +02:00
themes Removed minified files 2022-08-23 13:29:00 +02:00
website Removed now useless `data-noprefix` attribute 2022-09-09 15:03:22 +02:00
.babelrc Updated babelrc to target specific browsers and NodeJS version 2022-09-07 15:20:33 +02:00
.editorconfig Set default indentation size (#1516) 2018-08-19 10:56:44 -04:00
.eslintrc.js Added eslint-plugin-eslint-comments 2023-06-01 14:41:34 +02:00
.gitattributes Tests: Automatically normalize line ends (#2934) 2021-06-13 22:00:43 +02:00
.gitignore Ignore dist/ directory 2022-09-05 15:58:57 +02:00
.jsdoc.json Added JSDoc (#1782) 2020-06-28 01:34:29 +02:00
.mocharc.yml Added babel to run tests 2022-08-29 12:14:05 +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
bower.json Added benchmark suite (#2153) 2021-08-16 20:08:13 +02:00
composer.json Name in composer.json set to lowercase (#1824) 2019-03-24 12:42:17 -04:00
dangerfile.js ESLint: Consistent arrow parens 2022-09-06 18:21:08 +02:00
package-lock.json Updated terser plugin 2023-06-01 15:36:47 +02:00
package.json Updated terser plugin 2023-06-01 15:36:47 +02:00
tsconfig.json Upgrade target to ES2020 for better compression 2023-06-01 15:27:33 +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