M4RKYU.SYSEdition 2027
Skip to content
LOCZH/安大略 · 加拿大/▸work · m4rkdown待机OK/--:--:--EST
M4M4RK_YUportfolio
  • 创作创作
    创作Overview
    • 作品精选案例与项目记录
    • 游戏可玩原型与游戏开发日志
  • 影像影像
    影像Overview
    • 照片影像合集与视觉实验
    • 商店印刷品、海报和限量物件
  • 写作写作
    写作Overview
    • 博客长篇开发日志与现场笔记
    • 笔记短观察、链接与代码片段
  • 资源资源
    资源Overview
    • 工具38 款浏览器内开发工具
    • 链接每日使用的开发与设计书签
  • 关于关于
  • 联系联系
EN
← 项目档案
Web 应用 · 2024就绪

M4rkdown

离线优先的 Markdown 编辑器,支持实时协作、PWA 安装,以及多人打字竞技模式。

关键信息

角色
Solo developer: editor UX, offline/PWA layer, realtime sync, and deployment.
周期
2024-2026 · v3.1.0
平台
Responsive web · Installable PWA
在线源码

本页导航

  • >这是什么
  • >界面一览
  • >技术栈
  • >亮点功能
  • >工程实现
  • >实现细节
  • >结果
  • >规划与心得
M4rkdown split editor showing Markdown source and rendered preview
Fig. 01 — M4rkdown

为什么做这个

我天天用 markdown 写东西,也烦透了那些一断网就罢工的编辑器。至于那个多人打字小游戏,纯粹是它能离线工作之后,我没忍住继续往下做。

01

这是什么

#

问题

大多数 Markdown 编辑器都默认联网且单人使用。M4rkdown 想探索一个离线优先、并且能邀请他人加入的编辑器会是什么体验。

方案

以 CodeMirror 作为编辑核心,封装在 Preact + Vite 的 PWA 中,使用 PartyKit 实现实时协作,并在同一套同步引擎之上加入了趣味的多人打字模式。

02

界面一览

#
  • Two modesThe entry screen makes the project's unusual scope explicit: a serious offline writer and a live typing game share one product.
03

技术栈

#

Frontend

  • Preact 10
  • Signals
  • TypeScript
  • Vite

Editor

  • CodeMirror 6
  • Vim mode
  • KaTeX
  • Mermaid

Realtime

  • PartyKit

Platform

  • Workbox
  • PWA
  • localStorage
04

亮点功能

#
  • Editor, split, preview, focus, and typewriter modes
  • Vim bindings, formatting toolbar, linting, outline, templates, and image paste
  • KaTeX math, Mermaid diagrams, syntax themes, and multiple export formats
  • Tabbed local documents with word goals and offline PWA support
  • Realtime collaborative writing with reconnect recovery
  • Solo daily challenges and multiplayer typing rooms for up to eight players
05

工程实现

#
  1. 过程 01

    Separate local documents from realtime rooms

    背景
    Offline writing and multiplayer sessions have different ownership, persistence, and recovery semantics.
    方法
    Keep tabbed documents in local storage and use PartyKit only for room-based collaboration and battles.
    结果
    Offline writing stays dependable, while moving content between local and shared contexts remains an explicit action.
  2. 过程 02

    Use one product shell for work and play

    背景
    A typing arena could have become a disconnected side project with separate navigation and state.
    方法
    Present Writer and Battle as first-class modes inside the same Preact application.
    结果
    The utility becomes memorable and reuses realtime infrastructure, but the product must maintain two very different interaction densities.
06

实现细节

#

架构笔记

  • CodeMirror 6 owns editing extensions while Preact Signals keep document, preference, and mode state lightweight.
  • Workbox caches the application shell so core writing remains available offline.
  • PartyKit separates room-based collaboration and typing-arena state from local document persistence.
  • Markdown extensions for math, diagrams, callouts, footnotes, and syntax rendering are composed into the preview pipeline.

挑战

  • Offline local documents and realtime rooms have different ownership and recovery rules.
  • A feature-rich editor must keep keyboard commands discoverable without letting toolbars dominate the writing surface.
  • The former m4rkdown.is-a.dev address no longer resolves to the app; the case study now links to the working Vercel deployment.
07

结果

#
“
A deployed v3.1.0 PWA with a genuinely broad editor surface and a memorable second mode: collaborative and competitive realtime typing built on the same application foundation.
08

规划与心得

#

复盘

  1. 01Offline-first changes every assumption about state and conflict resolution.
  2. 02A small playful mode makes a utility memorable.

下一步

  1. 01Add durable document version history
  2. 02Test collaboration recovery under network churn
  3. 03Retire stale domain references across the repository

相关案例

Web 应用

Nimbus

A passwordless cloud workspace for organizing, sharing, beaming, and asking questions about your files.

Web 应用

M4rketView

A free, no-key crypto dashboard with live prices, resilient public-data fallbacks, local portfolios, alerts, and comparison tools.

上一篇AI Agent ToolkitA personal Windows-first toolkit for local AI coding: PowerShell automation, Ollama, a Streamlit control center, and conservative repo workers.
返回全部作品
返回档案
M4RKYUM4RKYUM4RKYUM4RKYUM4RKYUM4RKYUM4RKYUM4RKYU
始于 2024
ZhenXiao Mark YuZhenXiao Mark Yu
联系

看到什么有意思的?和我聊聊。

这是一个作品集,不是服务 · 但每一条留言我都会看 — 如果哪里让你有所触动,或者只想打个招呼,欢迎写信过来。

开启对话
频道开放

随时打个招呼 · 2026

--:--:--EST加拿大 安大略
  • 邮件
  • GitHub
  • dev.to
  • 领英
  • 推特 / X
  • Instagram
  • Facebook
  • YouTube
  • CodePen
  • Spotify
  • Snapchat

订阅

偶尔收到一封简讯

来自 m4rkyu.com 的笔记与日志——简短、标注日期、没有杂音。随时可退订。

作品

线上发布、游戏作品与视觉档案。

  • 项目
  • 游戏
  • 档案
  • 日志

资源

每日好用的工具与个人收藏的链接库。

  • 搜索
  • 最新
  • 工具
  • 链接
  • 笔记
  • 主题
  • 商店
RSSJSON Feed

工作室

背景、联系方式以及合作渠道。

  • 关于
  • 联系
  • 更新日志
  • 技术说明
  • 简历筹备中

社交

在常去的平台上找到我。

  • GitHub
  • dev.to
  • 领英
  • 推特 / X
  • Instagram
  • Facebook
  • YouTube
  • CodePen
  • Spotify
  • Snapchat
  • 邮件
© 2026 ZhenXiao Mark Yumarkyu0615@gmail.com
  • 邮件
  • GitHub
  • dev.to
  • 领英
  • 推特 / X
  • Instagram
  • Facebook
  • YouTube
  • CodePen
  • Spotify
  • Snapchat
隐私条款由 Next.js 16 · React 19 · Tailwind 4 构建