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

Dynamic language-definitions load - documentation needed #960

Closed
soar opened this issue May 28, 2016 · 2 comments
Closed

Dynamic language-definitions load - documentation needed #960

soar opened this issue May 28, 2016 · 2 comments

Comments

@soar
Copy link

soar commented May 28, 2016

Download page offers to download All-In-One JS file. With all available languages (what if I need them all?) this file weights about 250 KB and it will slow page loading and processing.

But here is some information about "Autoloader" plugin, which should take care about language processing. This sounds good, but where is documentation about this feature? Where should I download "core" version of Prism? Where should I download language-definitions? Where should I place them?

@LeaVerou
Copy link
Member

I think if you're using the autoloader the easiest way is to just clone the repo and take the components folder from there. You can then download Prism core & 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).

@Golmote, perhaps we can add something like the above to the plugin's documentation? Is there an easy way to provide a download of the components folder as a zip without having to manually update it?

@Golmote
Copy link
Contributor

Golmote commented Jun 18, 2016

Hi! Sorry for the late answer. I updated the plugin documentation to include info on how to get the grammars.

We could also add a "Download all languages grammars" button on the plugin page, that would generate a zip file automatically in JS. I gave it a try and it seems to work pretty well, using JSZip and FileSaver. I will make a PR so you can take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants