Skip to content

Enhancement: Comprehensive markmv functionality improvements based on real-world usage #33

@Mearman

Description

@Mearman

Background

After extensive use of markmv for a large documentation reorganization project (Wagl's Twilio documentation), I've identified several key areas where markmv could be significantly enhanced to provide better user experience and automation capabilities.

Current Experience

Used markmv successfully for:

  • Validating 83 links across 6 documentation files
  • Reorganizing fragmented Twilio documentation
  • Fixing broken internal and external links
  • Maintaining documentation consistency

Proposed Enhancements

1. Enhanced Validation Output

Current: Minimal output with basic broken link count
Needed:

  • Show line numbers where links are found
  • Categorize internal vs external links
  • Progress indicators for large documentation sets
  • Summary statistics (total files, links by type, processing time)
# Example improved output
markmv validate docs/
📄 Processing docs/twilio/verify-api-limitations.md...
   ✅ Line 45: [Official Twilio Docs](https://twilio.com/docs/verify)
   ❌ Line 67: [Missing File](./non-existent.md) - File not found
   
📊 Summary: 6 files, 83 links (45 internal, 38 external), 2 broken, 1.2s

2. Interactive Link Fixing

Current: Manual fixing required
Needed:

  • Interactive prompts for broken link corrections
  • Auto-suggestions for similar existing files
  • Pattern-based bulk corrections
  • Automatic backup creation before changes
markmv validate --fix docs/
❌ Broken link: ./sms-voice-patterns.md
   Suggestions:
   1. ./magic-numbers-reference.md
   2. ./testing-strategies.md
   3. Skip this link
   Choice [1-3]: 1
✅ Fixed: ./sms-voice-patterns.md → ./magic-numbers-reference.md

3. Documentation Analysis Features

  • Reference graph: Visualize documentation interconnections
  • Orphaned file detection: Find files with no incoming links
  • Circular reference detection: Identify documentation loops
  • Link health scoring: Rate documentation interconnectedness

4. CI/CD Integration

Current: Limited automation support
Needed:

# Machine-readable output for automation
markmv validate --format=json --strict
markmv validate --fail-fast          # Stop on first error
markmv validate --exit-code          # Non-zero exit on broken links

5. External Link Management

Current: Basic external link checking
Needed:

  • Response caching to avoid repeated requests
  • Configurable timeouts for slow sites
  • Retry logic for transient failures
  • Domain whitelist for known problematic sites

6. Documentation Standards Enforcement

  • Frontmatter validation (required metadata)
  • Link format enforcement (relative vs absolute)
  • Internal anchor validation (#section links)
  • Referenced image existence checking

Priority Ranking

High Priority:

  1. Enhanced validation output with line numbers
  2. Interactive fixing mode
  3. CI/CD integration with JSON output

Medium Priority:
4. External link caching and retry logic
5. Documentation analysis features
6. Standards enforcement

Low Priority:
7. Advanced visualization features

Use Case Example

During the Wagl project, I had to:

  1. Run markmv validate to find broken links
  2. Manually search files to locate broken links (no line numbers)
  3. Manually determine correct replacements
  4. Manually edit files to fix links
  5. Re-run validation to confirm fixes

With these enhancements, this would become:

  1. Run markmv validate --fix
  2. Accept suggested corrections interactively
  3. Automatic validation confirmation

Implementation Suggestions

  • Consider using inquirer for interactive prompts
  • Add --json flag for structured output
  • Implement caching with TTL for external links
  • Use fuzzy matching for file suggestions (e.g., fuse.js)

Real-World Impact

These improvements would significantly reduce documentation maintenance overhead and make markmv suitable for:

  • Large-scale documentation projects
  • CI/CD pipeline integration
  • Team collaboration workflows
  • Automated documentation quality gates

The current version is functional but requires significant manual work. These enhancements would transform markmv from a validation tool into a comprehensive documentation maintenance solution.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions