Default language option for gatsby-remark-prismjs #25615
Replies: 5 comments
-
Would using additional plugin that would add default lang instead of having this baked in |
Beta Was this translation helpful? Give feedback.
-
Here's |
Beta Was this translation helpful? Give feedback.
-
Yes, that's what I had in mind! Thank you so much! However, now that I am using it, I realised a few things:
I have tried
and
but both lead to the resulting code-block having no language at all (i.e. not using the default language configured in the new plugin).
|
Beta Was this translation helpful? Give feedback.
-
Ah, I didn't account for extra "directives" there. You can check the code of the plugin - https://github.com/pieh/gatsby-remark-default-code-lang/blob/master/index.js in both |
Beta Was this translation helpful? Give feedback.
-
Ok, added compatibility for |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
For gatsby-remark-prismjs, please consider providing an option to set a default language in gatsby-config.js.
Basic example
Right now, we have to specify the language manually every time we add code to a markdown file, for example:
Motivation
For those of us using the same language almost exclusively, it would be much more convenient if there was an option to set a default language in gatsby-config.js, for example:
Beta Was this translation helpful? Give feedback.
All reactions