Skip to content

Commit a3a16fe

Browse files
committed
prismjs config
1 parent 2fd0271 commit a3a16fe

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

gatsby-config.js

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,49 @@ module.exports = {
6767
modulePath: `${__dirname}/src/cms/cms.js`,
6868
},
6969
},
70+
{
71+
resolve: `gatsby-transformer-remark`,
72+
options: {
73+
plugins: [
74+
{
75+
resolve: `gatsby-remark-prismjs`,
76+
options: {
77+
// Class prefix for <pre> tags containing syntax highlighting;
78+
// defaults to 'language-' (eg <pre class="language-js">).
79+
// If your site loads Prism into the browser at runtime,
80+
// (eg for use with libraries like react-live),
81+
// you may use this to prevent Prism from re-processing syntax.
82+
// This is an uncommon use-case though;
83+
// If you're unsure, it's best to use the default value.
84+
classPrefix: "language-",
85+
// This is used to allow setting a language for inline code
86+
// (i.e. single backticks) by creating a separator.
87+
// This separator is a string and will do no white-space
88+
// stripping.
89+
// A suggested value for English speakers is the non-ascii
90+
// character '›'.
91+
inlineCodeMarker: null,
92+
// This lets you set up language aliases. For example,
93+
// setting this to '{ sh: "bash" }' will let you use
94+
// the language "sh" which will highlight using the
95+
// bash highlighter.
96+
aliases: {},
97+
// This toggles the display of line numbers globally alongside the code.
98+
// To use it, add the following line in src/layouts/index.js
99+
// right after importing the prism color scheme:
100+
// `require("prismjs/plugins/line-numbers/prism-line-numbers.css");`
101+
// Defaults to false.
102+
// If you wish to only show line numbers on certain code blocks,
103+
// leave false and use the {numberLines: true} syntax below
104+
showLineNumbers: false,
105+
// If setting this to true, the parser won't handle and highlight inline
106+
// code used in markdown i.e. single backtick code like `this`.
107+
noInlineHighlight: false,
108+
},
109+
},
110+
],
111+
},
112+
},
70113
{
71114
resolve: 'gatsby-plugin-purgecss', // purges all unused/unreferenced css rules
72115
options: {

0 commit comments

Comments
 (0)