Skip to content

Commit ba0fdbe

Browse files
committed
docs(readme): add description about wrapperClassName usage
1 parent 483946b commit ba0fdbe

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

README.md

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,7 @@ Add to your `gatsby-config.js` (all options are optional; defaults shown here):
5757
// 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.
60-
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-
}) => '',
60+
wrapperClassName: '', // Additional class put on 'pre' tag. Also accepts function to set the class dynamically.
6761
injectStyles: true, // Injects (minimal) additional CSS for layout and scrolling
6862
extensions: [], // Extensions to download from the marketplace to provide more languages and themes
6963
extensionDataDirectory: // Absolute path to the directory where extensions will be downloaded. Defaults to inside node_modules.
@@ -239,7 +233,7 @@ import 'gatsby-remark-vscode/styles.css';
239233
240234
### Class names
241235
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.
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.
243237
244238
### Variables
245239
@@ -341,7 +335,7 @@ Line numbers and ranges aren’t the only things you can pass as options on your
341335
<Amazing><Stuff /></Amazing>
342336
```
343337
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:
338+
`gatsby-remark-vscode` doesn’t inherently understand these things, but it parses the input and allows you to access it in the `colorTheme`, `wrapperClassName` and `getLineClassName` functions:
345339
346340
```js
347341
{
@@ -356,7 +350,8 @@ Line numbers and ranges aren’t the only things you can pass as options on your
356350
// nested: { objects: 'yep' }
357351
// }
358352
return parsedOptions.theme || 'Dark+ (default dark)';
359-
}
353+
},
354+
wrapperClassName: ({ parsedOptions, language, markdownNode, codeFenceNode }) => '';
360355
}
361356
```
362357

0 commit comments

Comments
 (0)