Skip to content

Support importing markdown zip on the browser #14950

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 2, 2025
Merged

Conversation

Musicminion
Copy link
Contributor

@Musicminion Musicminion commented Jun 1, 2025

特性或者缺陷?

思源笔记的 Docker Web 端不支持 Markdown 的导入,要导入一个/多个Markdown文档,需要:

  1. 使用本地客户端,导入Markdown文件夹
  2. 用客户端导出 sy.zip(或者使用s3同步)
  3. 把导出的 sy.zip 通过web端的界面上传(或者在web端执行更新,拉取s3的结果)

现有的有关讨论:

这样:

  • 用户可以通过web端直接上传notion、我来等笔记软件导出的zip归档
  • 如果用户需要上传单个Markdown,可以把该Markdown和图片资源用zip直接打包即可
  • 如果需要批量上传多个Markdown,可以把所有的Markdown和图片资源用zip直接打包即可

实现逻辑

通过实现API:/api/import/importZipMd,用户可以上传自己的 zip 文件,上传到server解压到临时文件夹,然后调用model.ImportFromLocalPath(notebook, unzipPath, toPath) 来进行。

实现效果如下:

redpandacompress_2025-05-31.01-35-16.mp4

补充建议

似乎没有找到icon的ZIP,不太确定这些都是在哪里定义的,如果可以稍微改改会好些。

Dev branch!

Any changes should be submitted to the dev branch.
任何改动,请提交到 dev 分支。

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@88250 88250 requested review from 88250 and Vanessa219 June 1, 2025 06:44
@88250 88250 added this to the 3.1.32 milestone Jun 1, 2025
@88250 88250 changed the title :feat: support markdown zip import from user's upload (for docker web) Support markdown zip import from the user's upload on the browser Jun 1, 2025
@88250 88250 changed the title Support markdown zip import from the user's upload on the browser Support importing markdown zip on the browser Jun 1, 2025
@TCOTC
Copy link
Contributor

TCOTC commented Jun 1, 2025

如果桌面端也支持导入 Markdown.zip 的话我觉得会更方便,因为有时候导入 Markdown 得先解压 zip 再导入 Markdown 文件夹

@88250 88250 removed the request for review from Vanessa219 June 2, 2025 13:13
@88250 88250 merged commit 12cc17b into siyuan-note:dev Jun 2, 2025
4 checks passed
@88250
Copy link
Member

88250 commented Jun 2, 2025

感谢你的贡献,思源有你更精彩!
Thank you for your contribution. SiYuan will be more wonderful with you!

@88250 88250 changed the title Support importing markdown zip on the browser Support importing markdown zip on the browser Jun 2, 2025
TCOTC added a commit to TCOTC/siyuan that referenced this pull request Jun 3, 2025
@TCOTC TCOTC mentioned this pull request Jun 3, 2025
Vanessa219 pushed a commit that referenced this pull request Jun 3, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
fix #14950
EightDoor added a commit to EightDoor/siyuan that referenced this pull request Jun 12, 2025
* commit 'dae6158860cc704e353454565c96e874278c6f47': (62 commits)
  🔖 Release v3.1.32
  ⬆️ Upgrade kernel deps
  🚨
  🎨 siyuan-note#14789
  🎨 siyuan-note#14789
  🎨 siyuan-note#14789
  🎨 Improve export menu (siyuan-note#14960)
  📝 Update changelogs
  🎨 siyuan-note#14955
  🎨 siyuan-note#14956
  🎨 siyuan-note#14939
  📝 Update changelogs
  🎨 Improve text siyuan-note#14945
  🎨 Support importing markdown zip on the browser (siyuan-note#14950)
  🎨 Improve text siyuan-note#14945
  🎨 siyuan-note#14945
  🎨 Improve text
  🎨 siyuan-note#14945
  🎨 siyuan-note#14945
  🎨 Improve backlink filtering below the heading siyuan-note#14929
  ...

# Conflicts:
#	.github/workflows/dockerimage.yml
#	app/src/config/account.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants