1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//! Per-language code block linting and formatting using external tools.
//!
//! This module provides infrastructure for running external formatters and linters
//! on fenced code blocks in markdown files, based on their language tags.
//!
//! # Overview
//!
//! When enabled, rumdl can process code blocks using external tools:
//! - **Lint mode** (`rumdl check`): Run linters and report diagnostics
//! - **Format mode** (`rumdl check --fix` / `rumdl fmt`): Run formatters and update content
//!
//! # Configuration
//!
//! Code block tools are disabled by default. Enable and configure in `.rumdl.toml`:
//!
//! ```toml
//! [code-block-tools]
//! enabled = true
//! normalize-language = "linguist" # Resolve aliases like "py" -> "python"
//! on-error = "fail" # or "skip" / "warn"
//! timeout = 30000 # ms per tool
//!
//! [code-block-tools.languages.python]
//! lint = ["ruff:check"]
//! format = ["ruff:format"]
//!
//! [code-block-tools.languages.shell]
//! lint = ["shellcheck"]
//! format = ["shfmt"]
//!
//! [code-block-tools.language-aliases]
//! py = "python"
//! bash = "shell"
//! ```
//!
//! # Built-in Tools
//!
//! Common tools are pre-configured:
//! - `ruff:check`, `ruff:format` - Python
//! - `prettier`, `prettier:json`, etc. - JavaScript, JSON, YAML, etc.
//! - `shellcheck`, `shfmt` - Shell scripts
//! - `rustfmt` - Rust
//! - `gofmt`, `goimports` - Go
//! - And many more (see [`registry`] module)
//!
//! # Custom Tools
//!
//! Define custom tools in configuration:
//!
//! ```toml
//! [code-block-tools.tools.my-formatter]
//! command = ["my-tool", "--format"]
//! stdin = true
//! stdout = true
//! ```
//!
//! # Language Resolution
//!
//! With `normalize-language = "linguist"` (default), common aliases are resolved:
//! - `py`, `python3` → `python`
//! - `bash`, `sh`, `zsh` → `shell`
//! - `js`, `node` → `javascript`
//!
//! See [`linguist`] module for the full list.
pub use ;
pub use ;
pub use LinguistResolver;
pub use ;
pub use ToolRegistry;