Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docx-editor-wrapper

A DOCX preview plugin for Seer — press Space on any .docx file and instantly preview it as rendered HTML.

The client-side renderer is docx-preview (paired with jszip for ZIP reading).

How it works

The converter (convert.js) embeds the source .docx as base64 inside a single self-contained HTML file. That HTML loads docx-preview.js + jszip.min.js from the plugin's runtime/ directory via file:// and renders the document entirely in the browser — no server, no network.

.docx  ──▶  convert  ──▶  <stem>.html  (DOCX embedded as base64 + runtime JS refs)

Features

  • Instant DOCX preview in Seer — press Space on any .docx file
  • Faithful rendering via docx-preview: paragraphs, tables, images, fonts, headings, lists
  • Comments and tracked changes visible in the preview
  • Offline — no network access required
  • Read-only preview, no editing controls
  • Release package has zero runtime dependencies — no Node.js needed after install

Repository layout

.
├── bin/                          ← Release artifact (installable in Seer as-is)
│   ├── plugin.json               ←   Seer metadata, entry: "convert.exe"
│   ├── convert.exe               ←   Standalone SEA executable (88 MB)
│   └── runtime/
│       ├── docx-preview.js       ←   Client-side DOCX renderer
│       └── jszip.min.js          ←   ZIP reading for docx-preview
├── docx_plugin_mvp/              ← Source tree (dev workflow)
│   ├── plugin.json               ←   Dev entry: "convert.ps1"
│   ├── convert.ps1               ←   PowerShell launcher (finds node, calls convert.js)
│   ├── _sample.docx              ←   Bundled sample for quick testing
│   └── runtime/
│       ├── setup.ps1             ←   npm install — ONE-TIME setup
│       └── docx-viewer/
│           ├── convert.js        ←   ★ Core converter (Node.js)
│           ├── package.json
│           └── node_modules/
├── build-release.ps1             ← Build convert.exe from source
├── LICENSE                       ← Apache 2.0
├── NOTICE                        ← Third-party attribution
└── AGENTS.md                     ← Build / test / contract / conventions

Development

One-time setup

.\docx_plugin_mvp\runtime\setup.ps1

This runs npm install in docx_plugin_mvp/runtime/docx-viewer/ to fetch docx-preview and jszip.

Iterating on the converter

# Run directly (no rebuild needed)
node .\docx_plugin_mvp\runtime\docx-viewer\convert.js --input sample.docx --output out.html

# Then rebuild the .exe
.\build-release.ps1

Building the release executable

Requirements: Node.js 18+, npm.

.\build-release.ps1

This bundles the Node.js runtime + convert.js into bin/convert.exe via Node.js Single Executable Application (SEA), and copies the runtime assets. No system Node.js is needed after the build.

Testing

Run from the repo root — all tests use relative paths:

# Full end-to-end: generates sample .docx, runs converter, checks HTML output
.\docx_plugin_mvp\test_real_output.ps1

# Launcher argument parsing (same pipeline)
.\docx_plugin_mvp\test_convert_launcher.ps1

Manual .exe smoke test

.\bin\convert.exe --input .\some.docx --output .\test_out

Use with Seer

Seer is the quick-look file preview tool for Windows. Press Space on any file to preview it instantly.

As a developer (dev plugin)

  1. Run .\docx_plugin_mvp\runtime\setup.ps1 to install dependencies
  2. Point Seer at the docx_plugin_mvp folder (Settings → Plugins → Install)
  3. Press Space on any .docx file to preview

As an end user (release package)

The bin/ directory is self-contained and can be installed directly — no Node.js or setup required:

bin/
├── plugin.json          ← Seer metadata
├── convert.exe          ← Standalone executable (88 MB)
└── runtime/
    ├── docx-preview.js  ← Client-side DOCX renderer
    └── jszip.min.js     ← ZIP support

License

Apache 2.0 — see LICENSE and NOTICE.

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages