Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autoloader: Mention how to load grammars from URLs #3218

Merged
merged 1 commit into from Nov 24, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion plugins/autoloader/index.html
Expand Up @@ -36,11 +36,13 @@ <h1>How to use</h1>

<p>
The plugin will automatically handle missing grammars and load them for you.
To do this, you need to provide it with a directory of all the grammars you want.
To do this, you need to provide a URL to a directory of all the grammars you want.
This can be the path to a local directory with all grammars or a CDN URL.
</p>
<p>
You can download all the available grammars by clicking on the following link: <button class="download-grammars" type="button">download all grammars</button>.<br />
Alternatively, you can also clone the GitHub repo and take the <code>components</code> folder from there.
Read our <a href="index.html#basic-usage-cdn">usage section</a> to use a CDN.
</p>
<p>
You can then download Prism core and any plugins from the <a href="download.html">Download</a> page, without checking any languages (or just check the languages you want to load by default, e.g. if you're using a language a lot, then you probably want to save the extra HTTP request).
Expand All @@ -58,6 +60,10 @@ <h2>Specifying the grammars path</h2>

<pre><code>Prism.plugins.autoloader.languages_path = 'path/to/grammars/';</code></pre>

<p>
<em>Note:</em> Autoloader is pretty good at guessing this path. You most likely won't have to change this path.
</p>

<h2>Using development versions</h2>

<p>
Expand Down