Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,27 @@ <h1>Basic usage</h1>
<p>If you want to prevent any elements from being automatically highlighted, you can use the attribute <code>data-manual</code> on the <code>&lt;script></code> element you used for prism and use the <a href="extending.html#api">API</a>.
Example:</p>
<pre><code>&lt;script src="prism.js" data-manual>&lt;/script></code></pre>
<h2>Usage with CDNs</h2>

<p>In combination with CDNs, we recommend using the <a href="plugins/autoloader">Autoloader plugin</a> which automatically loads languages when necessary.</p>

<p>The setup of the Autoloader, will look like the following. You can also your own themes of course.</p>

<pre><code>&lt;!DOCTYPE html>
&lt;html>
&lt;head>
...</code>
<code class="highlight">&lt;link href="https://myCDN.com/[email protected]/themes/prism.css" rel="stylesheet" /></code>
<code>&lt;/head>
&lt;body>
...</code>
<code class="highlight" style="display: inline-block; outline-offset: .2em; margin-bottom: .2em;"> &lt;script src="https://myCDN.com/[email protected]/components/prism-core.min.js"&gt;&lt;/script&gt;
&lt;script src="https://myCDN.com/[email protected]/plugins/autoloader/prism-autoloader.min.js"&gt;&lt;/script&gt;
&lt;script&gt;Prism.plugins.autoloader.languages_path = 'https://myCDN.com/[email protected]/components/'&lt;/script&gt;</code>
<code>&lt;/body>
&lt;/html></code></pre>

<p>CDNs which provide PrismJS are e.g. <a href="https://cdnjs.com/libraries/prism">cdnjs</a> and <a href="https://www.jsdelivr.com/package/npm/prismjs">jsDelivr</a>.</p>

<h2>Usage with Webpack, Browserify, & Other Bundlers</h2>

Expand Down