|
| 1 | +# Markdown Viewer Desktop App Port |
| 2 | + |
| 3 | +This is a desktop app port of [Markdown Viewer](https://github.com/ThisIs-Developer/Markdown-Viewer), see [README](../README.md). It is built using [Neutralinojs](https://github.com/neutralinojs/neutralinojs). |
| 4 | + |
| 5 | +## Architecture |
| 6 | + |
| 7 | +The desktop app **shares** its core files (`script.js`, `styles.css`, `assets/`) with the browser version in the repo root. A build script (`prepare.js`) copies these files into `resources/` and injects Neutralinojs-specific additions into `index.html` at build time. |
| 8 | + |
| 9 | +Neutralinojs platform binaries are managed by `setup-binaries.js`, which downloads them on first use and caches them in `bin/` (gitignored). The download is version-locked to `cli.binaryVersion` in `neutralino.config.json` and only re-triggered when that version changes. |
| 10 | + |
| 11 | +Desktop-only files (not generated): |
| 12 | + |
| 13 | +- `resources/js/main.js` — Neutralinojs lifecycle, tray menu, window events |
| 14 | +- `resources/js/neutralino.js` — Neutralinojs client library |
| 15 | +- `neutralino.config.json` — App configuration |
| 16 | +- `setup-binaries.js` — Idempotent binary setup (downloads on first use) |
| 17 | + |
| 18 | +## Development |
| 19 | + |
| 20 | +### Requirements |
| 21 | + |
| 22 | +- [Node.js](https://nodejs.org/) |
| 23 | + |
| 24 | +### Setup |
| 25 | + |
| 26 | +No installation is required. The app is built and run using `npx` (via npm scripts). |
| 27 | + |
| 28 | +Neutralinojs platform binaries are downloaded automatically on first build or dev run. To manually trigger the download: |
| 29 | + |
| 30 | +```bash |
| 31 | +npm run setup |
| 32 | +``` |
| 33 | + |
| 34 | +Binaries are cached in `bin/` (gitignored) and only re-downloaded when `cli.binaryVersion` in `neutralino.config.json` changes. |
| 35 | + |
| 36 | +### Running the app |
| 37 | + |
| 38 | +```bash |
| 39 | +npm run dev |
| 40 | +``` |
| 41 | + |
| 42 | +This automatically runs `setup` (downloads binaries if needed and prepares resources) before starting the app. Hot-reload is enabled by default. Enable the browser inspector by setting `"enableInspector": true` in `neutralino.config.json`. |
| 43 | + |
| 44 | +For more information, see the [Neutralinojs documentation](https://neutralino.js.org/docs/cli/neu-cli#installation). |
| 45 | + |
| 46 | +### Building the app |
| 47 | + |
| 48 | +**Default** — Single-file executables with embedded resources: |
| 49 | + |
| 50 | +```bash |
| 51 | +npm run build |
| 52 | +``` |
| 53 | + |
| 54 | +**Portable** — ZIP bundle with separate `resources.neu` file: |
| 55 | + |
| 56 | +```bash |
| 57 | +npm run build:portable |
| 58 | +``` |
| 59 | + |
| 60 | +**Both** — Build embedded + portable in one step: |
| 61 | + |
| 62 | +```bash |
| 63 | +npm run build:all |
| 64 | +``` |
| 65 | + |
| 66 | +Build output is placed in `dist/`. |
| 67 | + |
| 68 | +For more information, see the [Neutralinojs documentation](https://neutralino.js.org/docs/cli/neu-cli#neu-build). |
| 69 | + |
| 70 | +### Building with Docker |
| 71 | + |
| 72 | +Build binaries without installing Node.js locally: |
| 73 | + |
| 74 | +```bash |
| 75 | +docker compose up --build |
| 76 | +``` |
| 77 | + |
| 78 | +Build artifacts will be output to `desktop-app/output/`. |
| 79 | + |
| 80 | +## Releases |
| 81 | + |
| 82 | +Prebuilt binaries are automatically built and published as GitHub Releases when a tag matching `desktop-v*` is pushed (e.g., `desktop-v1.0.0`). See [`.github/workflows/desktop-build.yml`](../.github/workflows/desktop-build.yml). |
| 83 | + |
| 84 | +Each release includes: |
| 85 | + |
| 86 | +| Asset | Description | |
| 87 | +| ----- | ----------- | |
| 88 | +| `markdown-viewer-win_x64.exe` | Windows x64 executable | |
| 89 | +| `markdown-viewer-linux_x64.tar.gz` | Linux x64 executable (tarball) | |
| 90 | +| `markdown-viewer-linux_arm64.tar.gz` | Linux ARM64 executable (tarball) | |
| 91 | +| `markdown-viewer-mac_*.tar.gz` | macOS executables (tarball) | |
| 92 | +| `markdown-viewer-release.zip` | Portable bundle with `resources.neu` (all platforms) | |
| 93 | +| `source.tar.gz` | Desktop app source archive | |
| 94 | +| `SHA256SUMS.txt` | Checksums for all release assets | |
| 95 | + |
| 96 | +## License |
| 97 | + |
| 98 | +**MIT**. |
| 99 | + |
| 100 | +The desktop version uses [Neutralinojs](https://github.com/neutralinojs/neutralinojs), which is also licensed under the MIT License. |
| 101 | + |
| 102 | +- [Neutralinojs](https://github.com/neutralinojs/neutralinojs): [LICENSE (MIT)](LICENSE) |
| 103 | +- [Markdown Viewer & Desktop Port](https://github.com/ThisIs-Developer/Markdown-Viewer): [LICENSE (MIT)](../LICENSE) |
| 104 | + |
| 105 | +## Contributors |
| 106 | + |
| 107 | +[](https://github.com/ThisIs-Developer/Markdown-Viewer/graphs/contributors) |
0 commit comments