@mingchyuanko/docsify-plugin-page-toc

1.1.13 • Public • Published

docsify-plugin-page-toc

A docsify plugin to display ToC for each page.

NPM Version

Usage notes

Markdown file

  • Do not skip heading levels:
    always start from <h1>, followed by <h2> and so on.
  • Avoid using multiple <h1> elements on one page.
    A page should generally have a single <h1> element that describes the content of the page.

Stylesheet

<!-- head -->
<link rel="stylesheet" href="https://unpkg.com/@mingchyuanko/docsify-plugin-page-toc/dist/toc.css">

The browser's width must be wider than 1200px.

Otherwise, you need to download the CSS file and remove the following code:

@media screen and (max-width: 1200px) {
    /* … */
}

Script

<!-- body -->
<script src="https://unpkg.com/@mingchyuanko/docsify-plugin-page-toc/dist/toc.min.js"></script>

Configure docsify-plugin-page-toc

    <script>
        window.$docsify = {
            toc: {
                title: 'Table of Contents',
                headings: 'h2, h3, h4, h5, h6',
            },
        };
    </script>

Package Sidebar

Install

npm i @mingchyuanko/docsify-plugin-page-toc

Weekly Downloads

0

Version

1.1.13

License

MIT

Unpacked Size

24.5 kB

Total Files

6

Last publish

Collaborators

  • mingchyuanko