-
Notifications
You must be signed in to change notification settings - Fork 85
Desktop App
This page describes the architecture, development setup, build options, and platform installation procedures for the desktop version of Markdown Viewer (v3.7.4), powered by the Neutralinojs runtime framework.
- Overview
- Workspace Directory Structure
- Prerequisites
- Local Development Setup
- Running in Hot-Reload Dev Mode
- Building the Application
- Build Output Configurations
- Building with Docker Containerization
- Platform-Specific Installation Guidelines
The desktop version of Markdown Viewer wraps the core web application (HTML, CSS, JS) inside a lightweight native OS webview container using the Neutralinojs framework.
- Minimal Footprint: Unlike Electron, which bundles a full Chromium browser and Node.js instance, Neutralinojs uses the system's built-in webview. This results in an executable size of less than 15 MB (compared to 150+ MB for Electron).
- Low Resource Usage: Idle memory usage is typically under 50 MB.
-
Shared Codebase: The desktop app uses the exact same core files (
script.js,styles.css,assets/) as the web application.
The desktop-app directory contains the configuration files and build scripts for the desktop version:
desktop-app/
├── package.json # Contains npm build scripts
├── neutralino.config.json # Configures Neutralino window size, titles, and API permissions
├── setup-binaries.js # Script to download Neutralino binaries for target platforms
├── prepare.js # Copies core files from the root folder into the resources folder
└── resources/ # Assets packaged into the desktop application
├── index.html # Compiled template page
├── styles.css # Stylesheet copied from the root folder
├── js/
│ ├── main.js # Handles desktop lifecycle events and tray menus
│ ├── script.js # Copied from the root folder
│ └── neutralino.js # Neutralino client API library
└── assets/ # Image assets copied from the root folder
To compile the desktop application from source, you will need:
- Node.js (v16.0.0 or later) and npm (installed automatically with Node).
- An active internet connection (only required during the initial setup to download Neutralino runtimes).
To set up the desktop project directory locally:
- Open your terminal and navigate to the
desktop-appfolder:cd Markdown-Viewer/desktop-app - Install dependencies:
npm install
- Download the required Neutralino framework binaries for Windows, Linux, and macOS:
node setup-binaries.js
- Copy the latest frontend code from the repository root into the desktop build resources folder:
node prepare.js
To run the application locally in development mode:
npm run devThis starts the desktop application in a new window. It enables a development server with hot-reload: edits to files in the resources/ folder will immediately update the running application without requiring a manual rebuild.
You can package the application in three ways:
This builds a single, self-contained Windows executable file that has all application resources embedded inside the binary:
npm run buildThis builds the application with the binary and a separate resources.neu file. This is standard for multi-platform distributions:
npm run build:portableThis compiles both the portable distribution ZIP file and the embedded Windows executable:
npm run build:allCompiled files are placed in the desktop-app/dist/ directory:
dist/
├── markdown-viewer/ # Contains portable binaries
├── markdown-viewer-release.zip # Compressed portable distribution
└── windows-embedded/
└── markdown-viewer/
└── markdown-viewer-win_x64.exe # Single-file Windows binary
To package the application without installing Node.js locally, use the provided Docker Compose configuration to compile the binaries inside a container:
# Run from the desktop-app folder
docker compose up --buildThe container downloads the required binaries, runs the build scripts, and saves the output to the host system's dist/ directory using a volume mount.
-
Installation: No installer is needed. Run
markdown-viewer-win_x64.exedirectly. - SmartScreen Warning: Because the executable is unsigned, Windows SmartScreen may display a warning on first launch. Click More info, then select Run anyway to launch the application.
Make the binary executable before running it:
chmod +x markdown-viewer-linux_x64
./markdown-viewer-linux_x64macOS blocks unsigned binaries by default. To run the app, clear the quarantine flag and make the file executable:
# Remove the macOS quarantine flag
xattr -d com.apple.quarantine markdown-viewer-mac_universal
# Grant execution permissions
chmod +x markdown-viewer-mac_universal
# Run the app
./markdown-viewer-mac_universalAlternatively, right-click the app binary in Finder, click Open, and select Open in the confirmation dialog.
Markdown Viewer Repository · Apache-2.0 License
Developed and maintained by ThisIs-Developer
📖 Overview & Reference
🚀 Getting Started & Usage
🐳 Deployment & Wrappers
🛠️ Development & Journey