prism/docs/index.html

120 lines
7.8 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Home - Documentation</title>
<meta property="og:title" content="Prism generated API documentation"/>
<meta property="og:type" content="website"/>
<meta property="og:image" content="/logo.svg"/>
<meta property="og:site_name" content="Prism"/>
<meta property="og:url" content="https://prismjs.com"/>
<script src="scripts/prettify/prettify.js"></script>
<script src="scripts/prettify/lang-css.js"></script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
<script src="scripts/nav.js" defer></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/png" href="/favicon.png"/>
</head>
<body>
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
<label for="nav-trigger" class="navicon-button x">
<div class="navicon"></div>
</label>
<label for="nav-trigger" class="overlay"></label>
<nav >
<input type="text" id="nav-search" placeholder="Search" />
<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>
</nav>
<div id="main">
<section class="readme usertext">
<article><h1><a href="https://prismjs.com/">Prism</a></h1>
<p><a href="https://github.com/PrismJS/prism/actions"><img src="https://github.com/PrismJS/prism/workflows/CI/badge.svg" alt="Build Status"></a>
<a href="https://www.npmjs.com/package/prismjs"><img src="https://img.shields.io/npm/dw/prismjs.svg" alt="npm"></a></p>
<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>
<p>You can learn more on <a href="https://prismjs.com/">prismjs.com</a>.</p>
<p><a href="https://lea.verou.me/2012/07/introducing-prism-an-awesome-new-syntax-highlighter/#more-1841">Why another syntax highlighter?</a></p>
<p><a href="https://github.com/PrismJS/prism-themes">More themes for Prism!</a></p>
<h2>Contribute to Prism!</h2>
<h3><strong>Important Notice</strong></h3>
<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>
<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>
<details>
<summary>Prism v1 contributing notes</summary>
<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>
<ul>
<li>Read the <a href="https://prismjs.com/extending.html">documentation</a>. Prism was designed to be extensible.</li>
<li>Do not edit <code>prism.js</code>, its 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>
<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>
<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>
<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>
<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>
<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>
<li>If you contribute a new language definition, you will be responsible for handling bug reports about that language definition.</li>
<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>
<li>Go to <a href="https://github.com/PrismJS/prism-themes">prism-themes</a> if you want to add a new theme.</li>
</ul>
<p>Thank you so much for contributing!!</p>
<h3>Software requirements</h3>
<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>
<ul>
<li>Node.js &gt;= 10.x</li>
<li>npm &gt;= 6.x</li>
</ul>
</details>
<h2>Translations</h2>
<ul>
<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>
</ul></article>
</section>
</div>
<br class="clear">
<footer>
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.
</footer>
<script>prettyPrint();</script>
<script src="scripts/polyfill.js"></script>
<script src="scripts/linenumber.js"></script>
<script src="scripts/search.js" defer></script>
<link type="text/css" rel="stylesheet" href="styles/overwrites.css">
</body>
</html>