Journal Sync

by LinYun
5
4
3
2
1
Score: 50/100

Description

Obsidian plugin for journaling and publishing to multiple platforms.

Reviews

No reviews yet.

Stats

4
stars
71
downloads
0
forks
30
days
14
days
14
days
0
total PRs
0
open PRs
0
closed PRs
0
merged PRs
1
total issues
0
open issues
1
closed issues
18
commits

Latest Version

15 days ago

Changelog

[1.0.9] - 2026-09-08

Added

  • 发送日志(JournalSync-Log:每次发布都会在插件目录 send-log/ 下保存一份快照(内容、图片、目标预设、诊断信息),最多保留最近 10 条。JournalSync-Log 命令打开日志弹窗,可对任意一条记录点「重新编辑」,恢复内容与图片后再次发布。派发前失败(未发出)也会记录。
  • Telegram Markdown→HTML 转换:新增 src/core/telegram-markdown.js,基于 @borodin/mdgram 将 Obsidian Markdown 统一转换为 Telegram HTML(普通链路 classic HTML、富文本链路 Rich HTML),替代原先的 parse_mode=Markdown 与手写富文本拼装。
  • Send log (JournalSync-Log):every publish saves a snapshot (content, images, target preset, diagnostics) under send-log/ in the plugin directory, keeping the latest 10 entries. The JournalSync-Log command opens a log modal; any entry can be re-edited and re-sent with content and images restored. Failed pre-dispatch attempts are recorded too.
  • Telegram Markdown→HTML conversion:new src/core/telegram-markdown.js based on @borodin/mdgram converts Obsidian Markdown to Telegram HTML uniformly (classic HTML for the plain path, Rich HTML for the rich path), replacing the old parse_mode=Markdown and hand-built rich-text assembly.

Changed

  • 核心逻辑收拢到 src/core/:统一 MIME 类型推断(图片+视频)到 src/core/mime.js,共享 multipart 表单构造到 src/core/multipart.js,消除 mastodon/missky/notion/telegram/payload 中重复的 getMimeType 与重复的表单构造。纯逻辑(日记文件名/标题、vault 路径、图片引用解析、富文本草稿、内容提取、设置合并)从 src/main.js 迁出到 src/core/ 独立模块,src/main.js 只保留生命周期与调度。行为不变。
  • 核心规则补测试:新增 tests/core.test.js,覆盖图片 token 匹配、设置深度合并、日记文件名/标题占位符、MIME、multipart。npm test 同时运行 Bluesky 与 core 两套测试。
  • Telegram 发送改用 HTML 解析模式sendMessagesendPhotosendMediaGroup 的文本与图片说明统一经 Markdown→HTML 转换后以 parse_mode=HTML 发送;标题/列表等 Markdown 块级语法在普通链路降级为加粗/圆点,富文本链路保留完整标签。新增 tests/telegram-markdown.test.js 覆盖行内格式、转义、引用、代码块与图片 token 还原。
  • 中英文双语界面(i18n):新增 uiLanguage 设置(auto 跟随 Obsidian 语言,或手动 zh/en)。发送面板、设置页、日志弹窗与全部适配器文案接入翻译引擎,manifest.name 在消费点统一翻译;跨适配器同文案冲突按平台前缀区分。
  • 跨平台发送并行化:通用适配器并发执行;telegram(单次调用、频道在 adapter 内并行)与 mastodon(账号串行)作为并行组运行。调度逻辑收拢到 src/core/send-dispatcher.js,新增 tests/send-dispatcher.test.js(20 例)。
  • 附件大小预检优化:优先读取文件元数据(TFile.stat.size / Blob.size),仅元数据缺失时回退读取完整二进制;单适配器内检查并行执行。
  • 编辑器粘贴优化:非图片内容统一以纯文本插入,避免网页/Word 复制内容因富文本丢失换行。
  • Core logic consolidated into src/core/:unified MIME inference (image+video) in src/core/mime.js and shared multipart body construction in src/core/multipart.js, removing duplicated getMimeType and form builders across mastodon/missky/notion/telegram/payload. Pure logic (diary filename/heading, vault paths, image-ref parsing, rich-draft, content extraction, settings merge) moved out of src/main.js into standalone src/core/ modules; src/main.js keeps only lifecycle and orchestration. No behavior change.
  • Core rules now tested:new tests/core.test.js covers image-token matching, settings deep-merge, diary filename/heading placeholders, MIME and multipart. npm test runs it alongside the Bluesky suite.
  • Telegram sends with HTML parse mode:text and captions of sendMessage/sendPhoto/sendMediaGroup are converted via Markdown→HTML and sent with parse_mode=HTML; block-level syntax (headings/lists) degrades to bold/bullets on the plain path and keeps full tags on the rich path. New tests/telegram-markdown.test.js covers inline formatting, escaping, quotes, code blocks and image-token restoration.
  • Bilingual UI (i18n):new uiLanguage setting (auto follows Obsidian's language, or zh/en). Send modal, settings page, log modal and all adapter messages are wired into the translation engine; manifest.name is translated at every consumption point; cross-adapter duplicate strings are platform-prefixed.
  • Parallel cross-platform sends:generic adapters run concurrently; telegram (single call, channels in parallel inside the adapter) and mastodon (accounts serial) run as parallel groups. Dispatch logic consolidated in src/core/send-dispatcher.js, covered by tests/send-dispatcher.test.js (20 cases).
  • Faster attachment size pre-check:file metadata (TFile.stat.size / Blob.size) is read first; full-buffer read is only a fallback. Checks within one adapter run in parallel.
  • Paste handling:non-image pastes are inserted as plain text only, so web/Word formatted content can no longer lose newlines.

Fixed

  • Telegram 引用与代码块内容丢失:修复 Markdown→HTML 转换中两个内容丢失缺陷——围栏代码块(``` / ~~~)内以 > 开头的行被误当作引用提取而丢失;引用紧贴正文(无空行分隔)时占位符被解析器吞掉导致引用内容整体丢失。现在围栏感知 + 占位符空行隔离,引用与代码内容完整保留。
  • 部分渠道发送图片时不再附带相机 emoji:微博纯图片微博空正文由 📷 占位改为空格;Mastodon 空正文时不再发送 status: '📷',仅发送图片。
  • Telegram quote/code-block content loss:two Markdown→HTML conversion defects fixed — lines starting with > inside fenced code blocks were wrongly extracted as quotes and lost; quotes adjacent to body text (no blank line) had their placeholder swallowed, dropping the whole quote. Now fence-aware with blank-line placeholder isolation.
  • No more camera emoji when sending images on some platforms:Weibo image-only posts use a space placeholder instead of 📷; Mastodon omits the status field entirely for image-only posts.

README file from

Github

Journal Sync

简体中文 · Installation · Setup · Development

Write in Obsidian. Publish wherever your notes live.

Journal Sync sends selected text, the current heading section, or an entire note from Obsidian to flomo, Telegram, Mastodon, Misskey, Bluesky, Weibo, Notion, and Threads. Everything runs inside Obsidian—no Node.js, Python, or separate backend service required.

Journal Sync publishing dialog with content preview and destination selection

From note to published post

  1. Run JournalSync-New to open today's journal and add a timestamped heading.
  2. Write naturally, including images stored in your vault.
  3. Select a passage—or leave the cursor in the section you want—and run JournalSync-Send.
  4. Review the content, choose one or more destinations, and publish—or press Ctrl/Cmd+Enter to send directly.

All three commands run from the command palette: press Ctrl/Cmd+P, type part of the name—typing send finds JournalSync-Send—and press Enter. Recently used commands stay near the top, so day-to-day publishing is three steps: open the palette, run Send, click Publish. Every send is snapshotted, so JournalSync-Log can reopen any of the last 10 sends for editing and resending.

The publishing dialog remembers target presets, supports multiple Telegram channels, and sends in the background so you can keep working.

What it does

  • Fast daily capture — create or open today's journal and start at a new timestamped heading.
  • Precise publishing scope — send a selection, the nearest configured heading section, or the complete note.
  • One publishing pass — choose several enabled platforms and Telegram channels from one dialog, with saved target presets for one-click switching.
  • Vault-aware images — resolve local Markdown and wiki-link images without relying on operating-system paths, or paste from the clipboard without touching your vault.
  • Editable preview — adjust text and image order before anything is sent.
  • Send history — the last 10 sends are snapshotted locally and can be reopened, edited, and resent.
  • Local configuration — credentials stay in Obsidian's plugin data; Journal Sync has no intermediary server.

Installation

  1. Open the latest GitHub Release.

  2. Download main.js, manifest.json, and styles.css.

  3. Put the three files in:

    <Vault>/.obsidian/plugins/journal-sync-bridge/
    
  4. In Obsidian, open Settings → Community plugins, refresh the plugin list, and enable Journal Sync.

Only those three release files are needed. Do not copy data.json; it contains your local account configuration.

First-time setup

Open Settings → Journal Sync after enabling the plugin.

Journal Sync settings with platform tabs

  1. Under Main settings, choose the journal folder, filename pattern, timestamp heading, default send scope, and local-image behavior.
  2. Under Plugin settings, enable each destination you use and enter its connection details.
  3. For Telegram, enter the Bot Token, fetch the available channels, and select the defaults.
  4. Most platforms offer a Test connection button to verify credentials before publishing. On flomo it sends a real memo; the others only validate the stored token.

Using Journal Sync

All three commands run from the Obsidian command palette (Ctrl/Cmd+P); you can also bind them to hotkeys under Settings → Hotkeys.

Command What happens
JournalSync-New Creates or opens today's journal, appends a timestamped heading, and places the cursor below it. Also available from the pencil ribbon icon.
JournalSync-Send Opens the publishing dialog for the selected text or the configured scope around the cursor.
JournalSync-Log Opens the send log: the last 10 send snapshots, each with a Re-edit button that reopens the publishing dialog prefilled with that send (content, image tokens, and Telegram one-shot options restored).

A text selection always takes priority. With no selection, Journal Sync uses the send scope configured in settings: a heading level from # through ######, or the complete page. A heading section is the content below the nearest heading of that level, up to the next heading of the same or higher level; the heading line itself is not sent—when the destination is Notion, that heading's text becomes the page title instead. If the cursor is not below a heading of the configured level, or that section is empty, nothing is sent and a notice explains why. The default scope is ##, matching the default timestamp heading level.

Images in the publishing dialog

Local image references appear as tokens such as @图片1, with thumbnails below the editor. The token marks the image's position for Telegram rich publishing. Move the token to reorder the image, or remove it to exclude that image from the send. You can also paste an image from the clipboard directly into the editor—it becomes a token the same way and is sent without being written to your vault.

Supported destinations

Destination Text Vault images Notes
flomo Publishes through your flomo API webhook. Testing the connection sends a real memo to flomo.
Telegram Supports multiple channels and three send modes: standard (text with images, up to 9 per message), rich publishing that preserves image position and supported Markdown, and Telegraph—long posts are published as a Telegraph page and the link is posted to your channels.
Mastodon Custom instance, multiple accounts, and visibility. Up to 4 images per post.
Misskey Custom instance and visibility (public / home / followers). Up to 16 images per post. Direct-message visibility is not supported.
Bluesky Signs in with an App Password created in Bluesky → Privacy & security → App passwords. Text is limited to 300 graphemes and 3,000 UTF-8 bytes per post, with up to 4 images (JPEG/PNG/WebP/GIF, 2 MB each).
Weibo Publishes through the Weibo Open Platform after OAuth authorization with your own app (App Key/Secret). Plain text beyond 140 Weibo units can be sent as long text; image posts attach a single JPEG/PNG/GIF image with text capped at 140. Visibility is public or self-only.
Notion Creates pages or database records and uploads referenced local images. Images over 5 MB can be compressed to WebP in memory before upload (optional, off by default; vault files are never modified).
Threads Publishes plain text (500 UTF-8 bytes per post) through the Threads Graph API after OAuth with your own Meta app. Reply permission is configurable. Images are not supported yet.

Platform limits still apply. When a post exceeds a platform's image count, Journal Sync warns first and then sends the first images up to the limit. Long Telegram messages are split automatically; media count and caption limits follow the Telegram Bot API. A send to several platforms proceeds independently per platform—if one fails, the others are still published.

Privacy and credentials

Journal Sync calls each destination directly from Obsidian. Tokens, webhooks, channel IDs, and other settings are stored in:

<Vault>/.obsidian/plugins/journal-sync-bridge/data.json

data.json is excluded from this repository and from GitHub Releases. Never attach it to an issue or commit it. If a credential is exposed, revoke it at the corresponding platform and create a new one.

The send log also lives in the plugin directory, under send-log/: each of the last 10 sends is stored as a local snapshot with copies of the referenced images, so Re-edit can fully restore it. Delete that folder to erase the history.

Compatibility

  • Obsidian 1.5.0 or later
  • Windows, macOS, and Linux
  • Not marked desktop-only; verify the integrations you use on your mobile devices

Development

Architecture, local builds, release mechanics, and adapter contribution guidance live in docs/development.md.

Journal Sync is available under the MIT License.