Skip to content
SamaelENDPublic

About

Fast, modern Markdown editor with live preview, split view, KaTeX math, Mermaid diagrams, and VS Code-inspired syntax highlighting.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Kallos Markdown (Markdown Studio) β€” Online Markdown Editor & Live Preview

Kallos Markdown (Kallos MD) is a modern, high-performance, client-side Markdown workspace designed for clarity, zero distractions, complete data sovereignty, and an ergonomic writing experience. Formerly known as Markdown Studio.

Built with Svelte 5 (Runes), TypeScript, Vite 8, and CodeMirror 6, it features an Obsidian-free, clean-room modular 3-layer architecture (core/, features/, shared/), an interactive Hybrid Live Preview canvas, synchronized split-view editing, mathematical typesetting via self-hosted KaTeX, interactive vector diagrams with Mermaid, GFM extensions (tables, callouts, and footnotes), print-ready PDF and standalone HTML5 export, nested folder management, and 100% offline-first storage backed by IndexedDB.


πŸš€ Key Features

1. Hybrid Live Preview & 4 View Modes

  • Interactive Live Preview Canvas: Headings, GFM tables, math blocks, code cards, and Mermaid diagrams render directly inline as you type, revealing the raw Markdown syntax and syntax theme colors only on the active line or block under your cursor.
  • Adjustable Writing Sheet: Draggable canvas guides (680px to 1600px, default 1020px) with visible bounds, persisted in localStorage.
  • Raw / Rendered Toggle (Ctrl + E / Alt + M): Instant toggle between raw Markdown and live-rendered view directly within Live Preview.
  • 4 View Modes:
    • Live Preview: Distraction-free interactive canvas with in-place rendering.
    • Editor: Focused monospace code editor with line numbers, minimap, and active line styling.
    • Split: Real-time side-by-side editing and reading desk with proportional scroll synchronization (SYNC) and an adjustable divider.
    • Preview: Clean reader view without editing chrome.

2. Technical Writing Engine (KaTeX, Mermaid & GFM)

  • KaTeX Mathematical Typesetting: Full support for inline expressions ($...$, with safe boundary spacing and escaped \$ support) and multi-line display equations / matrices ($$...$$) powered by self-hosted local .woff2 fonts.
  • Interactive Mermaid SVG Diagrams: Flowcharts, sequence, state, class, and architecture diagrams rendered as clean vector SVGs with dedicated zoom controls (+, βˆ’, β†Ί), full-screen modal, and SVG/PNG copy/export.
  • GitHub Flavored Markdown (GFM):
    • Responsive tables with horizontal scroll and alignment directives (:---, :---:).
    • Rich visual alerts ([!NOTE], [!TIP], [!IMPORTANT], [!WARNING], [!CAUTION]).
    • Semantic linked footnotes ([^1]) with instant back-links (↩).
    • Interactive task checkboxes (- [ ] / - [x]) that toggle state in the source document.
    • Collapsible content via native <details> and <summary>.

