From f4eab22af439f92ea7edc88dc3896f8817dab268 Mon Sep 17 00:00:00 2001
From: Baivab Sarkar
-
+
+
+
+
-
-
- Markdown Viewer
- **A Markdown Editor That Lives in Your Browser, Desktop, and a Single URL.**
+ **A Premium Browser-Based Markdown Editor, Viewer, and Reader.**
- *Fast GitHub-style Markdown editing with live preview, diagrams, LaTeX, syntax highlighting, PDF export, and multi-tab support across web, desktop, and Docker.*
+ *Open, read, edit, and preview `.md` files with split-screen live preview, sync scrolling, GitHub-Flavored Markdown, diagrams, LaTeX, syntax highlighting, PDF/HTML/PNG export, and multi-tab support across web, desktop, and Docker.*
[](https://github.com/ThisIs-Developer/Markdown-Viewer/blob/main/LICENSE)
[](https://github.com/ThisIs-Developer/Markdown-Viewer/releases)
@@ -43,6 +43,7 @@
- [About the Project](#about-the-project)
+ - [Current Behavior and Privacy](#current-behavior-and-privacy)
- [Key Features](#key-features)
- [System Architecture](#system-architecture)
- [High-Level Architecture Diagram](#high-level-architecture-diagram)
@@ -63,19 +64,29 @@
## About the Project
-**Markdown Viewer** is an advanced, fully client-side editing suite and previewer optimized for a professional documentation workflow. Running completely inside the browser, it renders GitHub-Flavored Markdown (GFM), math formulas, and architectural diagrams in real time.
+**Markdown Viewer** is a premium browser-based Markdown editor, viewer, reader, and previewer optimized for professional documentation workflows. It opens local `.md` and `.markdown` files, lets you write in plain Markdown, and renders GitHub-Flavored Markdown (GFM), math formulas, diagrams, code blocks, tables, and other rich Markdown content in a split-screen live preview with sync scrolling.
-Designed with privacy and performance at its core, the application performs all parsing in a background worker thread, employs incremental DOM patching to minimize browser repaints, and supports native offline capabilities via a Service Worker proxy. It is also packaged as a lightweight native desktop shell using the Neutralinojs framework.
+Designed with privacy and performance at its core, the application keeps ordinary editing, previewing, autosave, and most exports on your device, performs heavy parsing in a background worker thread, uses incremental DOM patching to minimize browser repaints, and supports offline-capable PWA behavior after the web build has cached its assets. It is also packaged as a lightweight native desktop shell using the Neutralinojs framework.
---
-## Key Features
+## Current Behavior and Privacy
-### 📐 LaTeX Math Notation
-Render inline and display mathematical formulas natively using the MathJax typesetting engine.
-
-
+
+
+
@@ -111,17 +146,10 @@ Render and interact with STL (ASCII/Binary) files featuring perspective controls
-
+
-
+
-
-
@@ -313,11 +335,12 @@ graph TD
## Getting Started & Installation
-### 💻 Option 1: Quick Local Run (No Installation/No Server)
-Because Markdown Viewer runs completely client-side utilizing standard HTML, CSS, and JavaScript, you can run it instantly directly from your filesystem:
+### 💻 Option 1: Quick Local Run (No Installation)
+Because Markdown Viewer uses Web Workers, Service Workers, and browser storage APIs, run it through a local HTTP server instead of opening `index.html` with `file://`:
1. Clone or download the repository to your local machine.
-2. Open the repository folder in your system **File Manager**.
-3. Simply double-click **`index.html`** to open the editor directly in your default web browser.
+2. Open a terminal in the repository folder.
+3. Run `python -m http.server 8080` or `npx serve . -p 8080`.
+4. Open **[http://localhost:8080](http://localhost:8080)** in your browser.
---
@@ -360,10 +383,8 @@ You can compile and run a native standalone desktop app (Windows, macOS, or Linu
# Synchronize resources with the main web app
node prepare.js
- # Build/compile the application for Windows and other systems
+ # Build/compile the release application
npm run build
- # Or build a standalone portable executable
- npm run build:portable
```
*Note: You can also download prebuilt standalone binaries directly from the [Releases](https://github.com/ThisIs-Developer/Markdown-Viewer/releases) page without compiling it yourself.*
@@ -430,26 +451,31 @@ Markdown-Viewer/
| Library Name | Version | Role in App | Loading Method |
| :--- | :--- | :--- | :--- |
-| **[Marked.js](https://marked.js.org/)** | 9.1.6 | Parses markdown content to HTML elements. | Defer (Upfront) |
-| **[Highlight.js](https://highlightjs.org/)** | 11.9.0 | Adds syntax highlighting to code sections. | Defer (Upfront) |
-| **[DOMPurify](https://github.com/cure53/DOMPurify)** | 3.0.9 | Sanitizes HTML outputs against XSS. | Defer (Upfront) |
-| **[FileSaver.js](https://github.com/eligrey/FileSaver.js/)** | 2.0.5 | Manages file saving on the client side. | Defer (Upfront) |
-| **[js-yaml](https://github.com/nodeca/js-yaml)** | 4.1.0 | Parses YAML frontmatter headers. | Defer (Upfront) |
-| **[Bootstrap](https://getbootstrap.com)** | 5.3.2 | Provides component structures and modal panels. | Upfront Script |
-| **[Bootstrap Icons](https://icons.getbootstrap.com/)** | 1.11.3 | Provides responsive vector symbols across formatting tools and headers. | Preloaded (Upfront) |
-| **[GitHub Markdown CSS](https://github.com/sindresorhus/github-markdown-css)** | 5.3.0 | Matches GitHub's exact light and dark typography rendering styles. | Upfront / Exports |
-| **[Mermaid.js](https://mermaid.js.org/)** | 11.15.0 | Renders interactive flowcharts and diagrams. | Lazy-loaded on diagram find |
-| **[MathJax](https://www.mathjax.org/)** | 3.2.2 | Renders mathematical LaTeX expressions. | Lazy-loaded on math find |
-| **[jsPDF](https://github.com/parallax/jsPDF)** | 2.5.1 | Generates paginated PDF documents client-side. | Lazy-loaded on PDF request |
-| **[html2canvas](https://html2canvas.hertzen.com/)** | 1.4.1 | Captures HTML layouts as canvas objects. | Lazy-loaded on PDF request |
-| **[pako.js](https://github.com/nodeca/pako)** | 2.1.0 | Handles DEFLATE compression for share links, PlantUML, and D2 diagrams. | Lazy-loaded on share, PlantUML, or D2 request |
-| **[JoyPixels](https://www.joypixels.com/)** | 9.0.1 | Renders standard emoji sets. | Lazy-loaded on emoji select |
-| **[Leaflet](https://leafletjs.com/)** | 1.9.4 | Powers interactive GeoJSON and TopoJSON map overlays. | Lazy-loaded on map detection |
-| **[TopoJSON](https://github.com/topojson/topojson)** | 3.0.2 | Parses TopoJSON structures into standard GeoJSON coordinates. | Lazy-loaded on topojson detection |
-| **[Three.js](https://threejs.org/)** | r128 | Renders STL 3D models with canvas viewports. | Lazy-loaded on STL file detection |
-| **[ABC Music Notation (abcjs)](https://www.abcjs.net/)** | 6.5.2 | Renders sheet music notation from raw text definitions. | Lazy-loaded on abc music detection |
-| **[PlantUML](https://plantuml.com/)** | - | External server rendering SVG diagrams from compressed markup. | Lazy-loaded on PlantUML detection |
-| **[Kroki / D2](https://kroki.io/)** | - | External server rendering D2 diagrams into theme-matched SVG. | Lazy-loaded on D2 detection |
+| **[Bootstrap](https://getbootstrap.com)** | 5.3.2 | Provides responsive layout, dropdowns, modals, and UI components. | Initial page load |
+| **[Bootstrap Icons](https://icons.getbootstrap.com/)** | 1.11.3 | Provides toolbar, header, modal, and action icons. | Initial page load |
+| **[GitHub Markdown CSS](https://github.com/sindresorhus/github-markdown-css)** | 5.3.0 | Provides GitHub-style preview typography for the rendered document. | Initial page load / exports |
+| **[Marked.js](https://marked.js.org/)** | 9.1.6 | Parses Markdown into HTML in the main thread and preview worker. | Initial page load / worker |
+| **[Highlight.js](https://highlightjs.org/)** | 11.9.0 | Adds syntax highlighting to fenced code blocks. | Initial page load / worker |
+| **[DOMPurify](https://github.com/cure53/DOMPurify)** | 3.0.9 | Sanitizes rendered HTML before it enters the preview. | Initial page load |
+| **[FileSaver.js](https://github.com/eligrey/FileSaver.js/)** | 2.0.5 | Handles browser downloads for exported files. | Initial page load |
+| **[js-yaml](https://github.com/nodeca/js-yaml)** | 4.1.0 | Parses YAML frontmatter for display and export handling. | Initial page load |
+| **[MathJax](https://www.mathjax.org/)** | 3.2.2 | Renders inline and display LaTeX math. | Lazy-loaded on math detection |
+| **[Mermaid.js](https://mermaid.js.org/)** | 11.15.0 | Renders Mermaid diagrams with zoom, copy, PNG, and SVG actions. | Lazy-loaded on Mermaid detection |
+| **[jsPDF](https://github.com/parallax/jsPDF)** | 2.5.1 | Builds the legacy raster PDF export. | Lazy-loaded on legacy PDF request |
+| **[html2canvas](https://html2canvas.hertzen.com/)** | 1.4.1 | Captures rendered HTML for legacy PDF and PNG export. | Lazy-loaded on PDF/PNG request |
+| **[pako.js](https://github.com/nodeca/pako)** | 2.1.0 | Handles DEFLATE compression for share links and diagram encoding. | Lazy-loaded on share or diagram request |
+| **[JoyPixels / emoji-toolkit](https://www.joypixels.com/)** | 9.0.1 | Converts emoji shortcodes and powers emoji UI rendering. | Lazy-loaded on emoji use |
+| **[ABCJS](https://www.abcjs.net/)** | 6.5.2 | Renders ABC music notation and playback. | Lazy-loaded on ABC notation detection |
+| **[Leaflet](https://leafletjs.com/)** | 1.9.4 | Renders interactive GeoJSON and TopoJSON maps. | Lazy-loaded on map detection |
+| **[TopoJSON](https://github.com/topojson/topojson)** | 3.0.2 | Converts TopoJSON data for map rendering. | Lazy-loaded on TopoJSON detection |
+| **[Three.js](https://threejs.org/)** | r128 | Renders STL 3D models. | Lazy-loaded on STL detection |
+| **STLLoader / OrbitControls** | Three r128 examples | Loads STL files and provides model orbit controls. | Lazy-loaded on STL detection |
+| **[D3](https://d3js.org/)** | 7 | Supports Markmap rendering. | Lazy-loaded on Markmap detection |
+| **[Markmap](https://markmap.js.org/)** | 0.18.12 | Renders Markmap mind maps from Markdown lists. | Lazy-loaded on Markmap detection |
+| **[Yjs](https://docs.yjs.dev/)** | 13.6.10 via esm.sh | Powers Live Share document synchronization. | Lazy-loaded on Live Share |
+| **[PlantUML](https://plantuml.com/)** | Remote service | Renders PlantUML diagrams when local desktop commands are unavailable. | Network request on PlantUML render |
+| **[Kroki](https://kroki.io/)** | Remote service | Renders D2, Graphviz, Vega-Lite, WaveDrom, and fallback diagram SVGs. | Network request on supported diagram render |
+| **[mermaid.ink](https://mermaid.ink/)** | Remote service | Provides preview/fallback Mermaid image rendering in selected flows. | Network request on selected diagram previews |
---
@@ -483,7 +509,9 @@ Thanks to everyone who has contributed to Markdown Viewer.
## 📈 Development Journey
-Markdown Viewer has grown from a lightweight Markdown parser into a full-featured, professional application with advanced rendering, workflow, and export capabilities. Compare the current version with the original version to see the progress in UI design, performance optimization, and feature depth.
+Markdown Viewer started as a small personal project on a PC: a simple Markdown viewer built with curiosity, mistakes, fixes, and a lot of care. The original version is still online, and it remains the heart of the project.
+
+The current Markdown Viewer grew through community feedback, issues, PRs, screenshots, GIFs, suggestions, and real documentation workflows. The technical progress matters, but the journey is also emotional: people helped shape the app into what it is today.
---
diff --git a/desktop-app/README.md b/desktop-app/README.md
index e1c1b77d..ee0dd1f0 100644
--- a/desktop-app/README.md
+++ b/desktop-app/README.md
@@ -1,97 +1,103 @@
-# Markdown Viewer Desktop App Port
-
-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).
-
-## Architecture
-
-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.
-
-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.
-
-Desktop-only files (not generated):
-
-- `resources/js/main.js` — Neutralinojs lifecycle, tray menu, window events
-- `resources/js/neutralino.js` — Neutralinojs client library
-- `neutralino.config.json` — App configuration
-- `setup-binaries.js` — Idempotent binary setup (downloads on first use)
-
-## Development
-
-### Requirements
-
-- [Node.js](https://nodejs.org/)
-
-### Setup
-
-No installation is required. The app is built and run using `npx` (via npm scripts).
-
-Neutralinojs platform binaries are downloaded automatically on first build or dev run. To manually trigger the download:
-
-```bash
-npm run setup
-```
-
-Binaries are cached in `bin/` (gitignored) and only re-downloaded when `cli.binaryVersion` in `neutralino.config.json` changes.
-
-### Running the app
-
-```bash
-npm run dev
-```
-
-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`.
-
-For more information, see the [Neutralinojs documentation](https://neutralino.js.org/docs/cli/neu-cli#installation).
-
-### Building the app
-
-**Default** - Build the portable Neutralino bundle:
-
-```bash
-npm run build
-```
-
-Build output is placed in `dist/`.
-
-Note: `npm run build` writes the portable app directory to
-`dist/markdown-viewer/`, including platform binaries and `resources.neu`. The
-GitHub release workflow archives that directory as a ZIP and also uploads the
-Windows x64 executable as a standalone asset.
-
-For more information, see the [Neutralinojs documentation](https://neutralino.js.org/docs/cli/neu-cli#neu-build).
-
-### Building with Docker
-
-Build binaries without installing Node.js locally:
-
-```bash
-docker compose up --build
-```
-
-Build artifacts will be output to `desktop-app/output/`.
-
-## Releases
-
-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).
-
-Each release includes:
-
-| Asset | Description |
-| ----- | ----------- |
-| `markdown-viewer-win_x64.exe` | Windows x64 executable |
-| `markdown-viewer-vX.Y.Z-portable.zip` | Portable bundle with `resources.neu` (all platforms) |
-| `source.tar.gz` | Desktop app source archive |
-| `SHA256SUMS.txt` | Checksums for all release assets |
-
-## License
-
-**MIT**.
-
-The desktop version uses [Neutralinojs](https://github.com/neutralinojs/neutralinojs), which is also licensed under the MIT License.
-
-- [Neutralinojs](https://github.com/neutralinojs/neutralinojs): [LICENSE (MIT)](LICENSE)
-- [Markdown Viewer & Desktop Port](https://github.com/ThisIs-Developer/Markdown-Viewer): [LICENSE (MIT)](../LICENSE)
-
-## Contributors
-
-[](https://github.com/ThisIs-Developer/Markdown-Viewer/graphs/contributors)
+# Markdown Viewer Desktop App
+
+This folder contains the Neutralino desktop wrapper for Markdown Viewer v3.9.0. It turns the browser-based Markdown editor, viewer, and reader into a desktop app for opening local `.md` files, using split live preview, exporting documents, and working with native file dialogs. It reuses the root web app and adds native window lifecycle handling, desktop storage mirroring, and an offline-prepared resource bundle.
+
+For the complete product behavior and privacy reference, see [../wiki/Features.md](../wiki/Features.md).
+
+## Architecture
+
+The desktop app shares the same core product code as the browser version:
+
+- `../index.html`
+- `../script.js`
+- `../styles.css`
+- `../preview-worker.js`
+- `../assets/`
+
+`prepare.js` copies those files into `desktop-app/resources`, rewrites paths for Neutralino, downloads external libraries into `resources/libs`, verifies SHA-384 integrity where available, and strips web-only SEO metadata from the desktop HTML.
+
+Desktop-only files:
+
+- `neutralino.config.json`: Neutralino runtime configuration and native API allowlist.
+- `setup-binaries.js`: Idempotent Neutralino binary setup.
+- `resources/js/main.js`: window close confirmation, tray setup, launch-file import, and external-open handling.
+- `resources/js/neutralino.js`: Neutralino client library.
+
+## Desktop Behavior
+
+- Local editing, preview, document tabs, exports, and settings stay on the local machine.
+- Normal app state is stored in localStorage and mirrored to Neutralino storage.
+- Native Markdown/HTML save and Markdown open flows use Neutralino dialogs and filesystem APIs.
+- A Markdown file passed as a launch argument is loaded into the editor.
+- The app asks before closing the window.
+- Prepared desktop resources load dynamic libraries from local `/libs/...` paths.
+
+Network features still use the network when invoked: GitHub import, stored Share Snapshot, Live Share, remote diagram rendering, external images, and external links.
+
+## Development
+
+Requirements:
+
+- Node.js and npm.
+- Internet access for first setup and dependency preparation.
+
+Run:
+
+```bash
+cd desktop-app
+npm install
+npm run setup
+npm run dev
+```
+
+`npm run setup` downloads Neutralino binaries and runs `prepare.js`. Binaries are cached in `bin/` and refreshed when the configured Neutralino version changes.
+
+## Build
+
+```bash
+npm run build
+```
+
+The current build script runs:
+
+```bash
+npx -y @neutralinojs/neu@11.7.0 build --release --clean
+```
+
+Build output is written under `desktop-app/dist/`.
+
+## Configuration Highlights
+
+| Setting | Value |
+| :--- | :--- |
+| Application id | `com.markdownviewer.desktop` |
+| Version | `3.9.0` |
+| Document root | `/resources/` |
+| Default window | 1280 x 720 |
+| Minimum window | 400 x 200 |
+| Native API | Enabled |
+| Token security | One-time |
+| Logging | Disabled |
+| Neutralino binary/client version | 6.5.0 |
+
+Native APIs are intentionally allowlisted: app exit, open/save dialogs, message boxes, external URL open, tray setup, command execution, file read/write, and storage get/set.
+
+## Docker Build
+
+The desktop folder includes Docker files for building desktop artifacts in a container:
+
+```bash
+docker compose up --build
+```
+
+Check the compose file for the mounted output path used by the current build.
+
+## Releases
+
+Prebuilt desktop assets are published through GitHub Releases. Release workflows run setup, preparation, build, and checksum generation.
+
+Unsigned desktop binaries may trigger Windows SmartScreen or macOS quarantine prompts. See [../wiki/Desktop-App.md](../wiki/Desktop-App.md) for platform launch notes.
+
+## License
+
+Markdown Viewer is licensed under the Apache License 2.0. Neutralinojs is licensed under MIT; see the bundled Neutralino license file in this folder.
diff --git a/desktop-app/package.json b/desktop-app/package.json
index dc236e18..4897c570 100644
--- a/desktop-app/package.json
+++ b/desktop-app/package.json
@@ -2,7 +2,7 @@
"name": "markdown-viewer-desktop",
"version": "3.9.0",
"private": true,
- "description": "A premium client-side GitHub-style Markdown editor and live preview tool for desktop, featuring math rendering, diagrams, syntax highlighting, and PDF/HTML exports.",
+ "description": "A premium desktop Markdown editor, viewer, and reader for opening .md files with split live preview, math, diagrams, syntax highlighting, and PDF/HTML/PNG exports.",
"scripts": {
"setup": "node setup-binaries.js",
"postsetup": "node prepare.js",
diff --git a/index.html b/index.html
index 0f23b98a..84ca63d4 100644
--- a/index.html
+++ b/index.html
@@ -38,8 +38,8 @@
-
-
+
+
@@ -52,7 +52,7 @@
-
+
@@ -60,7 +60,7 @@
-
+
@@ -71,17 +71,22 @@
"name": "Markdown Viewer",
"url": "https://markdownviewer.pages.dev/",
"image": "https://markdownviewer.pages.dev/assets/icon.jpg",
- "description": "A powerful GitHub-style Markdown rendering tool with live preview, LaTeX, Mermaid, syntax highlighting, and PDF export.",
+ "description": "A browser-based Markdown editor, viewer, and reader for opening .md files, writing plain Markdown, and using split-screen live preview with GitHub-Flavored Markdown, sync scrolling, LaTeX math, Mermaid diagrams, syntax highlighting, and PDF, HTML, PNG, or Markdown export.",
"applicationCategory": "DeveloperApplication",
"operatingSystem": "All",
"browserRequirements": "Requires HTML5 compatible browser",
"softwareVersion": "3.9.0",
"featureList": [
- "Client-side Markdown editing",
- "GitHub-style live preview",
+ "Browser-based Markdown editor, viewer, and reader",
+ "Open local .md and .markdown files",
+ "Split-screen live Markdown preview",
+ "Sync scrolling between editor and preview",
+ "GitHub-Flavored Markdown support",
+ "Markdown formatting toolbar",
"LaTeX math rendering",
"Mermaid diagram rendering",
- "PDF, HTML, PNG, and Markdown export"
+ "PDF, HTML, PNG, and Markdown export",
+ "Optional Share Snapshot and Live Share workflows"
],
"author": {
"@type": "Organization",
@@ -139,13 +144,13 @@