From cefccdd18faac3c8b579464f9a0c98834ea1441c Mon Sep 17 00:00:00 2001 From: Michael Schmidt Date: Wed, 24 Nov 2021 21:42:57 +0100 Subject: [PATCH] Autoloader: Mention how to load grammars from URLs (#3218) --- plugins/autoloader/index.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/autoloader/index.html b/plugins/autoloader/index.html index 708be5e06e..0370c74388 100644 --- a/plugins/autoloader/index.html +++ b/plugins/autoloader/index.html @@ -36,11 +36,13 @@

How to use

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.

You can download all the available grammars by clicking on the following link: .
Alternatively, you can also clone the GitHub repo and take the components folder from there. + Read our usage section to use a CDN.

You can then download Prism core and any plugins from the Download 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). @@ -58,6 +60,10 @@

Specifying the grammars path

Prism.plugins.autoloader.languages_path = 'path/to/grammars/';
+

+ Note: Autoloader is pretty good at guessing this path. You most likely won't have to change this path. +

+

Using development versions