Skip to content

Commit a3f2dad

Browse files
committed
docs(readme): add descriptions about getWrapperClassName
1 parent 808d41b commit a3f2dad

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ Add to your `gatsby-config.js` (all options are optional; defaults shown here):
5858
options: {
5959
colorTheme: 'Dark+ (default dark)', // Read on for list of included themes. Also accepts object and function forms.
6060
wrapperClassName: '', // Additional class put on 'pre' tag
61+
getWrapperClassName: ({ // Function allowing dynamic setting of additional class names on 'pre' tag
62+
language, // - the language specified for the code fence
63+
markdownNode, // - the gatsby-transformer-remark GraphQL node
64+
codeFenceNode, // - the Markdown AST node of the current code fence
65+
parsedOptions // - any options set on the code fence alongside the language (more on this later)
66+
}) => '',
6167
injectStyles: true, // Injects (minimal) additional CSS for layout and scrolling
6268
extensions: [], // Extensions to download from the marketplace to provide more languages and themes
6369
extensionDataDirectory: // Absolute path to the directory where extensions will be downloaded. Defaults to inside node_modules.
@@ -233,7 +239,7 @@ import 'gatsby-remark-vscode/styles.css';
233239
234240
### Class names
235241
236-
The generated HTML has ample stable class names, and you can add your own with the `wrapperClassName` and `getLineClassName` option. All (non-token-color) included styles have a single class name’s worth of specificity, so it should be easy to override the built-in styles.
242+
The generated HTML has ample stable class names, and you can add your own with the `wrapperClassName`, `getWrapperClassName` and `getLineClassName` option. All (non-token-color) included styles have a single class name’s worth of specificity, so it should be easy to override the built-in styles.
237243
238244
### Variables
239245
@@ -335,7 +341,7 @@ Line numbers and ranges aren’t the only things you can pass as options on your
335341
<Amazing><Stuff /></Amazing>
336342
```
337343
338-
`gatsby-remark-vscode` doesn’t inherently understand these things, but it parses the input and allows you to access it in the `colorTheme` and `getLineClassName` functions:
344+
`gatsby-remark-vscode` doesn’t inherently understand these things, but it parses the input and allows you to access it in the `colorTheme`, `getWrapperClassName` and `getLineClassName` functions:
339345
340346
```js
341347
{

0 commit comments

Comments
 (0)