All Projects → hustcc → Hint

hustcc / Hint

重构到 ---> https://github.com/hustcc/lint-md

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Hint

Bluedoc
An open-source document management tool for enterprise self host.
Stars: ✭ 579 (+1830%)
Mutual labels:  markdown, gitbook
Ok Mdx
Browser-based MDX editor
Stars: ✭ 681 (+2170%)
Mutual labels:  cli, markdown
Marp Cli
A CLI interface for Marp and Marpit based converters
Stars: ✭ 606 (+1920%)
Mutual labels:  cli, markdown
Beibq
基于flask开发类似gitbook的知识管理网站。 http://demo.beibq.cn
Stars: ✭ 480 (+1500%)
Mutual labels:  markdown, gitbook
Friends
Spend time with the people you care about. Introvert-tested. Extrovert-approved.
Stars: ✭ 737 (+2356.67%)
Mutual labels:  cli, markdown
Things.sh
Simple read-only comand-line interface to your Things 3 database
Stars: ✭ 492 (+1540%)
Mutual labels:  cli, travis-ci
Backslide
💦 CLI tool for making HTML presentations with Remark.js using Markdown
Stars: ✭ 679 (+2163.33%)
Mutual labels:  cli, markdown
Nb
CLI and local web plain text note‑taking, bookmarking, and archiving with linking, tagging, filtering, search, Git versioning & syncing, Pandoc conversion, + more, in a single portable script.
Stars: ✭ 3,846 (+12720%)
Mutual labels:  cli, markdown
Remark Lint
Markdown code style linter
Stars: ✭ 718 (+2293.33%)
Mutual labels:  lint, markdown
Gatsby Gitbook Starter
Generate GitBook style modern docs/tutorial websites using Gatsby + MDX
Stars: ✭ 700 (+2233.33%)
Mutual labels:  markdown, gitbook
Vscode Markdownlint
Markdown linting and style checking for Visual Studio Code
Stars: ✭ 444 (+1380%)
Mutual labels:  lint, markdown
Feflow
🚀 A command line tool aims to improve front-end engineer workflow and standard, powered by TypeScript.
Stars: ✭ 942 (+3040%)
Mutual labels:  lint, cli
Md To Pdf
Hackable CLI tool for converting Markdown files to PDF using Node.js and headless Chrome.
Stars: ✭ 374 (+1146.67%)
Mutual labels:  cli, markdown
Mask
🎭 A CLI task runner defined by a simple markdown file
Stars: ✭ 495 (+1550%)
Mutual labels:  cli, markdown
J
❌ Multi-format spreadsheet CLI (now merged in http://github.com/sheetjs/js-xlsx )
Stars: ✭ 343 (+1043.33%)
Mutual labels:  cli, markdown
Lint Md
📚 检查中文 markdown 编写格式规范的命令行工具,基于 AST,方便集成 ci,写博客 / 文档必备。支持 API 调用!
Stars: ✭ 662 (+2106.67%)
Mutual labels:  lint, markdown
Reviewdog
🐶 Automated code review tool integrated with any code analysis tools regardless of programming language
Stars: ✭ 4,541 (+15036.67%)
Mutual labels:  lint, cli
Markserv
🏁 serve markdown as html (GitHub style), index directories, live-reload as you edit
Stars: ✭ 304 (+913.33%)
Mutual labels:  cli, markdown
Awesome bot
✅ Validate links in awesome projects
Stars: ✭ 697 (+2223.33%)
Mutual labels:  cli, travis-ci
Glow
Render markdown on the CLI, with pizzazz! 💅🏻
Stars: ✭ 7,596 (+25220%)
Mutual labels:  cli, markdown

hint

A simple markdown lint / hint cli-tool, for markdown developer integrated with travis. Python 2 / 3 supported.

一个简单的 markdown 静态检查的控制台 cli 工具,可以方便 markdown 开发者轻松集成 travis 自动检测。支持 Python 2 / 3。

Latest Stable Version Build Status

一、安装

pip install hint

然后在系统中会得到一个 hint 的命令 cli 工具。

二、使用

使用方法有两种:

2.1 一种是命令行 cli 方式,简单使用方法如下:

hint markdown_file

或者

hint markdown_folder

或者使用 hint --help 查看帮助信息和具体详细的使用方法。

$ hint --help
Usage: hint-script.py [OPTIONS] FILE

Options:
  -i, --ignore TEXT         The error codes which will be ignored.
  -f, --format [text|json]  The output format of error information.
  -m, --max-depth INTEGER   The max depth for traverse the path.
  --help                    Show this message and exit.

可以用于直接集成到各种 ci 系统中,例如 travis-ci。

2.2 另外一种是代码 API 调用的方式,简单使用方法如下:

import hint

text='''
hint 是一个简单的 **markdown** 静态检查的控制台 `cli` 工具。
可以方便 markdown 开发者轻松集成 travis 自动检测。
'''
errors = hint.check(text, ignore='E201')

fn = 'README.md'
errors = hint.check_file(fn, format='text')

可以方便的进行第三方扩展开发。

三、错误码

检查规则来源于 chinese-copywriting-guidelines,错误码命名方式参考于 flake8。目前支持的错误码如下所示:

错误码 检查类型 详细描述 完成
E101 空格 中英文之间需要增加空格 done
E102 空格 中文与数字之间需要增加空格 done
E103 空格 全角标点与其他字符之间不加空格 done
E104 空格 除了%、℃、°、以及倍数单位(如 2x、3n)之外,数字与单位之间需要增加空格 done
E201 标点 不重复使用标点符号 done
E202 标点 只有中文或中英文混排中,一律使用中文全角标点 done
E203 标点 如果出现整句英文,则在这句英文中使用英文、半角标点 done
E204 标点 省略号请使用……标准用法 done
E205 标点 英文和后面的半角标点之间不需要空格 done
E301 数字 数字使用半角字符 done

关于各种错误码的正确、错误范例,可以参考 tests/md目前有了大概的代码结构,欢迎 PR 更多的检查错误类型和检查方式

LICENSE

MIT @hustcc.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].