Skip to content
Back to search

dsh-marktext

MarkText (muya) WYSIWYG Markdown editor for the DeepSeek Harness right sidebar

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked yesterday
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/roland0511--dsh-marktext/badge.svg)](/listings/roland0511--dsh-marktext)

HTML

<a href="/listings/roland0511--dsh-marktext"><img src="/api/listings/roland0511--dsh-marktext/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

dsh plugin --profile web add dsh-marktext

**Using the Desktop app?** Open **Plugins → Add plugin → Install a third-party plugin**, enter `dsh-marktext`, click **Enable now**, then restart the app once. (The desktop profile is managed by the app, so the CLI line above is for `dsh web` only.)

<details> <summary>Manual install, GitHub install, requirements</summary>

**Manual (desktop profile)** — edit `~/.dsh/profiles/desktop/package.json`:

{
  "dsh": { "profile": { "bundles": [..., "dsh-marktext"] } },
  "dependencies": { ..., "dsh-marktext": "^0.1.13" }
}
cd ~/.dsh/profiles/desktop && pnpm install

Then restart the app.

**From GitHub instead of npm:** `github:Roland0511/dsh-marktext` works anywhere a package name does — the built renderer is committed, so there is no build step.

**Requirements:** DeepSeek Harness **0.2.1+** (`ctx.sidebarRightTabs`, `ctx.slots`, `ctx.fs`, `ctx.webServer`; the quote action also uses `ctx.conversation`). Node 20+ only if you build from source.

