### Correct HTML Heading
Source: https://github.com/rvben/rumdl/blob/main/docs/md041.md
HTML headings like '
Getting Started Guide
' are also recognized as valid document titles.
```html
Getting Started Guide
Welcome to our documentation! This guide will help you...
```
--------------------------------
### Correct Markdown Heading
Source: https://github.com/rvben/rumdl/blob/main/docs/md041.md
A document should start with a top-level heading like '# Getting Started Guide'.
```markdown
# Getting Started Guide
Welcome to our documentation! This guide will help you...
```
```markdown
# Project README
This project provides tools for...
```
--------------------------------
### Install Development Tools
Source: https://github.com/rvben/rumdl/blob/main/CONTRIBUTING.md
Install necessary development tools using `make dev-setup` or manually install Cargo tools.
```bash
make dev-setup
```
```bash
cargo install cargo-nextest cargo-watch maturin
```
--------------------------------
### Manual Neovim LSP Setup for Markdown
Source: https://github.com/rvben/rumdl/blob/main/docs/usage/editors.md
Manually configure Neovim to start the rumdl language server for markdown files.
```lua
vim.api.nvim_create_autocmd("FileType", {
pattern = "markdown",
callback = function()
vim.lsp.start({
name = "rumdl",
cmd = { "rumdl", "server" },
root_dir = vim.fs.dirname(vim.fs.find({".rumdl.toml", ".git"}, { upward = true })[1]),
})
end,
})
```
--------------------------------
### Install Pre-commit Hooks
Source: https://github.com/rvben/rumdl/blob/main/docs/usage/pre-commit.md
Run this command after adding the hooks to your configuration file to install them.
```bash
pre-commit install
```
--------------------------------
### rumdl Installation Methods
Source: https://github.com/rvben/rumdl/blob/main/docs/markdownlint-comparison.md
Demonstrates various methods for installing rumdl, including using 'uv', 'cargo', 'pip', and 'brew'. Choose the method that best suits your environment.
```bash
uv tool install rumdl
```
```bash
# or: cargo install rumdl
```
```bash
# or: pip install rumdl
```
```bash
# or: brew install rumdl (See README.md)
```
--------------------------------
### Install and use rumdl with uv
Source: https://github.com/rvben/rumdl/blob/main/docs/getting-started/installation.md
Install rumdl as a tool using uv, or run it directly without installation using uvx.
```bash
# Install as a tool
uv tool install rumdl
# Or run without installing
uvx rumdl check .
```
--------------------------------
### Text Mismatch TOC Example
Source: https://github.com/rvben/rumdl/blob/main/docs/md073.md
Shows a text mismatch where the TOC entry text ('Install') does not exactly match the actual heading text ('Installation').
```markdown
- [Install](#installation) <-- Should be "Installation"
## Installation
Content.
```
--------------------------------
### Full Output Format Example
Source: https://github.com/rvben/rumdl/blob/main/docs/usage/cli.md
Example of the 'full' output format, which displays source lines with caret underlines highlighting the violation. This format is useful for detailed debugging.
```text
MD013 Line length 95 exceeds 80 characters
--> README.md:42:81
|
42 | This is a long line that exceeds the configured maximum line length ...
| ^^^
|
```
--------------------------------
### Example rumdl Configuration
Source: https://github.com/rvben/rumdl/blob/main/docs/getting-started/quickstart.md
An example `.rumdl.toml` file demonstrating global settings and specific rule configurations for line length, inline HTML, and first line headings.
```toml
[global]
# Exclude files/directories
exclude = ["node_modules", "vendor", ".git"]
# Set line length limit
line-length = 120
[MD013] # Line length
line_length = 120
code_blocks = false # Don't check code blocks
[MD033] # No inline HTML
allowed_elements = ["br", "details", "summary"]
[MD041] # First line heading
enabled = false # Disable this rule
```
--------------------------------
### Verify Development Setup
Source: https://github.com/rvben/rumdl/blob/main/CONTRIBUTING.md
Run `make dev-verify` to ensure the development environment is set up correctly.
```bash
make dev-verify
```
--------------------------------
### Install and use rumdl with uv
Source: https://github.com/rvben/rumdl/blob/main/README.md
Install rumdl directly using uv for faster package management, or use uvx to run rumdl commands without installation.
```bash
uv tool install rumdl
```
```bash
uvx rumdl check .
```
--------------------------------
### Start LSP Server
Source: https://github.com/rvben/rumdl/blob/main/docs/usage/cli.md
Initiate the Language Server Protocol server for integration with editors.
```bash
rumdl server # Start Language Server Protocol server
```
--------------------------------
### GFM Configuration Example
Source: https://github.com/rvben/rumdl/blob/main/docs/flavors/gfm.md
Example TOML configuration to set the flavor to 'gfm'.
```toml
[global]
flavor = "gfm"
```
--------------------------------
### Pandoc Example Lists
Source: https://github.com/rvben/rumdl/blob/main/docs/flavors/pandoc.md
Format lists using Pandoc's example list syntax, indicated by `(@)` prefixes.
```markdown
(@) The first example.
(@good) The second example.
(@) The third example.
As shown in (@good), this approach works.
```
--------------------------------
### Query a specific configuration key
Source: https://github.com/rvben/rumdl/blob/main/README.md
Query a specific configuration key using `config get `. Examples include `global.exclude` or `MD013.line_length`.
```bash
rumdl config get global.exclude
```
--------------------------------
### Comprehensive rumdl TOML configuration example
Source: https://context7.com/rvben/rumdl/llms.txt
This example `.rumdl.toml` demonstrates inheriting settings, defining global options, excluding/including files, enabling caching, and configuring per-file overrides for flavor and rule ignores. It also shows rule-specific configurations and per-language code block linting/formatting.
```toml
# .rumdl.toml — comprehensive example
# Inherit settings from a parent config
extends = "../base.rumdl.toml"
[global]
# Markdown flavor: standard | gfm | mkdocs | mdx | pandoc | quarto | obsidian | kramdown | azure_devops
flavor = "mkdocs"
line-length = 120
# Disable rules globally
disable = ["MD013", "MD033"]
# Enable opt-in rules (not on by default)
extend-enable = ["MD060", "MD063"]
# Additive disable on top of inherited config
extend-disable = ["MD041"]
# File selection
exclude = ["node_modules", "dist", "docs/generated/**", "*.tmp.md"]
include = ["docs/**/*.md", "README.md"]
respect-gitignore = true
# Caching (dramatically speeds up repeat runs)
cache = true
cache-dir = ".rumdl_cache"
# Output format: text | json | grouped | concise | github | gitlab | azure | pylint | junit | json-lines
output-format = "text"
# Per-file flavor overrides
[per-file-flavor]
"**/*.mdx" = "mdx"
"**/*.qmd" = "quarto"
"docs/jekyll/**/*.md" = "kramdown"
# Disable specific rules for specific files
[per-file-ignores]
"README.md" = ["MD033"] # Allow HTML in README
"SUMMARY.md" = ["MD025"] # Allow multiple H1 in table of contents
"docs/api/**/*.md" = ["MD013", "MD041"] # Relax rules for generated API docs
# Rule-specific configuration
[MD007]
indent = 2
[MD013]
line-length = 120
code-blocks = false
tables = false
headings = false
reflow = true # Enable auto line-wrapping (required for --fix)
[MD025]
level = 1
front-matter-title = "title"
[MD040]
allowed-languages = ["python", "bash", "rust", "javascript"]
disallowed-languages = []
preferred-aliases = { python = "py", javascript = "js" }
[MD044]
names = ["rumdl", "Markdown", "GitHub", "JavaScript"]
code-blocks = false
[MD048]
code-fence-style = "backtick" # backtick | tilde
[MD060]
enabled = true
style = "aligned" # aligned | compact
# Per-language code block linting/formatting with external tools
[code-block-tools]
enabled = true
normalize-language = "linguist"
on-error = "warn"
timeout = 30000
[code-block-tools.languages.python]
lint = ["ruff:check"]
format = ["ruff:format"]
[code-block-tools.languages.javascript]
format = ["prettier:format"]
```
--------------------------------
### Install mdformat with Plugins
Source: https://github.com/rvben/rumdl/blob/main/docs/mdformat-comparison.md
Install mdformat along with common plugins for extended syntax support like GFM and frontmatter.
```bash
pip install mdformat
# With plugins:
pip install mdformat-gfm mdformat-frontmatter
```
--------------------------------
### CircleCI Setup for rumdl
Source: https://github.com/rvben/rumdl/blob/main/docs/usage/ci-cd.md
Sets up a CircleCI job to install and execute rumdl. It utilizes a Python Docker image and installs rumdl using pip.
```yaml
version: 2.1
jobs:
lint:
docker:
- image: cimg/python:3.12
steps:
- checkout
- run:
name: Install rumdl
command: pip install rumdl
- run:
name: Lint Markdown
command: rumdl check .
workflows:
main:
jobs:
- lint
```
--------------------------------
### Example .rumdl.toml Configuration
Source: https://github.com/rvben/rumdl/blob/main/README.md
A comprehensive example of a `.rumdl.toml` file, demonstrating global settings, per-file flavor overrides, rule exclusions, and individual rule configurations, including code block tool settings.
```toml
[global]
line-length = 100
exclude = ["node_modules", "build", "dist"]
respect-gitignore = true
flavor = "mkdocs" # Use MkDocs flavor (see Flavors section)
disable = ["MD013", "MD033"]
# Per-file flavor overrides
[per-file-flavor]
"**/*.mdx" = "mdx"
# Disable specific rules for specific files
[per-file-ignores]
"README.md" = ["MD033"] # Allow HTML in README
"SUMMARY.md" = ["MD025"] # Allow multiple H1 in table of contents
"docs/api/**/*.md" = ["MD013", "MD041"] # Relax rules for generated docs
# Configure individual rules
[MD007]
indent = 2
[MD013]
line-length = 100
code-blocks = false
tables = false
reflow = true # Enable automatic line wrapping (required for --fix)
[MD025]
level = 1
front-matter-title = "title"
[MD044]
names = ["rumdl", "Markdown", "GitHub"]
[MD048]
code-fence-style = "backtick"
# Code block tools (optional)
[code-block-tools]
enabled = true
normalize-language = "linguist"
on-error = "warn"
timeout = 30000
[code-block-tools.language-aliases]
py = "python"
bash = "shell"
[code-block-tools.languages.python]
lint = ["ruff:check"]
format = ["ruff:format"]
```
--------------------------------
### Example Rumdl Configuration
Source: https://github.com/rvben/rumdl/blob/main/README.md
This TOML snippet shows an example of Rumdl's configuration, including global settings and rule-specific options. It illustrates how settings can be inherited from defaults, project configuration files, or pyproject.toml.
```text
[global]
enable = [] [from default]
disable = ["MD033"] [from .rumdl.toml]
include = ["README.md"] [from .rumdl.toml]
respect_gitignore = true [from .rumdl.toml]
[MD013]
line_length = 200 [from .rumdl.toml]
code_blocks = true [from .rumdl.toml]
...
```
--------------------------------
### Install Pre-commit Hooks
Source: https://github.com/rvben/rumdl/blob/main/CONTRIBUTING.md
Install pre-commit hooks for code quality, commit message validation, and pre-push checks.
```bash
prek install # Code quality hooks
prek install --hook-type commit-msg # Conventional commits validation
prek install --hook-type pre-push # Comprehensive validation
```
--------------------------------
### Full rumdl Configuration Example
Source: https://github.com/rvben/rumdl/blob/main/docs/link-validation.md
A comprehensive example of a .rumdl.toml configuration file, including global settings, rule severities, and per-file ignores for relative link validation and MkDocs navigation.
```toml
# .rumdl.toml
[global]
flavor = "mkdocs"
# Relative link validation
[MD057]
absolute-links = "relative_to_docs"
severity = "warning"
# Anchor validation (auto-detects python-markdown style with mkdocs flavor)
[MD051]
severity = "warning"
# Nav validation
[MD074]
not-found = "warn"
omitted-files = "warn"
absolute-links = "warn"
# Exclude generated content from link checks
[per-file-ignores]
"docs/generated/**/*.md" = ["MD057"]
```
--------------------------------
### Install rumdl with Homebrew
Source: https://github.com/rvben/rumdl/blob/main/docs/getting-started/installation.md
Install rumdl using Homebrew by adding the rvben/tap repository.
```bash
brew install rvben/tap/rumdl
```
--------------------------------
### Install rumdl with Nix (macOS/Linux)
Source: https://github.com/rvben/rumdl/blob/main/README.md
Install rumdl using Nix package manager. This includes updating channels and installing the package, or using flakes for running without installation.
```bash
nix-channel --update
nix-env --install --attr nixpkgs.rumdl
```
```bash
nix run --extra-experimental-features 'flakes nix-command' nixpkgs/nixpkgs-unstable#rumdl -- --version
```
--------------------------------
### Install rumdl with Nix
Source: https://github.com/rvben/rumdl/blob/main/docs/getting-started/installation.md
Install rumdl using Nix package manager, or use flakes to run it without installation.
```bash
# Update Nix channels
nix-channel --update
# Install rumdl using nix-env
nix-env --install --attr nixpkgs.rumdl
# Or use flakes to run without installation
nix run nixpkgs#rumdl -- --version
```
--------------------------------
### Install rumdl
Source: https://github.com/rvben/rumdl/blob/main/docs/mdformat-comparison.md
Install rumdl using various package managers or directly as a single binary.
```bash
# Any of these:
cargo install rumdl
pip install rumdl
brew install rumdl
uv tool install rumdl
```
--------------------------------
### Global User Configuration Example
Source: https://github.com/rvben/rumdl/blob/main/README.md
Define global user preferences in '~/.config/rumdl/rumdl.toml' or '~/.rumdl.toml' to apply them across all projects. This example disables specific rules and sets an indent for MD007.
```toml
[global]
line-length = 100
disable = ["MD013", "MD041"]
[MD007]
indent = 2
```
--------------------------------
### Install rumdl with pip
Source: https://github.com/rvben/rumdl/blob/main/docs/getting-started/installation.md
Install rumdl using pip, the package installer for Python.
```bash
pip install rumdl
```
--------------------------------
### Install rumdl with winget
Source: https://github.com/rvben/rumdl/blob/main/docs/getting-started/installation.md
Use winget to install the rumdl package. Ensure you use the --exact flag for precise installation.
```powershell
winget install --id rvben.rumdl --exact
```
--------------------------------
### Install rumdl-wasm
Source: https://github.com/rvben/rumdl/blob/main/wasm-pkg/README.md
Install the rumdl-wasm package using npm.
```bash
npm install rumdl-wasm
```
--------------------------------
### rumdl Configuration Example
Source: https://github.com/rvben/rumdl/blob/main/docs/mdformat-comparison.md
Example of a rumdl configuration file using TOML format. Sets global options like line length and flavor, and specific rule configurations for list markers and line length.
```toml
# .rumdl.toml
[global]
line-length = 80
flavor = "gfm"
[MD004]
style = "dash" # List marker style
[MD013]
line-length = 80
```
--------------------------------
### Install Rumdl VS Code Extension
Source: https://github.com/rvben/rumdl/blob/main/docs/vscode-extension.md
Use the rumdl CLI to install the VS Code extension. This is the recommended method for users who have rumdl installed.
```bash
rumdl vscode
```
```bash
rumdl vscode --status
```
```bash
rumdl vscode --update
```
```bash
rumdl vscode --force
```
--------------------------------
### Install VS Code Extension
Source: https://github.com/rvben/rumdl/blob/main/docs/usage/cli.md
Manage the VS Code extension installation, including checking status, updating, or forcing a reinstall.
```bash
rumdl vscode # Install extension
```
```bash
rumdl vscode --status # Check installation
```
```bash
rumdl vscode --update # Update the installed extension
```
```bash
rumdl vscode --force # Force reinstall
```
--------------------------------
### rumdl CI/CD Pipeline Example
Source: https://github.com/rvben/rumdl/blob/main/docs/getting-started/quickstart.md
Example GitHub Actions workflow to lint Markdown files on push and pull request events using the `rumdl-action`.
```yaml
name: Lint Markdown
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: rvben/rumdl-action@main
```
--------------------------------
### Start rumdl LSP Server
Source: https://github.com/rvben/rumdl/blob/main/docs/lsp.md
Use these commands to start the rumdl LSP server. The default uses stdio for editor integration. Custom configurations, verbose logging, or TCP mode can be enabled with flags.
```bash
rumdl server
```
```bash
rumdl server --config .rumdl.toml
```
```bash
rumdl server --verbose
```
```bash
rumdl server --port 9257
```
--------------------------------
### Text Output Format Example
Source: https://github.com/rvben/rumdl/blob/main/docs/usage/cli.md
Example of the 'text' output format, which is the default. It displays one line per warning in the format 'file:line:col: [RULE] message'.
```text
README.md:42:81: [MD013] Line length 95 exceeds 80 characters
```
--------------------------------
### MagicLink Example
Source: https://github.com/rvben/rumdl/blob/main/docs/md018.md
Demonstrates how MagicLink support handles issue/PR references and potential malformed headings.
```markdown
# PRs that are helpful for context
#10 discusses the philosophy behind the project, and #37 shows a good example.
#Summary
```
--------------------------------
### Install and Use rumdl
Source: https://github.com/rvben/rumdl/blob/main/docs/index.md
Install rumdl using Cargo, pip, or Homebrew. Then, use `rumdl check` to lint Markdown files and `rumdl fmt` to automatically fix issues.
```bash
cargo install rumdl
```
```bash
pip install rumdl
```
```bash
brew install rvben/tap/rumdl
```
```bash
rumdl check .
```
```bash
rumdl fmt .
```
--------------------------------
### mdformat Configuration Example
Source: https://github.com/rvben/rumdl/blob/main/docs/mdformat-comparison.md
Example of an mdformat configuration file using TOML format. Specifies line wrapping, number of list items, and end-of-line character.
```toml
# .mdformat.toml
wrap = 80
number = true
end_of_line = "lf"
```
--------------------------------
### Install rumdl on Arch Linux
Source: https://github.com/rvben/rumdl/blob/main/docs/getting-started/installation.md
Install rumdl directly from the Arch Linux repositories using pacman.
```bash
pacman -S rumdl
```
--------------------------------
### Conventional Commit Examples
Source: https://github.com/rvben/rumdl/blob/main/CONTRIBUTING.md
Illustrates good commit messages following the conventional commit format, including examples for features, fixes, performance improvements, documentation, and breaking changes.
```bash
feat(cache): implement Ruff-style parallel caching with Arc>
fix(pre-push): use dev profile for test-push to avoid hanging
perf(fix): enable parallel file processing for fix mode (4.8x speedup)
docs(changelog): update v0.0.163 with HTML comments fix
```
```bash
feat(api)!: change linting API to return Result
BREAKING CHANGE: The linting API now returns Result, Error>
instead of Vec. Update your code to handle the new error type.
```
--------------------------------
### Install rumdl Globally
Source: https://github.com/rvben/rumdl/blob/main/npm/rumdl/README.md
Install rumdl globally using npm, yarn, or pnpm for command-line access.
```bash
npm install -g rumdl
```
```bash
yarn global add rumdl
```
```bash
pnpm add -g rumdl
```
--------------------------------
### rumdl Output Example
Source: https://github.com/rvben/rumdl/blob/main/docs/getting-started/quickstart.md
Example of rumdl's output format, showing file path, line/column, rule ID, description, and rule alias for identified issues.
```text
README.md:10:1: MD022 Headings should be surrounded by blank lines [heading-blank-lines]
README.md:15:81: MD013 Line length [Expected: 80; Actual: 95] [line-length]
docs/guide.md:5:1: MD041 First line in a file should be a top-level heading [first-line-heading]
Found 3 issues in 2 files
```
--------------------------------
### Fixed Bash command example
Source: https://github.com/rvben/rumdl/blob/main/docs/md014.md
Illustrates a corrected shell command example after automatic fixes. The '$' prompt is removed when output is not shown.
```bash
echo "Hello, World!"
```
--------------------------------
### Configure Custom Project Terms (TOML)
Source: https://github.com/rvben/rumdl/blob/main/docs/md061.md
Example TOML configuration for detecting custom project-specific terms.
```toml
[MD061]
terms = ["REVIEW", "DEPRECATED", "SECURITY"]
```
--------------------------------
### GitLab CI Setup for rumdl
Source: https://github.com/rvben/rumdl/blob/main/docs/usage/ci-cd.md
Configures a GitLab CI pipeline to install and run rumdl. It uses a Python Docker image and installs rumdl via pip.
```yaml
lint:markdown:
image: python:3.12-slim
before_script:
- pip install rumdl
script:
- rumdl check .
```
--------------------------------
### Front Matter Title Configuration Examples
Source: https://github.com/rvben/rumdl/blob/main/docs/md025.md
Examples of configuring the `front-matter-title` option to match different YAML fields or disable front matter checking.
```toml
# Match standard 'title:' field (default)
[MD025]
front-matter-title = "title"
```
```toml
# Match either 'title:' or 'heading:' fields
[MD025]
front-matter-title = "^\\s*(title|heading)\s*[:=]"
```
```toml
# Disable front matter checking (treat front matter and body separately)
[MD025]
front-matter-title = ""
```
--------------------------------
### Basic rumdl Usage Examples
Source: https://github.com/rvben/rumdl/blob/main/README.md
Demonstrates fundamental rumdl commands for checking and formatting files, as well as initializing a configuration file.
```bash
# Lint a single file
rumdl check README.md
```
```bash
# Lint all Markdown files in current directory and subdirectories
rumdl check .
```
```bash
# Format a specific file
rumdl fmt README.md
```
```bash
# Create a default configuration file
rumdl init
```
--------------------------------
### Install Platform-Specific Package
Source: https://github.com/rvben/rumdl/blob/main/npm/rumdl/README.md
Manually install the correct platform-specific package for rumdl if npm fails to detect it automatically. Examples for Apple Silicon macOS and Linux x64 are shown.
```bash
# Install the platform package explicitly
npm install @rumdl/cli-darwin-arm64 # For Apple Silicon
npm install @rumdl/cli-linux-x64 # For Linux x64
```
--------------------------------
### Initialize rumdl Configuration
Source: https://github.com/rvben/rumdl/blob/main/docs/getting-started/quickstart.md
Create a default `.rumdl.toml` configuration file using `rumdl init`. You can also use presets like `google`.
```bash
# Create .rumdl.toml with defaults
rumdl init
# Create with specific preset
rumdl init --preset google
```
--------------------------------
### Azure Pipelines Setup for rumdl
Source: https://github.com/rvben/rumdl/blob/main/docs/usage/ci-cd.md
Configures Azure Pipelines to install and run rumdl. It specifies a Python version, installs rumdl via pip, and then executes the check command.
```yaml
trigger:
- main
pool:
vmImage: ubuntu-latest
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.12'
- script: pip install rumdl
displayName: Install rumdl
- script: rumdl check .
displayName: Lint Markdown
```
--------------------------------
### Get Help Information
Source: https://github.com/rvben/rumdl/blob/main/npm/rumdl/README.md
Access the help documentation for rumdl to understand all available commands and options.
```bash
rumdl --help
```
--------------------------------
### Initialize Configuration with `rumdl init`
Source: https://github.com/rvben/rumdl/blob/main/docs/usage/cli.md
Create a configuration file using `rumdl init`. You can specify a preset style or a custom output path.
```bash
rumdl init # Create .rumdl.toml
```
```bash
rumdl init --preset google # Use Google style preset
```
```bash
rumdl init --output custom.toml # Custom output path
```
--------------------------------
### Incorrect Missing Closing Fence Before New Block
Source: https://github.com/rvben/rumdl/blob/main/docs/md046.md
An example where a new code block starts before the previous one is properly closed.
```markdown
```javascript
const api = require('our-api');
api.connect();
```python
print("hello")
```
```
--------------------------------
### Correct Heading-Based TOC Example
Source: https://github.com/rvben/rumdl/blob/main/docs/md073.md
A correctly formatted TOC using a heading ('Contents') to denote its start, followed by entries that match document headings.
```markdown
# My Project
## Contents
- [Installation](#installation)
- [Usage](#usage)
## Installation
...
## Usage
...
```
--------------------------------
### YAML - Correct Frontmatter
Source: https://github.com/rvben/rumdl/blob/main/docs/md072.md
Example of YAML frontmatter with keys sorted alphabetically.
```markdown
---
author: John Doe
date: 2024-01-15
title: My Document
---
# Heading
```
--------------------------------
### Order Mismatch TOC Example
Source: https://github.com/rvben/rumdl/blob/main/docs/md073.md
Illustrates an order mismatch in a marker-based TOC when `enforce-order` is true. The 'Usage' entry appears before the 'Installation' entry, contrary to the document's heading order.
```markdown
- [Usage](#usage) <-- Should come after Installation
- [Installation](#installation)
## Installation
...
## Usage
...
```
--------------------------------
### Incorrect MkDocs Navigation Entries
Source: https://github.com/rvben/rumdl/blob/main/docs/md074.md
Example of incorrect MkDocs navigation entries. The 'Guide' entry points to a non-existent file, and the 'Overview' entry uses an absolute path which might be flagged depending on configuration.
```yaml
nav:
- Home: index.md
- Guide: missing-guide.md # File doesn't exist
- API:
- Overview: /api/overview.md # Absolute path (if configured to warn)
```
--------------------------------
### init [OPTIONS]
Source: https://github.com/rvben/rumdl/blob/main/docs/usage/cli.md
Create a configuration file for rumdl. This command can generate a default configuration or use predefined style presets.
```APIDOC
## init [OPTIONS]
### Description
Create a configuration file.
### Method
CLI Command
### Usage
`rumdl init`
`rumdl init --preset google`
`rumdl init --output custom.toml`
### Options
- `--pyproject` (boolean) - Generate configuration for pyproject.toml
- `--preset ` (string) - Use a style preset (`default`, `google`, `relaxed`)
- `--output ` (string) - Output file path (default: `.rumdl.toml`)
```
--------------------------------
### Correct Markdown Links
Source: https://github.com/rvben/rumdl/blob/main/docs/md042.md
Examples of valid Markdown links with both text and URL.
```markdown
[Visit our website](https://example.com)
[Download the guide](downloads/guide.pdf)
Check out the [documentation][docs]
[docs]: https://docs.example.com
```
--------------------------------
### Install rumdl with npm
Source: https://github.com/rvben/rumdl/blob/main/README.md
Install rumdl globally using npm. It can also be installed as a development dependency.
```bash
npm install -g rumdl
```
```bash
npm install --save-dev rumdl
```
--------------------------------
### Start rumdl LSP server
Source: https://context7.com/rvben/rumdl/llms.txt
Use `rumdl server` to start the Language Server Protocol server for editor integration. Supports stdio (default) and TCP modes for debugging. Use `--verbose` for detailed logging.
```bash
# Stdio mode for editor integration (default)
rumdl server
```
```bash
# TCP mode for debugging
rumdl server --port 9257
```
```bash
# Verbose LSP logging
rumdl server --verbose
```
--------------------------------
### Show version information
Source: https://github.com/rvben/rumdl/blob/main/README.md
Display the installed version of the rumdl tool using the `version` command.
```bash
rumdl version
```
--------------------------------
### Preview markdownlint import
Source: https://github.com/rvben/rumdl/blob/main/README.md
Preview the conversion of a markdownlint configuration file without writing it to disk using `import --dry-run`.
```bash
rumdl import --dry-run .markdownlint.json
```
--------------------------------
### Load markdownlint-cli2 Config in rumdl
Source: https://github.com/rvben/rumdl/blob/main/docs/markdownlint-comparison.md
Example of a .markdownlint-cli2.yaml file that rumdl automatically loads and uses.
```yaml
# .markdownlint-cli2.yaml (also automatically loaded)
config:
MD013: false
MD033:
allowed_elements: ['br', 'img']
```
--------------------------------
### CLI Equivalent for Include Patterns
Source: https://github.com/rvben/rumdl/blob/main/docs/global-settings.md
Example of using the `--include` CLI flag to specify multiple inclusion patterns, separated by commas.
```bash
rumdl check --include "docs/**/*.md,README.md" .
```
--------------------------------
### Load markdownlint Config in rumdl
Source: https://github.com/rvben/rumdl/blob/main/docs/markdownlint-comparison.md
Example of a .markdownlint.yaml file that rumdl automatically loads and uses.
```yaml
# .markdownlint.yaml (automatically loaded)
MD013: false
MD033:
allowed_elements: ['br', 'img']
```
--------------------------------
### Install VS Code extension for rumdl
Source: https://github.com/rvben/rumdl/blob/main/docs/getting-started/installation.md
Install the rumdl VS Code extension for real-time linting. You can also check its installation status.
```bash
# Install the extension
rumdl vscode
# Check installation status
rumdl vscode --status
```
--------------------------------
### Tag Syntax Example
Source: https://github.com/rvben/rumdl/blob/main/docs/md018.md
Demonstrates how tag support handles '#word' patterns, multi-hash patterns, and numeric patterns.
```markdown
# Real Heading
#todo this is a tag
#project/active nested tag
##Introduction
```
--------------------------------
### Precedence Example with Global and Per-File Ignores
Source: https://github.com/rvben/rumdl/blob/main/docs/global-settings.md
Demonstrates how global settings and per-file ignores interact, showing precedence rules. More specific patterns override general ones, and per-file ignores override global settings for matching files.
```toml
[global]
disable = ["MD013"] # Disable line length globally
[per-file-ignores]
"README.md" = ["MD033", "MD041"] # Also disable HTML and first-line heading for README
"docs/**/*.md" = ["MD033"] # Allow HTML in docs
```
--------------------------------
### Quarto Flavor Configuration (TOML)
Source: https://github.com/rvben/rumdl/blob/main/docs/flavors/quarto.md
Configuration examples for setting the Quarto flavor globally or on a per-file basis using TOML.
```toml
[global]
flavor = "quarto"
```
```toml
[per-file-flavor]
"**/*.qmd" = "quarto"
"**/*.Rmd" = "quarto"
```
--------------------------------
### Configuration for MD048
Source: https://github.com/rvben/rumdl/blob/main/docs/md048.md
Example TOML configuration for the MD048 rule, specifying the desired code fence style.
```toml
[MD048]
style = "consistent" # Options: "consistent", "backtick", "tilde"
```
--------------------------------
### Manage rumdl versions with mise
Source: https://github.com/rvben/rumdl/blob/main/docs/getting-started/installation.md
Use mise to list, install, and manage different versions of rumdl.
```bash
# List available versions
mise ls-remote rumdl
# Install the latest version
mise install rumdl
# Use a specific version for the project
mise use rumdl@latest
```
--------------------------------
### Aligned Table Example
Source: https://github.com/rvben/rumdl/blob/main/docs/md060.md
Example of a markdown table with aligned columns.
```markdown
| Name | Age | City |
| ----- | --- | -------- |
| Alice | 30 | Seattle |
| Bob | 25 | Portland |
```
--------------------------------
### Setup Neovim with null-ls / none-ls
Source: https://github.com/rvben/rumdl/blob/main/docs/usage/editors.md
Integrate rumdl for diagnostics and formatting in Neovim using null-ls or none-ls.
```lua
local null_ls = require("null-ls")
null_ls.setup({
sources = {
null_ls.builtins.diagnostics.rumdl,
null_ls.builtins.formatting.rumdl,
},
})
```
--------------------------------
### Install rumdl with Termux User Repository (TUR) (Android)
Source: https://github.com/rvben/rumdl/blob/main/README.md
Install rumdl on Android via Termux after enabling the TUR repository. First, enable the repo, then install the package.
```bash
pkg install tur-repo
```
```bash
pkg install rumdl
```
--------------------------------
### Unaligned Table Example
Source: https://github.com/rvben/rumdl/blob/main/docs/md060.md
Example of a markdown table that does not adhere to alignment rules.
```markdown
| Name | Age | City |
|---|---|---|
| Alice | 30 | Seattle |
| Bob | 25 | Portland |
```
--------------------------------
### Run Tests
Source: https://github.com/rvben/rumdl/blob/main/CONTRIBUTING.md
Execute tests using different `make` targets: `test-dev` for recommended tests, `test-quick` for faster execution, and `test` for the full suite.
```bash
make test-dev # Recommended: ~20s, skips slowest tests
make test-quick # Faster: ~15s, skips slow/stress tests
make test # Full suite with dev profile
```
--------------------------------
### Verify rumdl installation
Source: https://github.com/rvben/rumdl/blob/main/docs/getting-started/installation.md
Check if rumdl is installed correctly by running the version command.
```bash
rumdl --version
```
--------------------------------
### Configuration Precedence Example
Source: https://github.com/rvben/rumdl/blob/main/docs/global-settings.md
Illustrates how command-line arguments override settings defined in the configuration file. The final configuration is a merge of file and CLI settings.
```toml
[global]
disable = ["MD013", "MD033"]
exclude = ["node_modules", "build"]
```
```bash
rumdl check --disable MD001,MD013 --exclude "temp/**" docs/
```
--------------------------------
### Download and install rumdl binary for Windows
Source: https://github.com/rvben/rumdl/blob/main/docs/getting-started/installation.md
Download the Windows binary from GitHub Releases using PowerShell, extract it, and manually add it to your PATH.
```powershell
# PowerShell
Invoke-WebRequest -Uri "https://github.com/rvben/rumdl/releases/latest/download/rumdl-windows-x86_64.zip" -OutFile "rumdl.zip"
Expand-Archive -Path "rumdl.zip" -DestinationPath "$env:USERPROFILE\.rumdl"
# Add to PATH manually
```
--------------------------------
### init()
Source: https://github.com/rvben/rumdl/blob/main/wasm-pkg/README.md
Initializes the WebAssembly module. This function must be called before using any other functions in the library.
```APIDOC
## init()
### Description
Initialize the WASM module. Must be called before using other functions.
### Method
JavaScript
### Endpoint
N/A
### Parameters
None
### Request Example
```javascript
await init();
```
### Response
None
```
--------------------------------
### Install rumdl as a Dev Dependency
Source: https://github.com/rvben/rumdl/blob/main/npm/rumdl/README.md
Install rumdl as a development dependency in your project using npm.
```bash
npm install --save-dev rumdl
```
--------------------------------
### Install rumdl with Cargo
Source: https://github.com/rvben/rumdl/blob/main/docs/getting-started/installation.md
Install rumdl using the Cargo package manager for Rust projects.
```bash
cargo install rumdl
```
--------------------------------
### Show Configuration
Source: https://github.com/rvben/rumdl/blob/main/docs/usage/cli.md
Display the merged configuration, default values only, or non-default values only.
```bash
rumdl config # Show merged configuration
```
```bash
rumdl config --defaults # Show default values only
```
```bash
rumdl config --no-defaults # Show non-default values only
```
--------------------------------
### Automatic Fix Example (Before)
Source: https://github.com/rvben/rumdl/blob/main/docs/md064.md
This example shows markdown with multiple consecutive spaces before the automatic fix is applied.
```text
This is a sentence with extra spaces.
```
--------------------------------
### Activating Opt-in Rules
Source: https://github.com/rvben/rumdl/blob/main/docs/global-settings.md
Use `extend-enable` in the `[global]` section to activate specific opt-in rules like MD060 and MD063 without replacing the default rule set.
```toml
[global]
extend-enable = ["MD060", "MD063"]
```
--------------------------------
### Initialize rumdl Configuration
Source: https://context7.com/rvben/rumdl/llms.txt
Use `rumdl init` to create a default `.rumdl.toml` configuration file or inject a `[tool.rumdl]` section into an existing `pyproject.toml`.
```bash
rumdl init
```
```bash
rumdl init --pyproject
```
```toml
# [global]
# line-length = 80
# exclude = []
# respect-gitignore = true
#
# [MD013]
# line-length = 80
# code-blocks = true
# tables = false
```
--------------------------------
### Install rumdl on Android (Termux)
Source: https://github.com/rvben/rumdl/blob/main/docs/getting-started/installation.md
Install rumdl on Android using Termux. Ensure the TUR repository is enabled first.
```bash
# Enable TUR repo first
pkg install tur-repo
# Then install rumdl
pkg install rumdl
```
--------------------------------
### Rust Hello World Program
Source: https://github.com/rvben/rumdl/blob/main/docs/playground.md
A standard 'Hello, world!' program written in Rust. This serves as a basic example of Rust syntax and the `println!` macro.
```rust
fn main() {
println!("Hello, world!");
}
```
--------------------------------
### Automatic Fix Example (After)
Source: https://github.com/rvben/rumdl/blob/main/docs/md064.md
This example shows markdown with multiple consecutive spaces collapsed to a single space after the automatic fix.
```markdown
This is a sentence with extra spaces.
```
--------------------------------
### Enable Opt-in Rules with Defaults
Source: https://github.com/rvben/rumdl/blob/main/docs/global-settings.md
Activate opt-in rules like table formatting and frontmatter key sorting by adding them to the `extend-enable` list in the `[global]` section. This complements the default rule set.
```toml
[global]
extend-enable = ["MD060", "MD072"] # Add table formatting and frontmatter key sort
```
--------------------------------
### Configuration for MD031 rule
Source: https://github.com/rvben/rumdl/blob/main/docs/md031.md
Configuration example for the MD031 rule using TOML format, specifically showing the 'list-items' option.
```toml
[MD031]
list-items = true # Also require blank lines in lists (default: true)
```
--------------------------------
### Install rumdl with Homebrew (macOS/Linux)
Source: https://github.com/rvben/rumdl/blob/main/README.md
Install rumdl using Homebrew on macOS and Linux. This is a common method for managing packages on these systems.
```bash
brew install rumdl
```
--------------------------------
### Correct Bash command with output
Source: https://github.com/rvben/rumdl/blob/main/docs/md014.md
Demonstrates a correctly formatted shell command with its expected output. Use this format to show users what to expect when running commands.
```bash
$ npm install
added 125 packages, and audited 126 packages in 3s
14 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
```
```bash
$ echo "Hello, World!"
Hello, World!
```
--------------------------------
### Fixed Markdown Example
Source: https://github.com/rvben/rumdl/blob/main/docs/md033.md
Illustrates the corrected version of the 'Incorrect Markdown with HTML Tags' example, showing the proper Markdown syntax.
```markdown
# Heading
This is a paragraph with **bold** and *italic* text.
> This is a quote
- List item 1
- List item 2
[Link text](https://example.com)

```
--------------------------------
### Incorrectly Capitalized Markdown Example
Source: https://github.com/rvben/rumdl/blob/main/docs/md044.md
This example shows common capitalization errors in a Markdown document that the MD044 rule aims to correct.
```markdown
# Javascript Development Guide
This guide covers javascript best practices for github projects.
We'll be using NodeJS and typescript for our examples.
```
--------------------------------
### Correctly Capitalized Markdown Example
Source: https://github.com/rvben/rumdl/blob/main/docs/md044.md
This example demonstrates correctly capitalized names within a Markdown document, adhering to the configured list.
```markdown
# JavaScript Development Guide
This guide covers JavaScript best practices for GitHub projects.
We'll be using Node.js and TypeScript for our examples.
```
--------------------------------
### Show Rule Documentation
Source: https://github.com/rvben/rumdl/blob/main/docs/usage/cli.md
List all available rules, show details for a specific rule, use rule aliases, discover rule categories, or output rule details in JSON format.
```bash
rumdl rule # List all rules
```
```bash
rumdl rule MD013 # Show details for specific rule
```
```bash
rumdl rule line-length # Use rule alias
```
```bash
rumdl rule --list-categories # Discover rule categories
```
```bash
rumdl rule MD013 --output-format json
```
```bash
rumdl rule MD013 --output-format json --explain
```
--------------------------------
### Download and install rumdl binary for Linux/macOS
Source: https://github.com/rvben/rumdl/blob/main/docs/getting-started/installation.md
Download pre-built binaries for Linux and macOS from GitHub Releases and extract them to /usr/local/bin.
```bash
# Linux x86_64
curl -LsSf https://github.com/rvben/rumdl/releases/latest/download/rumdl-linux-x86_64.tar.gz | tar xzf - -C /usr/local/bin
# macOS x86_64
curl -LsSf https://github.com/rvben/rumdl/releases/latest/download/rumdl-darwin-x86_64.tar.gz | tar xzf - -C /usr/local/bin
# macOS ARM64 (Apple Silicon)
curl -LsSf https://github.com/rvben/rumdl/releases/latest/download/rumdl-darwin-arm64.tar.gz | tar xzf - -C /usr/local/bin
```
--------------------------------
### Example with Ignored Definitions for 'todo', 'draft', 'template'
Source: https://github.com/rvben/rumdl/blob/main/docs/md053.md
TOML configuration demonstrating how to keep specific reference definitions like 'todo', 'draft', or 'template' even when they are not used.
```toml
[MD053]
ignored-definitions = ["todo", "draft", "template"]
```
--------------------------------
### Use built-in defaults, ignoring config files
Source: https://github.com/rvben/rumdl/blob/main/README.md
Ignore all configuration files and use only the built-in defaults by using the `--no-config` option.
```bash
rumdl check --no-config README.md
```
--------------------------------
### Manual rumdl Installation with Cargo
Source: https://github.com/rvben/rumdl/blob/main/docs/usage/ci-cd.md
Installs rumdl using Cargo, the Rust package manager, within a CI job. This is an alternative to using pre-built actions.
```yaml
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install rumdl
run: cargo install rumdl
- name: Lint
run: rumdl check .
```
--------------------------------
### Install VS Code Extension from Command Line
Source: https://github.com/rvben/rumdl/blob/main/docs/vscode-extension.md
Install the rumdl VS Code extension directly using the 'code' command if you prefer not to use the rumdl CLI.
```bash
code --install-extension rvben.rumdl
```
--------------------------------
### Enable Opt-in Rules in .rumdl.toml
Source: https://github.com/rvben/rumdl/blob/main/docs/rules.md
Use `extend-enable` in the `[global]` section of your `.rumdl.toml` file to enable opt-in rules. Specific rule configurations can be set in their respective sections.
```toml
[global]
extend-enable = ["MD060", "MD063", "MD072"]
# Configure enabled rules as needed
[MD060]
style = "aligned"
[MD063]
style = "title-case"
```
--------------------------------
### Correct Quarto chunk with hashpipe label
Source: https://github.com/rvben/rumdl/blob/main/docs/md078.md
Utilize a hashpipe option `#| label: setup` within the chunk for executable Quarto code. This is a recommended way to label chunks for cross-referencing and other features.
```markdown
```{r}
#| label: setup
library(ggplot2)
```
```
--------------------------------
### Setup Neovim with nvim-lspconfig
Source: https://github.com/rvben/rumdl/blob/main/docs/usage/editors.md
Configure Neovim to use rumdl as a language server via the nvim-lspconfig plugin.
```lua
require('lspconfig').rumdl.setup{}
```
--------------------------------
### MkDocs Nav 'not-found' Example
Source: https://github.com/rvben/rumdl/blob/main/docs/link-validation.md
Example of an MkDocs navigation entry pointing to a file that does not exist, which will trigger a warning when MD074's 'not-found' option is set to 'warn'.
```yaml
# mkdocs.yml
nav:
- Home: index.md
- Guide: missing-guide.md # Warning: file not found
```
--------------------------------
### Enabling All Rules Plus Opt-in
Source: https://github.com/rvben/rumdl/blob/main/docs/global-settings.md
Activate all available rules, including opt-in ones, by setting `extend-enable` in the `[global]` section.
```toml
[global]
extend-enable = ["MD060", "MD072"]
```
--------------------------------
### Initialize Rumdl Configuration File
Source: https://github.com/rvben/rumdl/blob/main/README.md
Use the `rumdl init` command to create a new configuration file. Specify `--pyproject` to generate or update a `pyproject.toml` file for Python projects.
```bash
# Create a .rumdl.toml file (for any project)
rumdl init
# Create or update a pyproject.toml file with rumdl configuration (for Python projects)
rumdl init --pyproject
```
--------------------------------
### Manual rumdl Installation with Pip
Source: https://github.com/rvben/rumdl/blob/main/docs/usage/ci-cd.md
Installs rumdl using pip within a CI job. This method is suitable if your project already uses Python or pip for dependency management.
```yaml
- name: Install rumdl
run: pip install rumdl
- name: Lint
run: rumdl check .
```
--------------------------------
### Show loaded configuration file path
Source: https://github.com/rvben/rumdl/blob/main/README.md
Display the absolute path of the currently loaded configuration file using `config file`.
```bash
rumdl config file
```
--------------------------------
### Configure Per-File Markdown Flavors
Source: https://github.com/rvben/rumdl/blob/main/docs/global-settings.md
Map specific file patterns to different Markdown flavors. Uses 'first match wins' semantics. Patterns are relative to the project root.
```toml
[per-file-flavor]
"docs/**/*.md" = "mkdocs"
"**/*.mdx" = "mdx"
"**/*.qmd" = "quarto"
"examples/**/*.md" = "standard"
```
```toml
[global]
flavor = "standard" # Default for files not matching any pattern
[per-file-flavor]
# MkDocs documentation
"docs/**/*.md" = "mkdocs"
# React components with MDX
"src/components/**/*.mdx" = "mdx"
# Jupyter/Quarto notebooks
"notebooks/**/*.qmd" = "quarto"
# Keep README and CHANGELOG as standard
"README.md" = "standard"
"CHANGELOG.md" = "standard"
```
```toml
[per-file-flavor]
"packages/website/docs/**/*.md" = "mkdocs"
"packages/storybook/**/*.mdx" = "mdx"
"packages/api/docs/**/*.md" = "standard"
```
--------------------------------
### rumdl Editor Integration Examples
Source: https://github.com/rvben/rumdl/blob/main/README.md
Examples for integrating rumdl formatting into editors like Vim using stdin/stdout mode with the `--silent` flag for pure formatted output.
```vim
# Format selection in editor (example for vim)
:'<,'>!rumdl fmt - --silent
```
```vim
# Format entire buffer
:%!rumdl fmt - --silent
```
--------------------------------
### Advanced Wildcard Example: Flexible Documentation Structure (TOML)
Source: https://github.com/rvben/rumdl/blob/main/docs/md043.md
An advanced TOML configuration using multiple wildcards to define a flexible yet structured documentation layout.
```toml
[MD043]
headings = [
"?", # Project name (variable)
"## Overview", # Required
"*", # Optional sections (badges, features, etc.)
"## Installation", # Required
"*", # Optional sections (usage, examples, etc.)
"## License" # Required
]
```
--------------------------------
### MkDocs Navigation Structure
Source: https://github.com/rvben/rumdl/blob/main/docs/md074.md
Example of a valid MkDocs navigation structure in `mkdocs.yml`. Ensure all listed files exist within the `docs_dir`.
```yaml
site_name: My Docs
docs_dir: docs
nav:
- Home: index.md
- Guide: guide.md
- API:
- Overview: api/overview.md
- Reference: api/reference.md
```
--------------------------------
### rumdl Linting with Custom Configuration
Source: https://github.com/rvben/rumdl/blob/main/README.md
Shows how to lint files using a custom configuration file or by overriding specific rules inline using Ruff-compatible syntax.
```bash
# Lint with custom configuration
rumdl check --config my-config.toml docs/
```
```bash
# Override config inline without touching any file (Ruff-compatible syntax)
rumdl check --config 'MD013.line-length=120' --config 'MD013.reflow=true' docs/
```
--------------------------------
### Configuration Example: Sentence Double Space Usage
Source: https://github.com/rvben/rumdl/blob/main/docs/md064.md
This example demonstrates markdown content with the 'allow-sentence-double-space' option enabled, showing acceptable double spaces after sentence endings and flagged multiple spaces elsewhere.
```text
End of sentence. Start of next sentence. <- OK (2 spaces after period)
Multiple spaces in middle of sentence. <- Flagged (not after sentence)
What a question! Here's the answer. <- OK (2 spaces after !)
Really? Yes, really. <- OK (2 spaces after ?)
```
--------------------------------
### Rumdl Config --no-defaults Example
Source: https://github.com/rvben/rumdl/blob/main/README.md
This bash command demonstrates how to view only the configuration values that differ from the defaults. It's useful for quickly identifying project-specific or user-specific overrides.
```bash
$ rumdl config --no-defaults
[global]
disable = ["MD013"] [from project config]
line_length = 100 [from pyproject.toml]
[MD004]
style = "asterisk" [from project config]
```
--------------------------------
### blog/.rumdl.toml for Standalone Blog Configuration
Source: https://github.com/rvben/rumdl/blob/main/docs/global-settings.md
Set up a standalone configuration for blog posts, defining specific line length and disabling certain rules independently of other configurations.
```toml
# blog/.rumdl.toml - standalone config for blog
[global]
line-length = 100
disable = ["MD033", "MD041"]
```
--------------------------------
### Configure Warning Comments (TOML)
Source: https://github.com/rvben/rumdl/blob/main/docs/md061.md
Example TOML configuration to detect common warning comments like TODO and FIXME.
```toml
[MD061]
terms = ["TODO", "FIXME", "XXX", "HACK"]
```