Files
amitwh 111d36bf3d refactor(flowchart): build script generates bundle from pure modules (D1)
Before this commit, src/renderer/flowchart-bundle.js was a 1700+
line hand-maintained file with ~1100 lines of inlined copies of the
pure modules (shapes, mermaid, mermaid-parse, store, canvas,
clipboard, align). Every change to a pure module required a manual
re-sync, and the C17 multi-select commit had to be applied in two
places — drift between source and bundle was a real risk.

This refactor introduces scripts/build-flowchart-bundle.js that
reads each pure module from src/flowchart/ and concatenates them
into the final src/renderer/flowchart-bundle.js that the standalone
window loads as a single <script> tag.

Architecture:

  - src/renderer/flowchart-bundle.js — now auto-generated, gitignored
    only conceptually (still tracked so the standalone window works
    without running a build step in dev).
  - src/renderer/flowchart-bundle-tail.js — the unique code that
    was previously buried in the middle of the hand-maintained bundle:
    IIFE open, defensive checks, pure-module destructure, controller
    bootstrap, modal helpers, node-list panel, closing IIFE, and
    DOMContentLoaded bootstrap trigger.
  - scripts/build-flowchart-bundle.js — the generator. Reads 8 pure
    modules in dependency order (vsdx-export excluded — main-process
    only), wraps each in its own IIFE for scope isolation, rewrites
    canvas's CommonJS require() lines to use window globals, and
    rewrites bare 'module.exports = X' to 'window.FlowchartX = X'
    for modules without UMD guards.

Tests: 1386/1386 passing (no regressions). The pre-existing per-node
fill color test that was passing before now passes for the right
reason — the canvas source was updated to pass node.color through
to shapeSvg, which it always should have. The hand-maintained bundle
had been silently carrying a patched version that passed color but
was never backported to src/.

Amit Haridas
2026-10-01 07:31:37 +05:30
..

PanConverter Windows Explorer Context Menu Integration

This directory contains scripts to add PanConverter to the Windows Explorer context menu, allowing you to right-click on files and convert them directly without opening the full application.

Features

Context Menu Options

  • Convert with PanConverter: Shows a format selection dialog for any supported file
  • PanConverter > Convert to...: Direct conversion options (for Markdown files)
    • PDF
    • HTML
    • DOCX
    • LaTeX
    • PowerPoint

Supported File Types

  • Markdown: .md, .markdown
  • HTML: .html, .htm
  • Documents: .docx, .odt, .rtf
  • LaTeX: .tex
  • PDF: .pdf
  • Presentations: .pptx, .ppt, .odp

Installation Methods

Method 1: Automatic (During PanConverter Installation)

When installing PanConverter using the Windows installer, you'll be prompted to install context menu integration automatically.

Method 2: Manual Installation

  1. Right-click on install-context-menu.ps1
  2. Select "Run with PowerShell"
  3. Follow the prompts (will request administrator privileges)

Using Batch File

  1. Right-click on install-context-menu.bat
  2. Select "Run as administrator"
  3. Follow the prompts

Using Registry File Directly

  1. Right-click on install-context-menu.reg
  2. Select "Merge"
  3. Confirm the registry modification

Uninstallation

Using PowerShell

.\install-context-menu.ps1 -Uninstall

Using Batch File

Run uninstall-context-menu.bat as administrator

Using Registry File

Run uninstall-context-menu.reg

How It Works

Command Line Interface

The context menu integration works by passing command line arguments to PanConverter:

  • --convert <file>: Shows conversion dialog for the specified file
  • --convert-to <format> <file>: Directly converts to the specified format

Examples

# Show conversion dialog
PanConverter.exe --convert "document.md"

# Direct conversion to PDF
PanConverter.exe --convert-to pdf "document.md"

Conversion Process

  1. PanConverter reads the input file
  2. Creates a temporary file if needed
  3. Uses Pandoc to convert to the target format
  4. Saves the output in the same directory as the input file
  5. Shows a Windows notification when complete

Requirements

  • PanConverter must be installed in the default location: %LOCALAPPDATA%\Programs\PanConverter\
  • Pandoc must be installed and accessible from the command line
  • Administrator privileges required for registry modifications

Troubleshooting

Context Menu Not Appearing

  1. Ensure you ran the installation script as administrator
  2. Try logging out and back in, or restart Windows Explorer
  3. Check if PanConverter is installed in the expected location

Conversion Failures

  1. Verify Pandoc is installed: pandoc --version
  2. Check if the input file is not corrupted or locked
  3. Ensure you have write permissions in the output directory

Permission Errors

  • The installation scripts require administrator privileges to modify the registry
  • If you get permission errors, right-click and "Run as administrator"

File Descriptions

  • install-context-menu.reg: Registry entries for context menu
  • uninstall-context-menu.reg: Registry entries removal
  • install-context-menu.ps1: PowerShell installation script
  • install-context-menu.bat: Batch installation script
  • uninstall-context-menu.bat: Batch uninstallation script
  • nsis-installer.nsh: NSIS installer integration script

Security Note

The scripts modify the Windows registry to add context menu entries. Only run these scripts if you trust the source and understand the changes being made to your system.