</details>

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 191 lines
  1. <p align="center">
  2. <img src="https://raw.githubusercontent.com/Roland0511/dsh-marktext/main/icon.svg" width="72" alt="dsh-marktext icon">
  3. </p>
  4. <h1 align="center">dsh-marktext</h1>
  5. <p align="center">
  6. <b>Write Markdown the way it will look.</b><br/>
  7. MarkText's editor engine, living in the DeepSeek Harness right sidebar.
  8. </p>
  9. <p align="center">
  10. <a href="https://www.npmjs.com/package/dsh-marktext"><img alt="npm version" src="https://img.shields.io/npm/v/dsh-marktext?color=cb3837"></a>
  11. <a href="https://www.npmjs.com/package/dsh-marktext"><img alt="npm downloads" src="https://img.shields.io/npm/dm/dsh-marktext?color=brightgreen"></a>
  12. <a href="https://github.com/Roland0511/dsh-marktext/stargazers"><img alt="GitHub stars" src="https://img.shields.io/github/stars/Roland0511/dsh-marktext?style=social"></a>
  13. <a href="https://opensource.org/licenses/MIT"><img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-blue"></a>
  14. <img alt="DSH 0.2.1+" src="https://img.shields.io/badge/DSH-0.2.1%2B-4d6bfe">
  15. <a href="https://github.com/Roland0511/dsh-marktext/actions/workflows/publish.yml"><img alt="publish" src="https://github.com/Roland0511/dsh-marktext/actions/workflows/publish.yml/badge.svg"></a>
  16. </p>
  17. <p align="center">
  18. <a href="README.md"><b>English</b></a> · <a href="README.zh.md">简体中文</a>
  19. </p>
  20. ![dsh-marktext — the MarkText editor inside the DeepSeek Harness right sidebar](https://raw.githubusercontent.com/Roland0511/dsh-marktext/main/docs/assets/screenshot-dsh.png)
  21. **Click a `.md` and it opens as the document it will become** — headings, tables, math, diagrams and images, all editable where they stand. Fix a sentence, delete a paragraph, or **select the part you want to talk about and quote it into the chat**. No split pane, no source-and-preview dance. `⌘S` saves through a version guard, so you never overwrite someone else's edit.
  22. > MarkText is an Electron desktop app. This plugin doesn't ship its shell — it takes the editor core MarkText extracts ([`@muyajs/core`](https://www.npmjs.com/package/@muyajs/core) / muya, MIT) and adds only the DSH integration. Everything runs locally.
  23. ## Why it feels different
  24. - **✍️ You edit the document, not the source.** Markdown markers stay hidden; headings, lists, tables and quotes are real elements. Put the caret in a table cell and fix the cell, not a row of pipes.
  25. - **💬 Quote straight into the chat.** Select any text, hit **Quote** in the toolbar, and a Markdown blockquote — with the file path on top — is appended to the composer draft. No retyping, no "the third bullet under section 2".
  26. - **📄 Export a real PDF.** **PDF** in the toolbar (or `⌘P`) turns the open document into an A4 `.pdf`, writes it **next to the file** and opens it in the sidebar so you can check the result — no print dialog, no download prompt, no "Save as PDF" detour. The document is re-laid out at page width first, so text is a normal size instead of a sidebar-width strip, and pages break on blank rows so a line of text is never sliced in half.
  27. - **📊 Diagrams and math just render.** KaTeX, Mermaid, Vega and PlantUML ship with the plugin and load on demand — offline, no CDN, no account.
  28. - **🖼️ Images land where you expect.** `![](assets/diagram.png)` resolves against the document's own folder, so docs written in your editor look right here.
  29. - **💾 Saving is boring, in the best way.** Autosave 2.5 s after you stop typing; `⌘S` saves immediately; a changed file on disk means a conflict banner, never a silent overwrite.
  30. - **🌗 It looks like DSH.** Light and dark follow the host, and the editor never adopts a foreign theme.
  31. - **⌨️ Your fingers already know it.** `⌘Z` / `⇧⌘Z` undo and redo, `⌘S` saves, `⌘P` exports a PDF, `⌘F` finds — nothing to relearn.
  32. ## Install in one line
  33. ```sh
  34. dsh plugin --profile web add dsh-marktext
  35. ```
  36. **Using the Desktop app?** Open **Plugins → Add plugin → Install a third-party plugin**, enter `dsh-marktext`, click **Enable now**, then restart the app once. (The desktop profile is managed by the app, so the CLI line above is for `dsh web` only.)
  37. <details>
  38. <summary>Manual install, GitHub install, requirements</summary>
  39. **Manual (desktop profile)** — edit `~/.dsh/profiles/desktop/package.json`:
  40. ```jsonc
  41. {
  42. "dsh": { "profile": { "bundles": [..., "dsh-marktext"] } },
  43. "dependencies": { ..., "dsh-marktext": "^0.1.13" }
  44. }
  45. ```
  46. ```sh
  47. cd ~/.dsh/profiles/desktop && pnpm install
  48. ```
  49. Then restart the app.
  50. **From GitHub instead of npm:** `github:Roland0511/dsh-marktext` works anywhere a package name does — the built renderer is committed, so there is no build step.
  51. **Requirements:** DeepSeek Harness **0.2.1+** (`ctx.sidebarRightTabs`, `ctx.slots`, `ctx.fs`, `ctx.webServer`; the quote action also uses `ctx.conversation`). Node 20+ only if you build from source.
  52. </details>
  53. ## What you get
  54. | | |
  55. |---|---|
  56. | **Open any Markdown**<br/>`*.md`, `*.markdown`, `*.mdown`, `*.mkd` in the sidebar open in an editing tab. | **Real editing**<br/>Tables, code blocks, quotes, task lists — direct manipulation, not text surgery. |
  57. | **Quote into the chat**<br/>Select → **Quote** → a blockquote with its source path lands in the composer draft. | **PDF export**<br/>`⌘P` or the toolbar button; a real A4 file laid out at page width, saved beside the `.md` and opened in the sidebar. |
  58. | **Math & diagrams**<br/>KaTeX inline/block, Mermaid, Vega-Lite, PlantUML, Prism highlighting. | **Version-guarded saves**<br/>Optimistic concurrency; conflicts surface instead of clobbering. |
  59. | **Relative images**<br/>Resolved against the document folder through a per-document token. | **Links between files**<br/>`[next](next.md)` opens in another MarkText tab, not as raw text. |
  60. | **Native shortcuts**<br/>`⌘S` · `⌘Z` · `⇧⌘Z` · `⌘P`, autosave, and a dirty-state dot in the toolbar. | **Follows DSH**<br/>Light/dark theme, locale, and the host's own sidebar chrome. |
  61. ## Under the hood
  62. ```
  63. DSH Web (React)
  64. lib/client.js ── sidebar tab kind `marktext` (patterns: *.md)
  65. │ tab body = <iframe src="/dsh-marktext/renderer/<token>/index.html">
  66. │ postMessage (single envelope: __dshmkt)
  67. ▼
  68. renderer/ (standalone Vite build, contains muya + mermaid)
  69. │ fetch
  70. ▼
  71. lib/index.js (host plugin)
  72. · /dsh-marktext/renderer/<token>/* static assets; misses fall back to the document folder
  73. · /dsh-marktext/api/open|save|stat through ctx.fs; save requires baseVersion
  74. ```
  75. The editor runs in an iframe on purpose: muya declares its CSS variables on `:root` and appends floating toolbars to `document.body`, so inlining it would leak styles into the host. The iframe isolates all of that; only document, theme and save calls cross the boundary.
  76. <details>
  77. <summary>Message protocol (v1) and the file-policy fallback</summary>
  78. Envelope: `{ __dshmkt: true, dir: 'down' | 'up', type, content }`
  79. | Direction | type | content |
  80. |---|---|---|
  81. | down | `doc` | `{ path, displayPath, text, version, dark, locale }` |
  82. | down | `saved` | `{ version }` |
  83. | down | `save-error` | `{ code, message }` |
  84. | down | `theme` | `{ dark }` |
  85. | down | `chat-inserted` | `{ mode: 'draft' \| 'clipboard' \| 'none' }` |
  86. | down | `pdf-saved` | `{ path, size }` |
  87. | down | `pdf-error` | `{ code, message }` |
  88. | up | `ready` | — |
  89. | up | `dirty` | `{ dirty }` |
  90. | up | `save` | `{ text, baseVersion }` |
  91. | up | `reload` | — |
  92. | up | `insert-chat` | `{ text }` |
  93. | up | `save-pdf` | `{ data }` (base64) |
  94. | up | `open-external` | `{ href }` |
  95. **Quoting into the chat.** The client resolves the tab's session, asks `ctx.conversation.input.for(sessionCtx)` for the composer facade, and appends `buildQuote(selection, path)` to the current draft with `setDraft`. The composer keeps its own history, so the quote is one undo step away. If the host doesn't expose the conversation service (older DSH, or a profile without the conversation plugin), the quote goes to the clipboard instead and the toolbar says so — the feature degrades, it doesn't disappear.
  96. **Saving and the file policy.** The normal path is `ctx.fs.writeText(target, text, { kind: 'replaceIfVersion', version })`; a stale version returns `FS_STALE_VERSION` and the UI shows a conflict banner. If the host policy refuses the write (`FS_SANDBOX_DENIED`, e.g. `workspace-write` / `read-only`), the save falls back to Node's `fs.writeFile` **with the version guard intact** — the version is checked before and re-read after. Real OS errors (`EACCES` / `EPERM`) still surface as-is.
  97. </details>
  98. ## Troubleshooting
  99. If a `.md` opens but the tab says something like "no viewer available", the client half didn't register its tab body. Read the registration report:
  100. ```sh
  101. curl -s http://127.0.0.1:<DSH-port>/dsh-marktext/api/diag | python3 -m json.tool
  102. ```
  103. `typeRegistered`, `bodyRegistered`, `conversation` and `errors` point at the failing step — `"conversation": false` means **Quote** will fall back to the clipboard.
  104. ## FAQ
  105. **Is this the MarkText app?** No. It's MarkText's editor core (muya) wrapped for DSH — no Electron, no desktop shell, no second app to install.
  106. **Where does a quote go?** Into the composer draft of the tab's own session, not the one in front of you — open a file from session A while working in session B and the quote still lands in A, the session that file belongs to.
  107. **Is the PDF a real file?** Yes — click **PDF** and `notes/plan.pdf` appears next to `notes/plan.md` (a `-1`, `-2` suffix avoids overwriting), and the tab that opens shows the result. It is generated in the page (html2canvas + jsPDF, both lazy-loaded only when you export) and laid out on A4 with half-inch margins. Text is rasterised, so the PDF is not selectable — that is the price of doing this without a 500 kB layout engine, and it keeps the plugin offline and dependency-free at runtime.
  108. **Why does it save instead of downloading?** The editor runs inside an Electron `dsh-app://` shell that treats a `blob:` download as "open this in a tab". Writing through the host's `fs` avoids that entirely and puts the PDF where the document already lives.
  109. **Will it reformat my file?** It saves what the editor serializes, which is standard CommonMark/GFM. The version guard is what protects you: if the file changed underneath, you get a conflict, not a silent rewrite.
  110. **Does it work offline?** Yes — every asset, font, diagram engine and syntax highlighter ships with the plugin.
  111. **Does it fight with other Markdown plugins?** Both it and `dsh-markdown-typora` claim `*.md` in the `extension` band, so install one of them, not both.
  112. **Known limits:** absolute image paths (`/abs/a.png`, `file://`) aren't resolved yet; quoting needs a session-scoped file (an absolute-path tab falls back to the clipboard); the exported PDF is raster, so its text can't be selected or searched. Package size ≈4 MB tarball; first paint ≈1.6 MB, plus ≈240 kB only when you export a PDF.
  113. ## Development
  114. ```sh
  115. npm install
  116. npm run build:renderer # writes renderer/ (committed; only needed when src/renderer changes)
  117. npm test # host routes, version guard, traversal, origin fence, client registration, quote formatting
  118. node scripts/verify-renderer.mjs # headless Chrome: open → render → save → disk
  119. node scripts/verify-pdf.mjs # headless Chrome: render → export PDF → assert the bytes
  120. node scripts/screenshot.mjs # regenerates docs/assets/screenshot-*.png
  121. ```
  122. ## Release
  123. Publishing uses **npm Trusted Publishing (OIDC)** — no token or secret in the repo. Every push to `main` runs tests, verifies the committed `renderer/` matches `src/renderer/`, publishes only when the version is new, and creates a **GitHub Release** (`v<version>`, generated notes).
  124. ```sh
  125. npm version patch --no-git-tag-version
  126. git commit -am "chore: release x.y.z"
  127. git push
  128. ```
  129. ## Star history
  130. <a href="https://www.star-history.com/?type=date&repos=Roland0511%2Fdsh-marktext">
  131. <picture>
  132. <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/chart?repos=Roland0511/dsh-marktext&type=date&theme=dark&legend=top-left" />
  133. <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/chart?repos=Roland0511/dsh-marktext&type=date&legend=top-left" />
  134. <img alt="Star History Chart" src="https://api.star-history.com/chart?repos=Roland0511/dsh-marktext&type=date&legend=top-left" />
  135. </picture>
  136. </a>
  137. ## License
  138. MIT — see [LICENSE](LICENSE). Third-party components and MarkText attribution: [NOTICE.md](NOTICE.md).

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.