@minipx/gatsby-remark-toc
v1.1.0
Published
<p align="center"> <a href="https://next.gatsbyjs.org"> <img alt="Gatsby" src="https://www.gatsbyjs.org/monogram.svg" width="60" /> </a> </p> <h1 align="center"> gatsby-remark-toc </h1>
Downloads
1
Readme
🚀 Install
npm install gatsby-remark-toc --save
🎓 How to use
// in your gatsby-config.js
plugins: [
{
resolve: 'gatsby-transformer-remark',
options: {
plugins: [
{
resolve: 'gatsby-remark-toc',
options: {
header: 'Table of Contents', // the custom header text
include: [
'content/**/*.md' // an include glob to match against
]
}
}
]
}
}
];
additionally, you can pass custom options directly to mdast-util-toc like so:
// in your gatsby-config.js
plugins: [
{
resolve: 'gatsby-transformer-remark',
options: {
plugins: [
{
resolve: 'gatsby-remark-toc',
options: {
header: 'Table of Contents', // the custom header text
include: [
'content/**/*.md' // an include glob to match against
],
mdastUtilTocOptions: {
maxDepth: 2
}
}
}
]
}
}
];