Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- id: mdrefcheck
name: mdrefcheck
description: Validate references in Markdown files
entry: mdrefcheck
language: python
types: [markdown]
args: []
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Changelog

## [0.1.4] - 2025-09-14
## [0.1.5] - 2025-09-14

### CI

- Move cargo pyblish before artifacts staff
- Move cargo publish before artifacts staff

## [0.1.3] - 2025-09-14

Expand Down
41 changes: 34 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# mdrefcheck

**mdrefcheck** is a CLI tool to validate references and links in Markdown files (CommonMark spec).
It helps ensure that your documentation is free from broken links, missing images, and invalid section anchors.

---
A CLI tool to validate references and links in Markdown files (CommonMark spec).
It helps to ensure that your documentation is free from broken section links, missing images or files.

## Features

Expand All @@ -12,12 +10,41 @@ It helps ensure that your documentation is free from broken links, missing image
- Identify broken reference-style links
- Email validation

---

## Installation

From PyPI:
### Cargo

`mdrefcheck` is also published on [crates.io](https://crates.io/) and can be installed
with cargo:

```bash
cargo install mdrefcheck
```

### PyPI

`mdrefcheck` can be installed with

```bash
pip install mdrefcheck
```

It also can be used as a tool in an isolated environment, e.g., with `uvx`:

```bash
uvx mdrefcheck .
```

### Pre-commit integration

You can use `mdrefcheck` as a pre-commit hook.

Add this to your `.pre-commit-config.yaml`:

```yaml
repos:
- repo: https://github.com/gospodima/mdrefcheck
rev: v0.1.5
hooks:
- id: mdrefcheck
```
3 changes: 2 additions & 1 deletion release.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pre-release-replacements = [
{file="pyproject.toml", search='version = "[a-z0-9\\.-]+"', replace='version = "{{version}}"'}
{file="pyproject.toml", search='version = "[a-z0-9\\.-]+"', replace='version = "{{version}}"'},
{file="README.md", search='rev: v[a-z0-9\\.-]+', replace='rev: v{{version}}'}
]
pre-release-commit-message = "chore(release): prepare for {{version}}"
4 changes: 1 addition & 3 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ use std::path::PathBuf;
use clap::Parser;
use regex::Regex;

// TODO: add dir exclusion similar to files

/// CLI configuration for mdrefcheck
#[derive(Parser, Debug)]
#[command(name = "mdrefcheck", about = "Check markdown references.")]
#[command(name = "mdrefcheck", about = "Check markdown references.", version)]
pub struct CliConfig {
/// Paths to check
#[arg(required = true, value_name = "PATH")]
Expand Down
Loading