Skip to content

Commit

Permalink
Docs: Add note on async parameter to clarify the requirement of usi…
Browse files Browse the repository at this point in the history
…ng a single bundled file. Closes #1249
  • Loading branch information
Golmote committed Mar 4, 2018
1 parent a9e76db commit eba0235
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions extending.html
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,19 @@ <h1><code>Prism.highlightAll(async, callback)</code></h1>
<h2>Parameters</h2>
<dl>
<dt>async</dt>
<dd>Whether to use Web Workers to improve performance and avoid blocking the UI when highlighting very large chunks of code. False by default (<a href="faq.html#why-is-asynchronous-highlighting-disabled-by-default">why?</a>).</dd>
<dd>
Whether to use Web Workers to improve performance and avoid blocking the UI when highlighting very large
chunks of code. False by default
(<a href="faq.html#why-is-asynchronous-highlighting-disabled-by-default">why?</a>).<br />
Note: All language definitions required to highlight the code must be included in the main <code>prism.js</code>
file for the async highlighting to work. You can build your own bundle on the <a href="download.html">Download page</a>.
</dd>

<dt>callback</dt>
<dd>An optional callback to be invoked after the highlighting is done. Mostly useful when <code>async</code> is true, since in that case, the highlighting is done asynchronously.</dd>
<dd>
An optional callback to be invoked after the highlighting is done. Mostly useful when <code>async</code>
is true, since in that case, the highlighting is done asynchronously.
</dd>
</dl>
</section>

Expand All @@ -169,10 +178,10 @@ <h2>Parameters</h2>
<dd>The root element, whose descendants that have a <code>.language-xxxx</code> class will be highlighted.</dd>

<dt>async</dt>
<dd>Whether to use Web Workers to improve performance and avoid blocking the UI when highlighting very large chunks of code. False by default (<a href="faq.html#why-is-asynchronous-highlighting-disabled-by-default">why?</a>).</dd>
<dd>Same as in <a href="#highlight-all"><code>Prism.highlightAll()</code></a></dd>

<dt>callback</dt>
<dd>An optional callback to be invoked after the highlighting is done. Mostly useful when <code>async</code> is true, since in that case, the highlighting is done asynchronously.</dd>
<dd>Same as in <a href="#highlight-all"><code>Prism.highlightAll()</code></a></dd>
</dl>
</section>

Expand All @@ -186,6 +195,7 @@ <h2>Parameters</h2>
<dd>The element containing the code. It must have a class of <code>language-xxxx</code> to be processed, where <code>xxxx</code> is a valid language identifier.</dd>

<dt>async</dt>
<dd>Same as in <a href="#highlight-all"><code>Prism.highlightAll()</code></a></dd>
<dt>callback</dt>
<dd>Same as in <a href="#highlight-all"><code>Prism.highlightAll()</code></a></dd>
</dl>
Expand Down

0 comments on commit eba0235

Please sign in to comment.