norberttech/md-link-linter
Composer 安装命令:
composer require norberttech/md-link-linter
包简介
Markdown link linter
README 文档
README
Simple command line tool that aims to detect invalid links in markdown files.
Currently following types of links are being validated:
- relative links
- anchor links
- mention links
bin/mdlinklint path --exclude=vendor --exclude=node_modules
Use with Docker:
docker run -t --rm -v $PWD:/app norberttech/md-link-linter --exclude=vendor --exclude=node_modules .
First argument path can be skipped or overwritten by environment variable MD_LINTER_SCAN_DIR
MD_LINTER_SCAN_DIR=path bin/mdlinklint --exclude=vendor --exclude=node_modules
When both, argument path and environment variable are present, environment variable takes priority.
./mdlinklint --help Usage: run [options] [--] [<path>] Arguments: path Path in which md link linter should validate all markdown files Options: --dry-run Scan path and output md files --exclude=EXCLUDE Exclude folders with this name (multiple values allowed) --mention=MENTION Mentions whitelist (can include all team members or groups), if empty mentions are not validated (multiple values allowed) -h, --help Display help for the given command. When no command is given display help for the run command -q, --quiet Do not output any message -V, --version Display this application version --ansi Force ANSI output --no-ansi Disable ANSI output -n, --no-interaction Do not ask any interactive question -bf, --break-on-failure Break the inspection on first failure -rp, --root-path=ROOT-PATH Root path used to assert absolute links. Link: [link](/nested/file.php) will check if file /nested/file.php exists from this path -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
Validating mentions
Using --mention option you can set allowed mentions
bin/mdlinklint path --mentions=norberttech --mention=team_name
If not used, mention link assertion will always pass.
Installation
Docker
Recommended - md-link-linter is not a type of tool you want to put into your project as a dependency because it comes with it own dependencies that might overlaps with yours.
Docker Hub - norberttech/md-link-linter
Composer
composer global require norberttech/md-link-linter
Phive
Since md-link-linter relay on \realpath function which does not work in Phar environment (explanation below)
there are no plans for now to make it available through phive.
The function realpath() will not work for a file which is inside a Phar as such path would be a virtual path, not a real one.
php.net realpath documentation
Development
Install dependencies
composer install
Run tests
composer tests
Codding standards
This command might change your code!
composer cs:php:fix
norberttech/md-link-linter 适用场景与选型建议
norberttech/md-link-linter 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 651 次下载、GitHub Stars 达 13, 最近一次更新时间为 2019 年 12 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「linter」 「markdown」 「link」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 norberttech/md-link-linter 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 norberttech/md-link-linter 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 norberttech/md-link-linter 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Texy converts plain text in easy to read Texy syntax into structurally valid (X)HTML. It supports adding of images, links, nested lists, tables and has full support for CSS. Texy supports hyphenation of long words (which reflects language rules), clickable emails and URL (emails are obfuscated again
A couple of handy form fields and objects for managing external and internal links on DataObjects
PHP library that allows linking queries from diferent physical databases using mysql pdo database connections
Custom links on your sidebar for Laravel Nova.
Set Links with a specific language parameter
Lot's of tools for git, file and static source code analysis.
统计信息
- 总下载量: 651
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 13
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-12-15