3. File & Vault Organization

  • Nested File Tree: Organize documents into unlimited folders and subfolders or keep them at the vault root.
  • Drag & Drop: Intuitive document movement between folders or within the file tree.
  • Inline Renaming: Fast renaming with double-click or F2, complete with context menus.
  • Instant Search: Real-time filtering across document titles and folder structures.
  • Table of Contents (TOC): Automatically generated document navigation outline based on Markdown headings (# H1 through ###### H6).

4. Professional Export & Printing

  • Clean PDF / Print Output:
    • Dedicated @media print rules that hide interactive UI controls while preserving syntax colors and borders (print-color-adjust: exact).
    • Native SVG Mermaid diagrams with clean boundaries, preventing duplicate text or clipping.
    • Automatic expansion of <details> accordions and page-break guards for tables, task lists, and code blocks.
  • Standalone HTML5 Export: Exports self-contained single-file .html documents with KaTeX styles and fonts embedded as Base64 (works completely offline).
  • Markdown Download: One-click download of the active file as .md.

5. Zero Tracking & 100% Local-First Privacy

  • Local Browser Database (IndexedDB): All documents and folders reside inside IndexedDB (md-studio-db), avoiding localStorage quota limitations.
  • Zero Remote Dependencies / Cero Internet: 100% client-side architecture. Your notes, equations, and private files never leave your device. Cero telemetry, analytics, or third-party cookies.
  • Debounced Auto-Save (350 ms): Seamless background saves without blocking typing responsiveness.

6. Native Offline Internationalization (i18n) & SEO

  • Dual-Language Interface (English / Spanish): Instant locale switching without reloading or external network requests.
  • Bilingual Static Landings: Ultra-fast static landings for English (/) and Spanish (/es/) with complete structured data (JSON-LD WebApplication), reciprocated hreflang alternates, and social cards (1200Γ—630 og:image).

πŸ› οΈ Tech Stack

Layer / Module Technology Version Purpose
Framework Svelte 5 ^5.57.2 Reactive Runes ($state, $derived, $effect)
Language TypeScript ~6.0.3 Strict static typing across domain and components
Bundler & Server Vite ^8.3.5 Fast HMR, multi-page input, and modular production bundling
Code Editor CodeMirror 6 ^6.0.2 Extensible core editor & Hybrid Live Preview ViewPlugins
Minimap @replit/codemirror-minimap ^0.5.2 Visual document navigation in editor
Database idb ^8.0.4 Promise-based IndexedDB wrapper
Markdown Engine Marked ^18.1.2 Standard Markdown and GFM parsing
XSS Sanitization DOMPurify ^3.4.17 Safe HTML sanitization against XSS
Preview Syntax highlight.js ^11.12.0 Static syntax highlighting with copy buttons
Math Engine KaTeX ^0.19.1 Fast inline and display LaTeX rendering with self-hosted fonts
Diagrams Mermaid ^12.2.0 Vector flowcharts and sequence diagrams
Icons Lucide Svelte ^1.0.1 Accessible vector icons
Internationalization Svelte 5 Runes β€” Native type-safe offline localization (EN/ES)

πŸ“ Project Architecture (< 500 Lines per File)

The codebase strictly adheres to a modular 3-layer architecture (core/, features/, shared/) where every .ts, .svelte, and .css file is kept under 450–500 lines for maintainability:

kallosmd/
β”œβ”€β”€ index.html                   # Static English landing (SEO, Open Graph, JSON-LD)
β”œβ”€β”€ es/index.html                # Static Spanish landing (SEO, Open Graph, JSON-LD)
β”œβ”€β”€ app/index.html               # SPA App entry point (noindex, follow)
β”œβ”€β”€ package.json                 # Project dependencies, metadata, and scripts
β”œβ”€β”€ vite.config.ts               # Multi-page build configuration (main, es, app)
β”œβ”€β”€ scripts/
β”‚   └── seo-check.mjs            # Automated native Node.js SEO verification script
└── src/
    β”œβ”€β”€ main.ts                  # Application bootstrap entry point
    β”œβ”€β”€ app.css                  # Global CSS variables, reset, and print imports
    β”œβ”€β”€ App.svelte               # Root layout orchestrator (< 300 lines)
    β”‚
    β”œβ”€β”€ core/                    # Pure TypeScript contracts and domain logic
    β”‚   β”œβ”€β”€ types/               # DocumentItem, FolderItem, Settings, TocHeading
    β”‚   β”œβ”€β”€ storage/             # Hexagonal StoragePort (indexedDbAdapter, localCache, db)
    β”‚   └── markdown/            # Modular pipeline (markdownPipeline, mathScanner, gfmAlerts, footnotes)
    β”‚
    β”œβ”€β”€ features/                # Domain vertical feature modules
    β”‚   β”œβ”€β”€ settings/            # settingsStore.svelte.ts (UI themes, font preferences)
    β”‚   β”œβ”€β”€ vault/               # vaultStore.svelte.ts & sidebar components (FileTree, SearchBox, TocPanel)
    β”‚   β”œβ”€β”€ editor/              # Editor.svelte & live-preview/ (liveWidgets, liveTheme, livePlugin)
    β”‚   β”œβ”€β”€ preview/             # Preview.svelte, scrollSync, mermaidRenderer, and print/HTML export
    β”‚   β”œβ”€β”€ toolbar/             # Toolbar.svelte, ActionGroup, and view mode selectors
    β”‚   └── workspace/           # Resizer, StatusBar, and DropOverlay
    β”‚
    └── shared/                  # Reusable cross-cutting resources
        β”œβ”€β”€ ui/                  # Button, DropdownMenu, InlineRenameInput, ToggleSwitchItem
        β”œβ”€β”€ i18n/                # i18n.svelte.ts, en.ts, es.ts
        β”œβ”€β”€ styles/              # variables.css, base.css, print-document.css, print-diagrams.css
        └── utils/               # formatters.ts, codeThemes.ts

πŸ—ΊοΈ Roadmap & Current Status

βœ… Completed

  • Phase 0 Β· Architectural Refactoring & Modularization: 3-layer split (core/, features/, shared/), hexagonal storage port, and strict enforcement of < 450-500 lines per file.
  • Phase 1 Β· Hybrid Live Preview (WYSIWYG): In-place rendering of headings, code blocks with copy header bar, tables, KaTeX display math, and Mermaid diagrams with cursor-aware raw Markdown revealing.
  • Phase 1 Β· Live Preview Stability & Ergonomics: Selection freeze, arrow key debounce, layout jump elimination, drag selection confinement, adjustable writing canvas (Ctrl + E), theme color highlighting for active lines, and empty line placeholders.
  • Phase 5 Β· Bilingual SEO & Search Discovery: Dedicated English (/) and Spanish (/es/) static landings, app route at /app/, og-image.png (1200Γ—630), JSON-LD WebApplication, reciprocal hreflang, updated sitemap, and automated seo:check testing.

⏳ In Progress & Upcoming

  • Phase 2 Β· PKM Wiki & Quick Wins:
    • Command Palette & Quick Switcher (Ctrl + K / Ctrl + Shift + P) with local fuzzy search.
    • Bidirectional Wikilinks ([[Note]] & [[Note|Alias]]) with floating autocomplete and Backlinks sidebar panel.
    • Frontmatter YAML card view and collapsible Callouts ([!NOTE]- / [!NOTE]+).
  • Phase 3 Β· Offline Media, Assisted Tables & Scroll Precision:
    • Clipboard image paste (Ctrl + V) and drag-and-drop stored as local Blob in IndexedDB (local-media://).
    • Assisted GFM table navigation (Tab / Shift + Tab) and visual grid picker.
    • Exact scroll synchronization across multi-line display KaTeX blocks.
  • Phase 4 Β· Native Local-First (File System Access API) & PWA:
    • Direct local hard drive folder syncing via window.showDirectoryPicker().
    • Full-text search with highlighted context snippets and line jumps.
    • Offline Service Worker (sw.js) with Cache-First strategy for 100% PWA installation.
  • Phase 5.3 Β· Search Intent Landing Pages:
    • Dedicated pages for markdown-to-pdf, markdown-katex-latex, mermaid-diagrams, and Markdown cheat sheet in EN & ES.

⌨️ Keyboard Shortcuts

Shortcut Action
Ctrl + E / Alt + M Toggle between Raw Markdown and Rendered View in Live Preview
Ctrl + B / Cmd + B Toggle sidebar visibility
Ctrl + S / Cmd + S Save document with visual feedback
Ctrl + P / Cmd + P Open print dialog / Export to PDF
F2 Rename selected file or folder
Tab Insert tab indentation inside editor
Double Click on Divider Reset pane split ratio to 50% / 50%
Double Click on Frame Guide Reset Live Preview writing width to default (1020px)

πŸ“¦ Getting Started

Prerequisites

  • Node.js >= 18.0.0
  • npm >= 9.0.0

Installation

  1. Clone the repository:

    git clone https://github.com/SamaelEND/kallosmd.git
    cd kallosmd
  2. Install dependencies:

    npm install
  3. Start development server:

    npm run dev

    Open http://localhost:5173/ in your browser.


πŸ§ͺ Quality Checks, SEO & Build

  • Type checking and Svelte validation:
    npm run check
  • Automated SEO checks (Metadata, JSON-LD, hreflang, noindex):
    npm run seo:check
  • Production build:
    npm run build
  • Preview local production build:
    npm run preview

🀝 Development & Credits

Markdown Studio was designed, refactored, and optimized through continuous pair programming between Manuel Alvarez.


πŸ“„ License

This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). See the LICENSE file for details.

Copyright (C) 2026 Manuel Alvarez.

About

Fast, modern Markdown editor with live preview, split view, KaTeX math, Mermaid diagrams, and VS Code-inspired syntax highlighting.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages