| 1 |
<!DOCTYPE html> |
| 2 |
<html lang="en"> |
| 3 |
<head> |
| 4 |
|
| 5 |
<meta charset="utf-8"> |
| 6 |
<title>Home - Documentation</title> |
| 7 |
|
| 8 |
|
| 9 |
<meta property="og:title" content="Prism generated API documentation"/> |
| 10 |
<meta property="og:type" content="website"/> |
| 11 |
<meta property="og:image" content="/logo.svg"/> |
| 12 |
<meta property="og:site_name" content="Prism"/> |
| 13 |
<meta property="og:url" content="https://prismjs.com"/> |
| 14 |
|
| 15 |
<script src="scripts/prettify/prettify.js"></script> |
| 16 |
<script src="scripts/prettify/lang-css.js"></script> |
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
<link type="text/css" rel="stylesheet" href="styles/prettify.css"> |
| 21 |
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css"> |
| 22 |
<script src="scripts/nav.js" defer></script> |
| 23 |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 24 |
<link rel="icon" type="image/png" href="/favicon.png"/> |
| 25 |
</head> |
| 26 |
<body> |
| 27 |
|
| 28 |
<input type="checkbox" id="nav-trigger" class="nav-trigger" /> |
| 29 |
<label for="nav-trigger" class="navicon-button x"> |
| 30 |
<div class="navicon"></div> |
| 31 |
</label> |
| 32 |
|
| 33 |
<label for="nav-trigger" class="overlay"></label> |
| 34 |
|
| 35 |
<nav > |
| 36 |
|
| 37 |
<input type="text" id="nav-search" placeholder="Search" /> |
| 38 |
|
| 39 |
<h2><a href="index.html">Home</a></h2><h2><a href="https://prismjs.com" class="menu-item" id="website_link" >PrismJS</a></h2><h2><a href="https://github.com/PrismJS/prism" target="_blank" class="menu-item" id="github_link" >GitHub</a></h2><h3>Classes</h3><ul><li><a href="Token.html">Token</a></li></ul><h3>Namespaces</h3><ul><li><a href="Prism.html">Prism</a><ul class='members'><li data-type='member'><a href="Prism.html#.disableWorkerMessageHandler">disableWorkerMessageHandler</a></li><li data-type='member'><a href="Prism.html#.manual">manual</a></li></ul><ul class='methods'><li data-type='method'><a href="Prism.html#.highlight">highlight</a></li><li data-type='method'><a href="Prism.html#.highlightAll">highlightAll</a></li><li data-type='method'><a href="Prism.html#.highlightAllUnder">highlightAllUnder</a></li><li data-type='method'><a href="Prism.html#.highlightElement">highlightElement</a></li><li data-type='method'><a href="Prism.html#.tokenize">tokenize</a></li></ul></li><li><a href="Prism.hooks.html">hooks</a><ul class='methods'><li data-type='method'><a href="Prism.hooks.html#.add">add</a></li><li data-type='method'><a href="Prism.hooks.html#.run">run</a></li></ul></li><li><a href="Prism.languages.html">languages</a><ul class='methods'><li data-type='method'><a href="Prism.languages.html#.extend">extend</a></li><li data-type='method'><a href="Prism.languages.html#.insertBefore">insertBefore</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#Grammar">Grammar</a></li><li><a href="global.html#GrammarToken">GrammarToken</a></li><li><a href="global.html#HighlightCallback">HighlightCallback</a></li><li><a href="global.html#HookCallback">HookCallback</a></li><li><a href="global.html#TokenStream">TokenStream</a></li></ul> |
| 40 |
</nav> |
| 41 |
|
| 42 |
<div id="main"> |
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
<section class="readme usertext"> |
| 54 |
<article><h1><a href="https://prismjs.com/">Prism</a></h1> |
| 55 |
<p><a href="https://github.com/PrismJS/prism/actions"><img src="https://github.com/PrismJS/prism/workflows/CI/badge.svg" alt="Build Status"></a> |
| 56 |
<a href="https://www.npmjs.com/package/prismjs"><img src="https://img.shields.io/npm/dw/prismjs.svg" alt="npm"></a></p> |
| 57 |
<p>Prism is a lightweight, robust, and elegant syntax highlighting library. It's a spin-off project from <a href="https://dabblet.com/">Dabblet</a>.</p> |
| 58 |
<p>You can learn more on <a href="https://prismjs.com/">prismjs.com</a>.</p> |
| 59 |
<p><a href="https://lea.verou.me/2012/07/introducing-prism-an-awesome-new-syntax-highlighter/#more-1841">Why another syntax highlighter?</a></p> |
| 60 |
<p><a href="https://github.com/PrismJS/prism-themes">More themes for Prism!</a></p> |
| 61 |
<h2>Contribute to Prism!</h2> |
| 62 |
<h3><strong>Important Notice</strong></h3> |
| 63 |
<p>We are currently working on <a href="https://github.com/PrismJS/prism/discussions/3531">Prism v2</a> and will only accept security-relevant PRs for the time being.</p> |
| 64 |
<p>Once work on Prism v2 is sufficiently advanced, we will accept PRs again. This will be announced on our <a href="https://github.com/PrismJS/prism/discussions">Discussion</a> page and mentioned in the <a href="https://github.com/PrismJS/prism/discussions/3531">roadmap discussion</a>.</p> |
| 65 |
<details> |
| 66 |
<summary>Prism v1 contributing notes</summary> |
| 67 |
<p>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:</p> |
| 68 |
<ul> |
| 69 |
<li>Read the <a href="https://prismjs.com/extending.html">documentation</a>. Prism was designed to be extensible.</li> |
| 70 |
<li>Do not edit <code>prism.js</code>, it’s just the version of Prism used by the Prism website and is built automatically. Limit your changes to the unminified files in the <code>components/</code> folder. <code>prism.js</code> and all minified files are generated by our build system (see below).</li> |
| 71 |
<li>Use <code>npm ci</code> to install Prism's dependencies. Do not use <code>npm install</code> because it will cause non-deterministic builds.</li> |
| 72 |
<li>The build system uses <a href="https://github.com/gulpjs/gulp">gulp</a> to minify the files and build <code>prism.js</code>. With all of Prism's dependencies installed, you just need to run the command <code>npm run build</code>.</li> |
| 73 |
<li>Please follow the code conventions used in the files already. For example, I use <a href="http://lea.verou.me/2012/01/why-tabs-are-clearly-superior/">tabs for indentation and spaces for alignment</a>. 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.</li> |
| 74 |
<li>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.</li> |
| 75 |
<li>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.</li> |
| 76 |
<li>If you contribute a new language definition, you will be responsible for handling bug reports about that language definition.</li> |
| 77 |
<li>If you <a href="https://prismjs.com/extending.html#creating-a-new-language-definition">add a new language definition</a> or plugin, you need to add it to <code>components.json</code> as well and rebuild Prism by running <code>npm run build</code>, so that it becomes available to the download build page. For new languages, please also add a few <a href="https://prismjs.com/test-suite.html">tests</a> and an example in the <code>examples/</code> folder.</li> |
| 78 |
<li>Go to <a href="https://github.com/PrismJS/prism-themes">prism-themes</a> if you want to add a new theme.</li> |
| 79 |
</ul> |
| 80 |
<p>Thank you so much for contributing!!</p> |
| 81 |
<h3>Software requirements</h3> |
| 82 |
<p>Prism will run on <a href="https://prismjs.com/#features-full">almost any browser</a> and Node.js version but you need the following software to contribute:</p> |
| 83 |
<ul> |
| 84 |
<li>Node.js >= 10.x</li> |
| 85 |
<li>npm >= 6.x</li> |
| 86 |
</ul> |
| 87 |
</details> |
| 88 |
<h2>Translations</h2> |
| 89 |
<ul> |
| 90 |
<li><a href="https://www.awesomes.cn/repo/PrismJS/prism">简体中文</a> (if unavailable, see <a href="https://deepmind.t-salon.cc/article/113">here</a>)</li> |
| 91 |
</ul></article> |
| 92 |
</section> |
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
</div> |
| 102 |
|
| 103 |
<br class="clear"> |
| 104 |
|
| 105 |
<footer> |
| 106 |
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> using the <a href="https://github.com/clenemt/docdash">docdash</a> theme. |
| 107 |
</footer> |
| 108 |
|
| 109 |
<script>prettyPrint();</script> |
| 110 |
<script src="scripts/polyfill.js"></script> |
| 111 |
<script src="scripts/linenumber.js"></script> |
| 112 |
|
| 113 |
<script src="scripts/search.js" defer></script> |
| 114 |
|
| 115 |
|
| 116 |
|
| 117 |
<link type="text/css" rel="stylesheet" href="styles/overwrites.css"> |
| 118 |
|
| 119 |
</body> |
| 120 |
</html> |