Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make it possible to pass custom Prism plugins

See original GitHub issue

Can 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, 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:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

zachleatcommented, Sep 17, 2018

I think that’s a good idea, yeah. 👍

Maybe the this inside the callback should be the eleventyConfig object too?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found