Skip to content

Latest commit

 

History

History
64 lines (42 loc) · 873 Bytes

README.md

File metadata and controls

64 lines (42 loc) · 873 Bytes

Vuepress Plugin Ordered Header

This is a vuepress plugin for ordering headers in the sidebar.

Like this:

# header 1

## header 1-1

### header 1-1-1

## header 1-2

# header 2

And the sidebar will be:

1 header 1

1.1 header 1-1

1.1.1 header 1-1-1

1.2 header 1-2

2 header 2

Installation

You can install it via npm or other.

npm install vuepress-plugin-ordered-header

Usage

In vuepress config file, add the plugin to the plugins array.

import orderedHeader from "vuepress-plugin-ordered-header";

module.exports = {
  plugins: [orderedHeader],
  markdown: {
    headers: {
      level: [2, 3, 4],
    },
  },
};

If you use vuepress-theme-hope,you also need to add the following config in theme:

export default hopeTheme(
  headerDepth: 3, // the depth header you want to render.
)