npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@markbattistella/docsify-autoheaders

v5.0.1

Published

Auto header numbering for docsify.js

Downloads

114

Readme

docsify.js auto-headers

This plugin enhances your Docsify documentation by automatically generating numbered headers for your markdown files. It allows you to configure the header levels, numbering format, and inclusion in the sidebar. By utilizing this plugin, you can easily manage and navigate through your documentation headers, ensuring consistency and improved readability.

Demo pages

| Page link | Description | |-|-| | | The autoHeader of this page is: @autoHeader:1.Assuming the original configuration is used, the splitter is . and the levels are H1-H6. | | | The autoHeader of this page is: <!-- autoHeader:11.22.33.44.55.66 -->.Assuming the original configuration is used, the splitter is . and the levels are H1-H6. | | | The autoHeader of this page is: @autoHeader:.Assuming the original configuration is used, the splitter is . and the levels are H1-H6. | | | The autoHeader of this page is: <!-- autoHeader:Z.Y -->.Assuming the original configuration is used, the splitter is . and the levels are H1-H6. | | | The autoHeader of this page is: <!-- autoHeader:1-2-3 -->.Assuming the original configuration is used, the splitter is . and the levels are H1-H6. |

Installation

!> Note: There are breaking changes in the configuration from v4.x to v5.x. Please take the time to read all the documentation before upgrading

Update index.html file

Assuming you have a working docsify framework set up, it is easy to use the plugin.

  1. Add one of the following script tags to your index.html via either CDN or downloading it and using it locally:

    <!-- unpkg.com -->
    <script src="https://unpkg.com/@markbattistella/docsify-auto-headers@latest"></script>
    
    <!-- jsDelivr -->
    <script src="https://cdn.jsdelivr.net/npm/@markbattistella/docsify-auto-headers@latest"></script>
    
    <!-- locally -->
    <script src="docsify-auto-headers.min.js"></script>
  2. In docsify setup, configure the plugin:

    <script>
    window.$docsify = {
      autoHeaders: {
    
        // Separator for header numbering (e.g., '.', '-', ')')
        separator: '.',
    
        // Boolean indicating if headers should be added to the sidebar
        sidebar: false,
    
        // Number of header levels to include (1 to 6) or an object with start and finish properties
        levels: 6,
        // levels: { start: 1, finish: 6 }
    
        // Boolean to enable or disable debug messages
        debug: false
      }
    };
    </script>

Configuration

There are several options available for the docsify-auto-headers plugin:

| Setting | Type | Options | |-------------|---------|-------------------------------------| | separator | String | e.g., ., -, ) | | sidebar | Boolean | true or false | | levels | Number | 1 to 6 | | | Object | { start: Number, finish: Number } | | debug | Boolean | true or false |

Usage

The plugin can be configured to apply scoped heading counts in either the sidebar or the main content, depending on your setup.

Sidebar

If the sidebar option is enabled, the headers will be included in the sidebar and processed before rendering the markdown.

Main Content

If the sidebar option is disabled, the headers will be processed and applied directly to the HTML after rendering.

Contributing

  1. Clone the repo:git clone https://github.com/markbattistella/docsify-auto-headers.git

  2. Create your feature branch:git checkout -b my-feature

  3. Commit your changes:git commit -am 'Add some feature'

  4. Push to the branch:git push origin my-new-feature

  5. Submit the pull request