Autoloader

Asynchronously load the needed components for the languages used on the page.

How to use

You must add an attribute data-autoloader-path, on the script element used for this plugin, to indicate the path to the folder containing the grammar files.

It may look like the following if the plugin is bundled with Prism:

<script src="path/to/prism.js" data-autoloader-path="path/to/grammars-dir/"></script>

If you include the plugin separately, it will look like this:

<script src="path/to/prism.js"></script>
<script src="path/to/prism-autoloader.js" data-autoloader-path="path/to/grammars-dir/"></script>

Examples

None of the following languages are initially loaded on this page.

Go

func(a, b int, z float64) bool { return a*b < int(z) }

LOLCODE

I HAS A var

Jade

div#foo(data-bar="foo")&attributes({'data-foo': 'bar'})

Objective C

@public