Skip to content

Commit 8f5f3dc

Browse files
committed
feat: properly configure mdbook-lint as preprocessor
- Add .mdbook-lint.toml with proper configuration - Temporarily disable MDBOOK010 (math detection) and MDBOOK005 (orphaned files) until upstream issues #141 and #142 are resolved - Configure preprocessor correctly in book.toml - Simplify GitHub Actions workflow - lint now runs as part of build - Set line length to 120 chars for technical documentation - Configuration validated with 'mdbook-lint check' Thanks to @joshrotenberg for the quick feedback on proper configuration!
1 parent 9b038ba commit 8f5f3dc

File tree

3 files changed

+36
-8
lines changed

3 files changed

+36
-8
lines changed

.github/workflows/mdbook.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,7 @@ jobs:
4545
run: |
4646
command -v mdbook-lint || cargo install mdbook-lint
4747
48-
- name: Lint book
49-
run: |
50-
mdbook-lint lint docs/src --config-format=disabled || true
51-
# Note: Linting is informational only for now due to false positives with $ in code blocks
52-
53-
- name: Build book
48+
- name: Build book (includes linting via preprocessor)
5449
run: |
5550
cd docs
5651
mdbook build

docs/.mdbook-lint.toml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# mdbook-lint configuration for redisctl documentation
2+
# https://github.com/joshrotenberg/mdbook-lint
3+
4+
# Temporarily disable rules with known issues
5+
disabled-rules = [
6+
"MDBOOK010", # Math block detection - false positives with $ in shell code blocks (issue #141)
7+
"MDBOOK005", # Orphaned files - incorrectly checking outside src directory (issue #142)
8+
]
9+
10+
# Don't fail the build on warnings during initial setup
11+
fail-on-warnings = false
12+
13+
# Configure specific rules
14+
[rules.MD013]
15+
# Allow longer lines for code examples and CLI output
16+
line_length = 120
17+
18+
[rules.MD024]
19+
# Allow duplicate headings in different sections
20+
enabled = true
21+
22+
[rules.MD041]
23+
# Require first line to be a heading
24+
enabled = true
25+
26+
# Future configuration options when issues are resolved:
27+
# [rules.MDBOOK005]
28+
# search-path = "src" # Only check within src directory
29+
#
30+
# [rules.MDBOOK010]
31+
# skip-code-blocks = true # Skip math detection in code blocks

docs/book.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,7 @@ edit-url-template = "https://github.com/joshrotenberg/redisctl/edit/main/docs/{p
1515
enable = true
1616
level = 1
1717

18-
# mdbook-lint configuration can be added here if needed
19-
# Currently running lint separately via CI
18+
# Enable mdbook-lint preprocessor
19+
# Configuration is in .mdbook-lint.toml
20+
[preprocessor.lint]
21+
command = "mdbook-lint"

0 commit comments

Comments
 (0)