Make it possible to pass custom Prism plugins
See original GitHub issueCan haz a way to pass custom Prism plugins to this 11ty plugin? Maybe this can be solved generically by allowing something like this in 11ty’s plugin system:
-eleventyConfig.addPlugin(syntaxHighlight);
+eleventyConfig.addPlugin(syntaxHighlight, initializer);
For this particular plugin, initializer
would be a function that gets called with the Prism
object as an argument. Users could then do something like:
const initializer = (Prism) => {
Prism.languages.myCustomLanguage = /* */;
};
eleventyConfig.addPlugin(syntaxHighlight, initializer);
What do you think?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Extending Prism
This section will help you write new language definitions, plugins and all-around Prism hacking. ... This makes it easier to define certain languages....
Read more >Custom Class plugin broken · Issue #1137 · PrismJS/prism
The first issue seems normal: Custom class names don't also rewrite the CSS files, you would need to do that manually based on...
Read more >Highlight your code syntax with PrismJS
Go to the PrismJS project homepage , and hit the big 'Download' ... For example, they use a custom Prism CSS style or...
Read more >How to Add Prism.js Syntax Highlighting to Your ...
In this detailed tutorial, I'll teach you how to add Prism JS syntax highlighting to your WordPress site using either the Gutenberg or...
Read more >PrismTrello custom plugin release! - Forum
Hello Richard & fellow Prism users,I just released a custom plugin for Prism that you can use if you want to!
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
https://github.com/11ty/eleventy-plugin-syntaxhighlight#options
I think that’s a good idea, yeah. 👍
Maybe the
this
inside the callback should be the eleventyConfig object too?