MkBrowser is an Electron desktop app that combines a file explorer with inline Markdown rendering, image rendering, and text file editing. It shows a single folder level at a time and renders .md files directly within the list rather than using a separate preview pane.
This README is aimed at developers; a separate User Guide covers end-user usage.
- Single-level folder browsing (no tree view).
- Inline Markdown rendering directly in the file list.
- In-place Markdown editing with save/cancel flow.
- Multiple files can be edited at once.
- File/folder selection (multi-select) for menu-driven actions.
- Edit menu actions: Cut, Copy, Paste, Delete, Select All.
- Single-click create file from clipboard content.
- Configurable sorting and folders-on-top behavior (file ordering).
- Settings for font size.
- Hidden files filtered out by default (dotfiles).
- Content caching for Markdown to reduce re-reads.
- Search and export dialogs (UI-level support).
- Replace in Files: bulk find-and-replace across all text files.
- PDF export support for Markdown content.
- Runtime: Electron 40
- Build tooling: Electron Forge + Vite
- Language: TypeScript
- UI: React 19
- Styling: Tailwind CSS 4 + Typography plugin
- Markdown:
react-markdown,remark-math,rehype-katex, KaTeX - Editor: CodeMirror 6
- Diagrams: Mermaid
- Config: YAML (
js-yaml)
MkBrowser uses Electron’s three-process architecture and follows a strict IPC boundary. Renderer code never touches the file system directly.
- Main process: Owns all file system operations and IPC handlers.
- Preload: Exposes a typed
window.electronAPIsurface to the renderer. - Renderer: React UI only, calls
window.electronAPI.*for any file operations.
Data flow:
Renderer → window.electronAPI.* → ipcRenderer.invoke → Main process handler → Node.js fs → return to renderer
State is handled by a small store built on React’s useSyncExternalStore (no Redux/Context). Items are stored in a Map<path, ItemData> for O(1) lookups. Store updates create new objects to ensure re-renders.
Key item fields include:
isSelectedfor multi-select UIcontentandcontentCachedAtfor Markdown cachingeditingfor per-file edit mode (supports multiple concurrent edits)
MkBrowser stores configuration in a YAML file under the user’s config directory. It currently tracks the last browsed folder.
npm installLinux requires sandbox disablement:
npm run start:linuxnpm startnpm run lintnpm run package
npm run makereact,react-domreact-markdownremark-math,rehype-katex,katexcodemirror+@codemirror/*mermaidfdir(directory scanning)js-yamltypo-js
electron,@electron-forge/*vite,@vitejs/plugin-reacttypescripttailwindcss,@tailwindcss/typography,@tailwindcss/viteeslint+@typescript-eslint/*postcss,autoprefixer
- Main process:
src/main.ts - Preload:
src/preload.ts - Renderer entry:
src/renderer.tsx - UI:
src/App.tsxandsrc/components/* - State:
src/store/*
- All file system access must stay in the main process.
- If you add a new IPC handler, update:
src/main.tssrc/preload.tssrc/global.d.ts
- Keep renderer logic UI-only.
- Tailwind CSS is configured in
src/index.css(CSS-first setup).





