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

markdownlint-rule-trace-template-headers

v2.0.3

Published

markdownlint custom rule that checks the headers is same to template

Downloads

54

Readme

markdownlint-rule-trace-template-headers

A custom markdownlint rule that provides the functionality to check the headers of a Markdown file based on the headers of a template file, verifying the match and order of the headers.

This package is compatible with markdownlint-cli2 and not markdownlint-cli.

Usage

CLI

  1. Install dependencies.

    npm install -D markdownlint-cli2 @lainNao/markdownlint-trace-template-headers
  2. Create config file.

    touch .markdownlint-cli2.jsonc
  3. Edit .markdownlint-cli2.jsonc .

    • if markdownlint-rule-trace-template-headers is v2 or higher
    {
      "customRules": [
        "markdownlint-rule-trace-template-headers"
      ],
      "config": {
        "markdownlint-rule-trace-template-headers": {
          "settings": [
            {
              "templateFile": "YOUR_TEMPLATE_FILE.md", // template headers file
              "includedFiles": ["*.md"], // files to lint
              "excludedFiles": [] // files to exclude
            },
            ...
          ]
        }
      }
    }
    • if markdownlint-rule-trace-template-headers is v1 or lower
    {
      "customRules": [
        "markdownlint-rule-trace-template-headers"
      ],
      "config": {
        "markdownlint-rule-trace-template-headers": {
          "templateFile": "YOUR_TEMPLATE_FILE.md", // template headers file
          "includedFiles": ["*.md"], // files to lint
          "excludedFiles": [] // files to exclude
        }
      }
    }
  4. Run lint.

    npx markdownlint-cli2 SOME_MARKDOWN_FILE.md

VSCode

  1. Install markdownlint in your VSCode extensions marketplace.
  2. Create and edit .markdownlint-cli2.jsonc like above.
  3. Verify the lint rule works works in Editor.

Other

To disable the rule, edit .markdownlint-cli2.jsonc .

{
  "customRules": [
    "markdownlint-rule-trace-template-headers"
  ],
  "config": {
    "markdownlint-rule-trace-template-headers": false    // change this value to falsy
  }
}

TODO

  • Improve CI/CD. Add auto tests and auto versioning, updating changelog, release scripts.
  • Create CONTRIBUTION.md
  • Config to select error/warn