Lightweight, robust, elegant syntax highlighting.
Go to file
mAAdhaTTah 38f42dd668
1.22.0
2020-10-10 14:25:16 -04:00
.github/ISSUE_TEMPLATE Issue template improvements (#2069) 2019-09-26 16:46:43 +02:00
assets Website: New assets directory for all web-only files (#2180) 2020-06-28 01:58:55 +02:00
components PHP: Added `match` keyword (PHP 8.0) (#2574) 2020-10-05 13:01:19 +02:00
docs Docs: Minor improvement (#2513) 2020-08-27 19:16:21 +02:00
examples Added support for SML (#2537) 2020-09-13 23:26:33 +02:00
gulpfile.js Show Language: Added title for plain text (#2555) 2020-10-01 12:32:22 +02:00
plugins Show Language: Added title for plain text (#2555) 2020-10-01 12:32:22 +02:00
tests PHP: Added `match` keyword (PHP 8.0) (#2574) 2020-10-05 13:01:19 +02:00
themes Coy: Minor improvements (#2176) 2020-06-27 21:34:40 +02:00
.editorconfig Set default indentation size (#1516) 2018-08-19 10:56:44 -04:00
.gitattributes Add .gitattributes to prevent line ending changes in test files 2015-08-18 08:17:01 +02:00
.gitignore add Io syntax (#1251) 2018-01-02 08:58:10 +01:00
.jsdoc.json Added JSDoc (#1782) 2020-06-28 01:34:29 +02:00
.npmignore Added docs to ignore files (#2437) 2020-06-28 02:25:53 +02:00
.travis.yml Removed gulp `premerge` task (#2357) 2020-06-12 16:09:46 +02:00
CHANGELOG.md Changelog for v1.22.0 (#2579) 2020-10-10 19:00:19 +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
README.md Added `npm run build` command (#2356) 2020-06-12 18:42:12 +02:00
bower.json Added docs to ignore files (#2437) 2020-06-28 02:25:53 +02:00
components.js Added support for SML (#2537) 2020-09-13 23:26:33 +02:00
components.json Added support for SML (#2537) 2020-09-13 23:26:33 +02:00
composer.json Name in composer.json set to lowercase (#1824) 2019-03-24 12:42:17 -04:00
dependencies.js Dependencies: Improved `getLoader` (#2151) 2020-01-05 19:46:54 +01:00
download.html Website: New assets directory for all web-only files (#2180) 2020-06-28 01:58:55 +02:00
examples.html Website: New assets directory for all web-only files (#2180) 2020-06-28 01:58:55 +02:00
extending.html Website: Fixed typos "Prims" (#2455) 2020-07-03 19:40:39 +02:00
faq.html Website: New assets directory for all web-only files (#2180) 2020-06-28 01:58:55 +02:00
index.html Website: Added new SB101 tutorial replacing the Crambler one (#2576) 2020-10-10 17:46:30 +02:00
known-failures.html Website: New assets directory for all web-only files (#2180) 2020-06-28 01:58:55 +02:00
package-lock.json 1.22.0 2020-10-10 14:25:16 -04:00
package.json 1.22.0 2020-10-10 14:25:16 -04:00
prism.js Regex: Changed how languages embed regexes (#2532) 2020-08-31 17:56:46 +02:00
test-suite.html Tests: Added an option to accept the actual token stream (#2515) 2020-08-17 16:22:21 +02:00
test.html Website: New assets directory for all web-only files (#2180) 2020-06-28 01:58:55 +02:00

README.md

Prism

Build Status npm

Prism is a lightweight, robust, 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, considering 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 also generated automatically by our build system.
  • 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 few huge PRs. If a PR includes changes I want to merge and changes I don't, handling it becomes difficult.
  • My time is very limited these days, so it might take a long time to review longer PRs (short 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!!

Translations

  • 中文说明