-
Notifications
You must be signed in to change notification settings - Fork 57
Desktop App
This page covers the Neutralinojs desktop application port of Markdown Viewer — a lightweight, cross-platform native app built from the same source code as the web version.
- Overview
- Architecture
- Prerequisites
- Development Setup
- Running in Development Mode
- Building the Desktop App
- Build Output
- Building with Docker
- Automated Releases
- Platform Notes
The desktop application wraps the same HTML/CSS/JavaScript that powers the web app inside a native Neutralinojs window. It:
- Runs without a browser; by default it loads CDN libraries, so an internet connection is required on first run unless you bundle assets locally.
- Produces a single self-contained binary that can be distributed without installers.
- Shares 100% of the core code (
script.js,styles.css,assets/) with the web app — no duplication.
By default, the desktop app uses the same CDN-hosted libraries referenced in index.html (cdnjs, jsDelivr). To run fully offline:
- Download the CDN assets locally and update the
<script>/<link>tags inindex.html. - Run
node prepare.jsto copy the updated file intodesktop-app/resources/. - Rebuild the app with
npm run buildornpm run build:portable.
Once the assets are local, the desktop app runs without network access.
desktop-app/
├── package.json # NPM scripts (dev, build, setup)
├── neutralino.config.json # Neutralinojs window and API config
├── setup-binaries.js # Downloads Neutralinojs platform binaries
├── prepare.js # Copies shared files from root into resources/
└── resources/
├── index.html # Generated from root index.html
├── styles.css # Copied from root
├── js/
│ ├── main.js # Neutralinojs lifecycle & tray menu
│ ├── script.js # Copied from root
│ └── neutralino.js # Neutralinojs client library
└── assets/ # Copied from root assets/
The prepare.js script handles copying files from the project root into desktop-app/resources/ before each build so there is a single source of truth.
-
Node.js 16 or later (with
npm) - Internet access (required once to download Neutralinojs binaries)
# 1. Clone the repository
git clone https://github.com/ThisIs-Developer/Markdown-Viewer.git
cd Markdown-Viewer/desktop-app
# 2. Install npm dependencies
npm install
# 3. Download Neutralinojs platform binaries (one-time setup)
node setup-binaries.js
# 4. Prepare resource files (copies shared files from the root)
node prepare.jscd Markdown-Viewer/desktop-app
npm run devThis starts the app with hot-reload: editing source files in the resources/ directory reloads the running window automatically.
Three build modes are available:
All resources are embedded inside the binary. No additional files are needed at runtime.
npm run buildResources remain in a separate folder alongside the binary, making it easier to update them without rebuilding.
npm run build:portablenpm run build:allAfter building, output files are placed in desktop-app/dist/:
dist/
├── markdown-viewer-win_x64.exe # Windows embedded binary
├── markdown-viewer-linux_x64 # Linux x64 embedded binary
├── markdown-viewer-linux_arm64 # Linux ARM64 embedded binary
├── markdown-viewer-mac_universal # macOS universal binary
└── portable/ # Portable builds (if built)
├── markdown-viewer-win_x64/
├── markdown-viewer-linux_x64/
└── …
If you don't want to install Node.js locally, use the provided Docker setup to build the binaries inside a container:
cd Markdown-Viewer/desktop-app
docker compose up --buildThe output binaries are written to dist/ on the host machine via a volume mount.
The CI/CD pipeline (.github/workflows/desktop-build.yml) automatically builds and publishes binaries when a tag matching desktop-v* is pushed:
git tag desktop-v1.2.0
git push origin desktop-v1.2.0This triggers a GitHub Actions workflow that:
- Sets up Node.js
- Runs
npm installandnode setup-binaries.js - Runs
node prepare.js - Builds embedded binaries for all platforms
- Computes SHA-256 checksums
- Creates a GitHub Release with the binaries and checksums as assets
| File | Platform |
|---|---|
markdown-viewer-win_x64.exe |
Windows x64 |
markdown-viewer-linux_x64 |
Linux x64 |
markdown-viewer-linux_arm64 |
Linux ARM64 |
markdown-viewer-mac_universal |
macOS (Apple Silicon + Intel) |
checksums.sha256 |
SHA-256 verification file |
- Run the
.exedirectly — no installation required. - Windows Defender SmartScreen may warn about an unsigned executable. Click "More info → Run anyway".
- Mark the binary as executable after downloading:
chmod +x markdown-viewer-linux_x64
./markdown-viewer-linux_x64- macOS may block the binary because it is unsigned:
xattr -d com.apple.quarantine markdown-viewer-mac_universal
chmod +x markdown-viewer-mac_universal
./markdown-viewer-mac_universalOr right-click the binary in Finder, select Open, and confirm the security prompt.