Home

Awesome

🧐 What is markdown-toc?

A Neovim plugin to generate, update and delete TOCs (Table of Contents) in a markdown file from another markdown files headings

markdown-toc

🗂️ Markdown-TOC TOC

✨ Features

⚡️ Requirements

📦 Installation

Install the plugin with your preferred package manager:

💤 Lazy.nvim

return {
  {
    'ChuufMaster/markdown-toc',
    opts = {

      -- The heading level to match (i.e the number of "#"s to match to) max 6
      heading_level_to_match = -1,

      -- Set to True display a dropdown to allow you to select the heading level
      ask_for_heading_level = false,

      -- TOC default string
      -- WARN
      toc_format = '%s- [%s](<%s#%s>)',
    }
  },
}

🚀 Usage

Markdown TOC exposes 2 commands to the user:

⚙️ Configuration

markdown-toc comes with the following defaults:

{
  -- The heading level to match (i.e the number of "#"s to match to)
  heading_level_to_match = -1,

  -- Set to display a dropdown to allow you to select the heading level
  ask_for_heading_level = true,

  -- TOC default string
  -- The first %s is for indenting/tabs
  -- The sencond %s is for the original headings text
  -- The third %s is for the markdown files path that the TOC is being generated
  -- from
  -- The forth %s is for the target heading using the markdown rules
  toc_format = '%s- [%s](<%s#%s>)',
}