Files
tegwick 66cbd5c3d8 docs: comprehensive feature documentation and HTML generation system
Added complete documentation for all TestDrive-JSUI controls and features,
plus flexible HTML generation system supporting standalone and external modes.

Documentation (8 files, 3,533 lines):
- docs/features/README.md: Central hub with overview, config, examples
- docs/features/section-editing.md: Section editing guide
- docs/features/edit-control.md: Document actions and editing tools
- docs/features/status-control.md: Real-time statistics and tracking
- docs/features/contents-control.md: Table of contents navigation
- docs/features/debug-control.md: Development and debugging tools
- docs/features/keyboard-shortcuts.md: Complete shortcuts reference
- docs/features/themes.md: Visual theming and customization

HTML Generation System (3 files, 1,104 lines):
- js/utils/html-generator.js: Dual-mode HTML generator class
  * Standalone mode: All CSS/JS embedded inline
  * External mode: References _jsui/ directory
  * Configurable options for title, content, controls, theme
  * Download and save functionality

- _jsui/ directory: External resources structure
  * README.md: Comprehensive usage guide
  * css/: Symlinked CSS files (base, editor, controls, themes)
  * js/: Symlinked JavaScript files (core, components, controls)
  * Enables smaller HTML files with browser caching

- examples/html-generator-demo.html: Interactive demo
  * Web-based configuration form
  * Side-by-side mode comparison
  * Live generation and preview
  * Download and copy functionality

Key Features:
- 4,637 total lines of documentation and code
- All controls documented with examples and troubleshooting
- Flexible deployment options (standalone vs external)
- Developer-friendly structure with clear guides
- Production-ready system

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-16 14:31:56 +01:00
..

TestDrive-JSUI Features

Complete feature documentation for TestDrive-JSUI

TestDrive-JSUI provides a modular system of interactive controls that enhance markdown editing and viewing. Each control can be enabled/disabled independently and positioned using compass directions.


📚 Feature Documentation

Core Features

Control Panels

Edit Control 📝

Position: Northeast (ne) Purpose: Document actions and editing tools

Features:

  • Print, save, export document
  • Navigation helpers (scroll to top/bottom, go to line)
  • Text formatting tools
  • Find & replace
  • Font size adjustment
  • Markdown shortcuts

→ Full Documentation


Status Control 📊

Position: East (e) Purpose: Real-time document statistics

Features:

  • Word and character count
  • Reading time estimation
  • Document structure analysis (headings, paragraphs, lists)
  • Change tracking
  • Content complexity metrics

→ Full Documentation


Contents Control 📋

Position: Northwest (nw) Purpose: Table of contents navigation

Features:

  • Automatic heading extraction
  • Hierarchical display with indentation
  • Click to navigate with smooth scrolling
  • Search within headings
  • Real-time updates

→ Full Documentation


####Debug Control 🐛 Position: Southeast (se) Purpose: Development and debugging tools

Features:

  • Real-time debug logs
  • Error tracking
  • Performance monitoring
  • Component state inspection
  • Event tracking

→ Full Documentation


🎛️ Configuration

Enabling/Disabling Controls

const editor = new TestDriveJSUI({
    container: '#editor',
    markdown: '# My Document',
    mode: 'edit',

    // Control configuration
    controls: {
        editControl: true,      // Document actions (default: true)
        statusControl: true,    // Statistics (default: true)
        contentsControl: true,  // Table of contents (default: true)
        debugControl: false     // Debug logs (default: false)
    }
});

Custom Positioning

const editor = new TestDriveJSUI({
    container: '#editor',

    // Custom compass positions
    controlPositions: {
        editControl: 'ne',      // Northeast (default)
        statusControl: 'e',     // East (default)
        contentsControl: 'nw',  // Northwest (default)
        debugControl: 'se'      // Southeast (default)
    }
});

Compass Positions:

  • nw - Northwest (top-left)
  • ne - Northeast (top-right)
  • e - East (middle-right)
  • se - Southeast (bottom-right)
  • s - South (bottom-center)
  • sw - Southwest (bottom-left)
  • w - West (middle-left)

🎨 Control Behavior

States

Each control has two states:

  1. Collapsed (40x40px icon button)

    • Minimal screen space
    • Shows icon only
    • Click to expand
  2. Expanded (full panel)

    • Shows full functionality
    • Draggable by header
    • Resizable from bottom-left corner
    • Click close (✕) to collapse

Interactions

  • Click icon: Expand panel
  • Click header: Toggle content visibility (header-only mode)
  • Drag header: Reposition panel
  • Drag resize handle: Resize panel
  • Click close (✕): Collapse to icon

📖 Example Configurations

Minimal (Section Editing Only)

new TestDriveJSUI({
    container: '#editor',
    controls: {
        editControl: false,
        statusControl: false,
        contentsControl: false,
        debugControl: false
    }
});

Writer Mode (Edit + Status)

new TestDriveJSUI({
    container: '#editor',
    controls: {
        editControl: true,
        statusControl: true,
        contentsControl: false,
        debugControl: false
    }
});

Reader Mode (Contents Only)

new TestDriveJSUI({
    container: '#editor',
    mode: 'view',
    controls: {
        editControl: false,
        statusControl: false,
        contentsControl: true,
        debugControl: false
    }
});

Developer Mode (All Controls)

new TestDriveJSUI({
    container: '#editor',
    controls: {
        editControl: true,
        statusControl: true,
        contentsControl: true,
        debugControl: true  // Enable debug panel
    }
});

🔧 Advanced Features

Auto-save

new TestDriveJSUI({
    container: '#editor',
    autosave: true  // Saves to localStorage every 30 seconds
});

Keyboard Shortcuts

new TestDriveJSUI({
    container: '#editor',
    shortcuts: true  // Enable keyboard shortcuts (default: true)
});

Common shortcuts:

  • Ctrl+S - Save document
  • Escape - Close editor/dialog
  • Ctrl+F - Find & replace
  • Ctrl+B - Bold
  • Ctrl+I - Italic

Themes

new TestDriveJSUI({
    container: '#editor',
    theme: 'github'  // Available: 'github' (more coming soon)
});

🎯 Use Cases

Documentation Editor

new TestDriveJSUI({
    container: '#editor',
    controls: {
        editControl: true,      // For saving/exporting
        statusControl: true,    // Track word count
        contentsControl: true,  // Navigate long docs
        debugControl: false
    }
});

Blog Post Editor

new TestDriveJSUI({
    container: '#editor',
    controls: {
        editControl: true,      // Save drafts
        statusControl: true,    // Monitor length
        contentsControl: false, // Usually shorter posts
        debugControl: false
    }
});

Code Documentation Viewer

new TestDriveJSUI({
    container: '#viewer',
    mode: 'view',
    controls: {
        editControl: false,
        statusControl: false,
        contentsControl: true,  // Navigate API docs
        debugControl: false
    }
});

📚 Next Steps

  • Read individual control documentation for detailed features
  • Check out examples for working demos
  • See API Reference for complete API documentation

Version: 1.0.0 Last Updated: 2025-12-16