diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml new file mode 100644 index 0000000..8c17e83 --- /dev/null +++ b/.pre-commit-hooks.yaml @@ -0,0 +1,7 @@ +- id: mdrefcheck + name: mdrefcheck + description: Validate references in Markdown files + entry: mdrefcheck + language: python + types: [markdown] + args: [] \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 20a4083..6b7e7d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/README.md b/README.md index bcf4f68..bf8d9c6 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 +``` diff --git a/release.toml b/release.toml index 4bbdbef..a362c25 100644 --- a/release.toml +++ b/release.toml @@ -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}}" diff --git a/src/config.rs b/src/config.rs index 7a97960..e2acdfc 100644 --- a/src/config.rs +++ b/src/config.rs @@ -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")]