open-md-checker
Open source markdown lint
Last updated 5 months ago by openxlab .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install open-md-checker 
SYNC missed versions from official npm registry.

open-md-checker

open-md-checker is an open source module for markdown file format checking.

Getting start

Install

npm i -g open-md-checker

Run

# open-md-checker

Docs

The definition of Config

interface Config {
  requires?: string;
  patterns: string[];
  options: {
    useGitIgnore?: boolean;
    usePackageJson?: boolean;
    configKey?: string;
    gitIgnoreFile?: string;
    ignore?: string[];
    cwd?: string;
  };
}
  • requires(optional): Path to the js file containing the user deinfined rules, the default configuration is declare in the src/default_requires.js
  • For the rest configuration, please refer to deglob

Default config

{
  patterns: [ '**/*.md' ],
  options: {
    useGitIgnore: true,
    ignore: [ 'node_modules/**/*' ],
  },
}

Customer configuration

Note: In order to facilitate the user to integrate the configuration into the package.json file, after loading the configuration file, the configuration will be read from the open-md-checker field, so the specific configuration should be included in the open-md-checker field, for example:

{
  "open-md-checker": {
    "requires": "./requires.js",
    "patterns": [ "**/*.md" ],
    "options": {
      "useGitIgnore": true,
      "ignore": [ "node_modules/**/*" ]
    }
  }
}

You can place the configuration anywhere and specify the file location by setting the MD_LINT_CONFIG_PATH environment variable. E.g

# export MD_LINT_CONFIG_PATH=./open-md-checker.json
# open-md-checker

Customer open-md-checker rules

You can specify which checks are enabled. This option requires a js file, for example:

module.exports = [
  require('remark-lint-final-newline'),
  require('remark-lint-list-item-bullet-indent')
]

The js file can be placed in any location and specified by the requires field in the configuration. If it is a relative path, the current path is automatically added to form an absolute path.

docker

build

# docker build -t open-md-checker .

run

# docker run -it -v src/path:/github/workspace open-md-checker

Current Tags

  • 1.2.3                                ...           latest (5 months ago)

7 Versions

  • 1.2.3                                ...           5 months ago
  • 1.1.3                                ...           5 months ago
  • 1.1.2                                ...           5 months ago
  • 1.0.1                                ...           5 months ago
  • 1.0.0                                ...           5 months ago
  • 0.0.2                                ...           5 months ago
  • 0.0.1                                ...           5 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dev Dependencies (4)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |