中文 markdown 格式校验 lint-md v0.1.0,支持 --fix 参数

栏目: 软件资讯 · 发布时间: 7年前

内容简介:用于检查中文 markdown 编写格式规范的命令行工具,基于 AST 开发,且方便集成 ci;同时提供 API 方法调用。Cli tool to lint your markdown file for Chinese. 安装 npm i -g lint-md 使用 Usage: <lint-md> <...

用于检查中文 markdown 编写格式规范的命令行工具,基于 AST 开发,且方便集成 ci;同时提供 API 方法调用。Cli tool to lint your markdown file for Chinese.

安装

npm i -g lint-md

使用

Usage: <lint-md> <files...> [options]

lint your markdown files

Options:
  -v, --version                  output the version number
  -c, --config [configure-file]  use the configure file, default .lintmdrc
  -f, --fix                      fix the errors automatically
  -h, --help                     output usage information
  • 校验 lint

lint-md README.md Document.md
  • 修复 fix

lint-md README.md Document.md --fix

API 调用

import { lint, fix, getDescription } from 'lint-md';

// get the markdown 's style errors
const errors = lint(markdown, rules);

// get the error type description
const describe = getDescription(type[, lang = 'en_US']);

// fix the markdown
const fixed = fix(markdown);
  • lint(markdown, rules):通过 API 方式来校验 markdown 文本;

  • fix(markdown):通过 API 方式来修复文本;

  • getDescription(type):获取错误类型的文本描述,包含多语言;

  • version:获得模块的版本号;

其他相关

License

MIT@hustcc.


以上所述就是小编给大家介绍的《中文 markdown 格式校验 lint-md v0.1.0,支持 --fix 参数》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Head First PHP & MySQL(中文版)

Head First PHP & MySQL(中文版)

Lynn Beighley、Michael Morrison / 苏金国、徐阳 / 中国电力 / 2010-6 / 98.00元

通过《深入浅出PHP&MySQL(影印版)》,你将学习:准备好把你的静态HTML网页提升到下一个层次并使用PHP和MySQL建立数据库驱动的网站了吗?《深入浅出PHP& MysQL》是一本快捷实用的指南,让你的动态网站快速运行。自己动手建立实际应用程序,从视频游戏高分留言板到在线交友网站。当你完成后,你将可以进行验证表单、使用会话ID和cookies工作、执行数据库查询和联接、处理文件I/0操作等......一起来看看 《Head First PHP & MySQL(中文版)》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具