1.1.0 • Published 5 years ago

@minipx/gatsby-remark-toc v1.1.0

Weekly downloads
1
License
MIT
Repository
-
Last release
5 years ago

🚀 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
            }
          }
        }
      ]
    }
  }
];