ValeFlagger Plugin
The ValeFlagger plugin integrates Vale linter to automatically check your AsciiDoc files for DITA compatibility issues and insert helpful flags directly in your source files.
What it does: Scans AsciiDoc files using the AsciiDocDITA ruleset and inserts comment flags above problematic lines with specific guidance on how to fix DITA compliance issues.
Why it matters: Ensures your AsciiDoc content follows DITA best practices for structure, terminology, and style before conversion, preventing common migration issues.
New to ValeFlagger? Check out the 5-minute Quick Start Guide for immediate setup.
Table of contents
- Quick Start
- Common DITA Issues Detected
- Working with Flags
- Writer-Friendly Workflows
- Advanced Configuration
- Editor Integration
- Troubleshooting
- Best Practices
- Integration with Documentation Workflows
- Command Reference
- Configuration Examples
Quick Start
Zero-Configuration Usage
ValeFlagger is designed to work immediately without any setup:
# Check a single file (recommended for beginners)
adt ValeFlagger -f my-document.adoc
# Check all files in current directory
adt ValeFlagger -r
# Preview issues without modifying files
adt ValeFlagger -f my-document.adoc --dry-run
Prerequisites: Docker must be installed and running. ValeFlagger automatically downloads and configures the necessary DITA checking rules.
Understanding the Output
When ValeFlagger finds an issue, it inserts a comment above the problematic line:
Before:
= Getting Started With APIs
After:
// ADT-FLAG [Headings.Capitalization]: Heading should use sentence-style capitalization.
= Getting Started With APIs
The flag format: // ADT-FLAG [RuleName]: Helpful message explaining the issue
Common DITA Issues Detected
Heading Capitalization
Issue: DITA prefers sentence-style capitalization for headings.
ValeFlagger detects:
// ADT-FLAG [Headings.Capitalization]: Use sentence-style capitalization
= Getting Started With APIs ❌
Recommended fix:
= Getting started with APIs ✅
Terminology Consistency
Issue: Inconsistent terminology across documentation.
ValeFlagger detects:
// ADT-FLAG [Terms.Use]: Use 'repository' instead of 'repo'
Clone the repo to your local machine. ❌
Recommended fix:
Clone the repository to your local machine. ✅
Content Structure
Issue: Missing or incorrectly structured content elements.
ValeFlagger detects:
// ADT-FLAG [Structure.ShortDescription]: Consider adding a short description after the title
= API Overview
This section covers advanced topics... ❌
Recommended fix:
= API Overview
This guide explains how to use our REST API effectively.
This section covers advanced topics... ✅
Working with Flags
Processing Workflow
- Review each flag: Read the message to understand the issue
- Make the fix: Update your content based on the guidance
- Remove the flag: Delete the
// ADT-FLAG
comment after fixing - Re-run ValeFlagger: Verify the issue is resolved
Flag Lifecycle Example
Step 1 - Initial scan:
// ADT-FLAG [Terms.Use]: Use 'repository' instead of 'repo'
Clone the repo and install dependencies.
Step 2 - Fix the content:
// ADT-FLAG [Terms.Use]: Use 'repository' instead of 'repo'
Clone the repository and install dependencies.
Step 3 - Remove the flag:
Clone the repository and install dependencies.
Step 4 - Verify:
adt ValeFlagger -f my-file.adoc
# No new flags = issue resolved!
Writer-Friendly Workflows
Daily Writing Workflow
- Write your content normally in AsciiDoc
- Run ValeFlagger when you finish a section:
adt ValeFlagger -f current-file.adoc
- Address flags one by one
- Re-run to verify fixes
Team Review Workflow
- Before submitting for review:
adt ValeFlagger -r --dry-run > issues.txt
- Review the issues list and fix major problems
- Run without dry-run to insert flags for minor issues
- Submit for review with flags intact for reviewer context
Content Audit Workflow
- Scan entire documentation:
adt ValeFlagger -r
- Prioritize fixes by severity and impact
- Work systematically through each file
- Track progress by monitoring flag count
Advanced Configuration
Custom Rules Configuration
Create a configuration file valeflag-config.yaml
:
vale:
# Only check for critical issues
enabled_rules:
- "Headings.Capitalization"
- "Terms.Use"
- "Structure.ShortDescription"
# Ignore certain rules that don't fit your style
disabled_rules:
- "Readability.TooWordy"
valeflag:
# Customize flag appearance
flag_format: "// REVIEW [{rule}]: {message}"
Use your custom configuration:
adt ValeFlagger -f my-file.adoc --config valeflag-config.yaml
Available Configuration Options
Setting | Description | Default |
---|---|---|
vale.enabled_rules |
List of rules to enable | All rules |
vale.disabled_rules |
List of rules to disable | None |
vale.timeout_seconds |
Docker execution timeout | 300 seconds |
vale.docker_image |
Custom Docker image | Auto-generated |
valeflag.flag_format |
Custom flag format | // ADT-FLAG [{rule}]: {message} |
Editor Integration
VS Code Integration
ValeFlagger works excellently with VS Code for AsciiDoc editing:
- Install AsciiDoc extension for syntax highlighting
- Use integrated terminal to run ValeFlagger commands
- Set up tasks for quick access
VS Code Tasks Setup
Create .vscode/tasks.json
in your project root:
{
"version": "2.0.0",
"tasks": [
{
"label": "ValeFlagger: Check Current File",
"type": "shell",
"command": "adt",
"args": ["ValeFlagger", "-f", "${file}"],
"group": "test",
"presentation": {
"echo": true,
"reveal": "always",
"panel": "new"
}
},
{
"label": "ValeFlagger: Preview Issues",
"type": "shell",
"command": "adt",
"args": ["ValeFlagger", "-f", "${file}", "--dry-run"],
"group": "test"
}
]
}
Access tasks via:
- Press
Ctrl+Shift+P
(orCmd+Shift+P
on Mac) - Type “Tasks: Run Task”
- Select your ValeFlagger task
Other Editors
Most text editors work well with ValeFlagger’s comment-based approach:
- Vim/Neovim: Comments are clearly visible and easy to navigate
- Emacs: Org-mode users will find the workflow familiar
- Sublime Text: Syntax highlighting makes flags stand out
- IntelliJ IDEA: Built-in AsciiDoc support works with flags
Troubleshooting
Common Issues
“Docker not found” Error
Problem: ValeFlagger requires Docker to run the Vale linter.
Solution: Install Docker Desktop and ensure it’s running before using ValeFlagger.
# Test Docker installation
docker --version
# Should show version info without errors
“No issues found” but Content Seems Wrong
Possible causes:
- ValeFlagger only checks configured rules
- Some issues might not be covered by current ruleset
- File might not be in AsciiDoc format
Solution: Run with verbose output:
adt ValeFlagger -f my-file.adoc -v
Too Many Flags on Existing Content
Strategy for large existing documents:
- Start with critical issues:
adt ValeFlagger -f doc.adoc --enable-rules "Headings.Capitalization,Terms.Use"
-
Fix incrementally - don’t try to fix everything at once
- Focus on new content - apply full checking to new sections
Flags Not Appearing
Check:
- File is saved before running ValeFlagger
- Running command from correct directory
- File has
.adoc
extension - Docker is running and accessible
Best Practices
Preventive Writing
- Learn common patterns from flags you see repeatedly
- Internalize terminology to avoid consistency issues
- Follow heading conventions from the start
Iterative Improvement
- Don’t aim for perfection on first draft
- Use dry-run mode to assess scope before making changes
- Fix systematically rather than randomly
Team Collaboration
- Share configuration files to ensure consistent checking
- Document team-specific rules and exceptions
- Use flags as learning tools for new team members
Content Maintenance
- Run periodic audits on existing content
- Update configurations as style guides evolve
- Track improvements over time
Integration with Documentation Workflows
Git Workflows
# Before committing
adt ValeFlagger -r --dry-run
# Review and fix critical issues
# Add flags for team review
adt ValeFlagger -r
git add .
git commit -m "Add ValeFlagger flags for review"
CI/CD Integration
ValeFlagger can be integrated into automated pipelines to catch issues early:
# In your CI script
adt ValeFlagger -r --dry-run > vale-issues.txt
if [ -s vale-issues.txt ]; then
echo "DITA compliance issues found:"
cat vale-issues.txt
exit 1
fi
Command Reference
Essential Commands
Command | Purpose |
---|---|
adt ValeFlagger -f file.adoc |
Check single file |
adt ValeFlagger -r |
Check all files recursively |
adt ValeFlagger -f file.adoc --dry-run |
Preview issues only |
adt ValeFlagger -f file.adoc -v |
Verbose output |
adt ValeFlagger -h |
Get help |
Flag Actions
Action | Description |
---|---|
Read flag message | Understand the issue |
Fix the content | Make the suggested change |
Delete the flag | Remove the comment line |
Re-run ValeFlagger | Verify the fix |
Configuration Examples
Basic Configuration (valeflag-basic.yaml
)
# Basic ValeFlagger Configuration for Technical Writers
vale:
enabled_rules:
- "Headings.Capitalization"
- "Terms.Use"
- "Structure.ShortDescription"
disabled_rules:
- "Readability.TooWordy"
- "Style.Contractions"
timeout_seconds: 300
valeflag:
flag_format: "// WRITER NOTE [{rule}]: {message}"
backup_files: false
Advanced Team Configuration (valeflag-advanced.yaml
)
# Advanced ValeFlagger Configuration for Technical Writing Teams
vale:
enabled_rules:
# Structure and organization
- "Structure.ShortDescription"
- "Structure.SectionOrder"
- "Structure.ListFormat"
# Content quality
- "Headings.Capitalization"
- "Headings.Length"
- "Terms.Use"
- "Terms.Spelling"
# DITA-specific requirements
- "DITA.CrossReferences"
- "DITA.Metadata"
- "DITA.Attributes"
disabled_rules:
- "Readability.TooWordy"
- "Style.Contractions"
timeout_seconds: 600
valeflag:
flag_format: "// REVIEW [{rule}]: {message}"
backup_files: true
For additional help, run adt ValeFlagger -h
for command-line options or consult the ADT documentation for general toolkit usage.