Code Monkey home page Code Monkey logo

docsify-plugin-toc's Introduction

docsify-plugin-toc

page's ToC for docsify.

npm

homepage

Usage

  1. Configure docsify-plugin-toc:

    <script>
    window.$docsify = {
      toc: {
        tocMaxLevel: 5,
        target: 'h2, h3, h4, h5, h6',
        ignoreHeaders:  ['<!-- {docsify-ignore} -->', '<!-- {docsify-ignore-all} -->']
      },
    }
    </script>
  2. Insert style/script into docsify document:

    <!-- head -->
    <link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/light.css">
    <!-- Also insert you custom css -->
    
    <!-- body -->
    <script src="https://unpkg.com/[email protected]/dist/docsify-plugin-toc.min.js"></script>

Options

Argument Type Description
tocMaxLevel number The maximum depth of the headings printed on the ToC. If you set tocMaxLevel to 3, I recommend you to set subMaxLevel to 2 avoid ToC duplication.
target string The target heading printed on the ToC. It's used as an argument to query DOM with querySelectorAll()
ignoreHeaders string[] ignore header name keywrod list, (e.g. ['develop', /develop/i], support Regular expressions)

docsify-plugin-toc's People

Contributors

githoniel avatar justintien avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.