Skip to content

Feature Request: Markdown File Tree Visualization and Statistics #20

@Mearman

Description

@Mearman

Feature Request: Markdown File Tree Visualization and Statistics

Problem

Currently, markmv focuses on file operations but lacks functionality for visualizing and analyzing markdown file structures. Users need better ways to understand and navigate complex documentation hierarchies.

Proposed Solution

Add functionality to visualize markdown file trees and generate comprehensive statistics about documentation structure and content.

Core Features

1. File Tree Visualization

  • Generate visual tree representations of markdown file structures
  • Support different output formats (ASCII, HTML, JSON)
  • Include file metadata (size, links, last modified)
  • Highlight broken links and orphaned files

2. Documentation Statistics

  • Structure Analysis: File count, directory depth, organization patterns
  • Content Metrics: Word count, character count, reading time estimates
  • Link Analysis: Internal/external link counts, link health, connectivity maps
  • Cross-Reference Stats: Most/least referenced files, isolated content
  • Health Metrics: Broken links, missing files, orphaned content

3. Interactive Building/Serving

  • Generate static HTML documentation sites from markdown trees
  • Live preview server with auto-refresh
  • Navigation generation from file structure
  • Search functionality across all files

Use Cases

  1. Documentation Audit: Understand structure and identify gaps
  2. Navigation Generation: Auto-create table of contents and site maps
  3. Content Planning: Analyze documentation coverage and organization
  4. Quality Assessment: Identify broken links and orphaned content
  5. Migration Planning: Understand current state before restructuring

Suggested API

// Generate file tree visualization
const tree = await generateFileTree('./docs', {
  format: 'ascii' | 'html' | 'json',
  includeStats: true,
  showBrokenLinks: true
});

// Get comprehensive statistics
const stats = await getMarkdownStats('./docs', {
  includeContent: true,
  analyzeLinkHealth: true,
  generateMetrics: true
});

// Build interactive documentation site
await buildDocSite('./docs', './output', {
  theme: 'default',
  includeSearch: true,
  generateNavigation: true
});

// Serve with live preview
await serveDocSite('./docs', { port: 3000, watch: true });

Example Output

📁 Documentation Tree
├── 📄 README.md (2.3k words, 15 links)
├── 📁 guides/
│   ├── 📄 getting-started.md (1.8k words, 8 links)
│   └── 📄 advanced.md (3.2k words, 12 links) ⚠️ 2 broken links
├── 📁 api/
│   └── 📄 reference.md (4.1k words, 25 links)
└── 📄 CHANGELOG.md (orphaned) ⚠️

📊 Statistics:
- Total files: 5 markdown files
- Total words: 11,400 words (~45 min read)
- Internal links: 47 (3 broken)
- External links: 13 (all healthy)
- Orphaned files: 1

Additional Context

This would complement the existing file operations by providing analysis and visualization capabilities, making markmv a complete documentation management solution. The tree visualization and statistics would help users understand their documentation structure before performing operations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions