Target Copy

by Tanjialin Labs
5
4
3
2
1
Score: 50/100

Description

Copy Obsidian notes and selections as destination-aware rich text or source-preserving Markdown.

Reviews

No reviews yet.

Stats

0
stars
68
downloads
0
forks
12
days
3
days
3
days
0
total PRs
0
open PRs
0
closed PRs
0
merged PRs
0
total issues
0
open issues
0
closed issues
5
commits

Latest Version

4 days ago

Changelog

简体中文

  • 复制为纯文本时,嵌套列表和后续段落会按原文顺序排列。富文本复制附带的纯文本也使用相同顺序。
  • 将阅读视图选区或 HTML 文件复制为「便携 Markdown」时,正文里用作示例的标题符号、编号和分隔线会保留为文字。真正的标题、列表和分隔线继续保留格式。
  • 响应式图片地址中的逗号会完整保留,包括路径和查询参数里的逗号。单张图片与图片总量的上限继续生效。
  • 关闭快速复制的默认目标后,插件会改用菜单中排在最前面的已启用目标。只调整菜单顺序时,仍然启用的默认目标会保留。

适用于 Obsidian 桌面版 1.13.7 及以上版本。

English

  • Plain-text copies, including the text supplied with rich copies, keep nested lists and the paragraphs that follow them in their original order.
  • When copying a Reading view selection or an HTML file as Portable Markdown, literal heading, list, and divider markers remain visible as text. Actual headings, lists, and dividers keep their formatting.
  • Responsive images retain complete image addresses when their paths or query parameters contain commas. Per-image and total image limits still apply.
  • When you disable your default Quick Copy destination, Quick Copy switches to the first enabled destination in your menu order. Reordering destinations keeps your current default if it is still enabled.

Requires Obsidian Desktop 1.13.7 or later.

README file from

Github

Target Copy

Language: English · 切换到简体中文 → 繁體中文 · 日本語 · Deutsch

Copy an Obsidian selection or note in a format tailored for the app where it will be pasted. Every conversion runs locally inside Obsidian.

Target Copy 1.0.4 is the current open-source desktop release.

Read the Target Copy product story (Chinese) for its design intent and a closer look at the workflow.

Why destination-aware copying?

Google Docs, Microsoft Word, Slack, and email clients interpret clipboard data in different ways. Target Copy asks for the destination and adapts the surrounding HTML while preserving the user's source, content, links, images, and code by default. Destination-specific handling appears as a compatibility note after copying.

Destinations

Destination Clipboard output Important behavior
Google Docs Rich HTML + plain text Semantic headings, bordered tables, nested lists, inline styles
Microsoft Word / WPS Office-friendly HTML + plain text Heading outline metadata, Calibri defaults, tables and code blocks
Notion Semantic HTML + plain text Clean pages, lists, tables, callouts, and code blocks
Slack Lightweight HTML + plain text Tables use aligned monospace text in both representations
Email Inline-CSS HTML + plain text Portable light palette for Gmail, Outlook, and Apple Mail
WeChat Official Account Fully inline HTML + plain text Mobile typography with original links, images, and source code preserved
Portable Markdown Plain text Standard Markdown with clickable Obsidian links for wikilinks
Plain text Plain text Readable headings, lists, tables, blockquotes, and code
Original source (optional) Plain text Exact source, including whitespace, properties, and markup
HTML source (optional) Plain text Portable HTML markup with inline styles

All rich targets write both text/html and text/plain, allowing the receiving application to choose its preferred representation. Slack receives readable text when the editor uses the plain-text clipboard representation.

Source and output formats

The source export destinations can be enabled in settings. Original source copies editor selections or whole Markdown/HTML files exactly. For an exact source selection, use the editor; Reading view supplies rendered content.

Input Portable Markdown output
Markdown containing a fenced HTML example The complete fenced code example
Markdown containing raw HTML The original HTML, as supported by Markdown
HTML file or Reading view selection Markdown headings, links, emphasis, lists, tasks, and simple tables
Merged/nested tables, SVG, audio, video, or complex HTML HTML preserving the structure and resource references

Clickable wikilinks use obsidian:// and open the original vault. Recipients need access to that vault to follow them. The destination editor controls support for these links; Google Docs may retain only their labels and styling. The plain-text clipboard representation includes the complete link address.

Portable Markdown represents highlighted text with inline <mark> elements.

Current features

  • Copy a selection in Edit, Live Preview, or Reading view; copy the whole note when nothing is selected.
  • Hover Copy for target… in editor and file context menus to open the enabled destinations as a native submenu, then select one to copy immediately.
  • Open the destination picker from the ribbon or command palette, or bind a hotkey to each destination.
  • Choose which destinations appear in the picker and command palette.
  • Use a fixed default destination for Quick Copy or explicitly repeat the last-used destination.
  • Follow the system language or choose English, Simplified Chinese, Traditional Chinese, Japanese, or German. English covers other system languages.
  • Preserve YAML frontmatter, Obsidian comments, formulas, and fenced code by default. Wikilinks become clickable Obsidian links; settings can instead keep [[source syntax]] or visible text only.
  • Keep Mermaid, Dataview, Tasks, PlantUML, Graphviz, and every other fenced block as editable source.
  • Embed local vault images as data URLs.
  • Keep LaTeX and diagram source editable.
  • Preserve SVG and Canvas markup for rich targets; text targets receive their serialized source; Markdown retains SVG markup. Canvas portability is reported for each destination.
  • Keep ordinary raster image bytes unchanged, with optional user-configured per-image and total safety limits.
  • Preserve external links in WeChat output and report WeChat-specific link handling.

Screenshots

Choose a destination from the context menu

Hover Copy for target… to open the enabled destinations, then choose one to copy immediately.

Obsidian editor context menu with Target Copy destinations

Keep the destination list focused

Enable only the apps and formats used in your workflow. The picker, context menu, and command palette show the same enabled destinations.

Target Copy destination settings

Control what is carried to the destination

Open the gear beside a destination to adjust its title, internal links, and local images. Each inherited option displays its current value.

Target Copy copy preferences

Paste into Google Docs

The copied content retains headings, inline formatting, lists, task states, tables, links, and source blocks in Google Docs.

Target Copy formatting result in Google Docs

Copy controls

The picker shows whether it will copy a selection or the whole document, the source format, and each destination's clipboard format. Destinations keep a stable order, with a marker on the last-used target.

In Settings → Target Copy, choose the Quick Copy destination at the top. In Copy destinations, toggle the apps you use, choose Adjust order to move them, or open the gear beside an enabled target to set its title, links, and image preferences. Inherited options show the current general value. Advanced settings contains optional limits for embedded images and note expansion. Limits default to unlimited. Destinations with individual preferences are marked Customized; the reset button restores general settings for that destination. Limits validate input immediately, show save status, and remember the previous custom value when switching back from unlimited. Settings retain input focus while saving.

Editor selections include the reference-link and footnote definitions they use. Original source remains an exact copy of the selected text.

Long-running conversions offer a Cancel copy button and command. The Last copy details command shows all compatibility notices from the latest successful copy. Copy-progress and compatibility notifications have separate settings. Details also show the source file, actual clipboard format, elapsed time, and how many image references were retained and embedded. These counts describe the copied content; destination apps still control image display. Direct source copies retain image references without counting them.

Local processing

Every conversion runs inside Obsidian. Target Copy processes the selection or note chosen by the user, expands referenced local Markdown notes, resolves vault images when image embedding is enabled, and writes the destination format to the system clipboard. Remote image references remain URLs for the destination editor to handle.

Manual installation

  1. Run npm ci and npm run build in this directory.
  2. Create <your-vault>/.obsidian/plugins/target-copy/.
  3. Copy main.js, manifest.json, and styles.css into that directory.
  4. Reload Obsidian, open Settings → Community plugins, and enable Target Copy.

The release archive contains exactly those three installable files.

Commands

The picker, Quick Copy, and Repeat Last commands are always available. Dedicated destination commands are registered only for destinations enabled in settings, so the command palette stays compact.

  • Target Copy: Copy for target…
  • Target Copy: Quick copy using the default target
  • Target Copy: Repeat the last copy target
  • Target Copy: Cancel copy while a conversion is running
  • Target Copy: Last copy details
  • Target Copy: Copy for … for each enabled destination

Compatibility notes

  • Slack receives rich HTML plus readable plain text for its message editor.
  • Mermaid, SVG, Dataview, Excalidraw, and other plugin syntax is preserved as editable source for the destination application to render.
  • Version 1.0.4 targets Obsidian Desktop and its desktop clipboard implementation.
  • Word and WPS receive Office-friendly HTML; the receiving editor controls its final layout.
  • The WeChat editor may re-upload pasted images. Always confirm every image in the editor before publishing.

Development

npm ci
npm run check

npm run dev starts an esbuild watcher. Release archives package the generated main.js with manifest.json and styles.css.

The conversion pipeline is:

selection or note
  → source cleanup
  → Obsidian MarkdownRenderer
  → semantic DOM normalization
  → destination adapter
  → text/html + text/plain clipboard bundle

See the architecture and dependency and license notes.

Open source

The complete plugin source, tests, translations, public documentation, build scripts, and public CI configuration are published under the MIT License. The plugin is a self-contained local Obsidian runtime. The production bundle uses Obsidian and its desktop clipboard bridge as host APIs; build and test tools are documented separately.

License

MIT