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

Add option to load languages explicitly #90

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vrugtehagel
Copy link

@vrugtehagel vrugtehagel commented Aug 16, 2024

Resolves #47.

Adds a languages option to force-load languages before the init callback. Minor restructuring has been done to get the plugin in functional format, in order to allow for the init callback to run after the loading of the languages.

Example usage in an .eleventy.js config file:

export default function(eleventyConfig){
	eleventyConfig.addPlugin(SyntaxHighlight, {
		languages: ['css-extras', 'ruby'],
		init: function({Prism}){
			// do stuff with Prism.languages.ruby…
		}
	})
};

PS: The diff looks rather large due to an indentation change; please toggle "hide whitespace" to see the actual changes.

@vrugtehagel vrugtehagel changed the title Open option to load languages explicitly Add option to load languages explicitly Aug 16, 2024
@vrugtehagel
Copy link
Author

@zachleat is this something you're interested in? Can I do something to get the ball rolling on this one?

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

Successfully merging this pull request may close these issues.

BUG / FR / documentation: prism loading - possibility to load other languages; other prism components;
1 participant