Skip to content
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

feat(cli): add export type for options and adjust config param use #50

Open
wants to merge 3 commits into
base: feat/export-other-type
Choose a base branch
from

Conversation

ruoqianfengshao
Copy link
Contributor

@ruoqianfengshao ruoqianfengshao commented Oct 11, 2024

  1. 重构部分 options 传参,提供一个全局的 getConfig、setConfig 方法进行 cli 参数的读写,避免 key 和 token 在函数调用中多级传递
  2. 增加 ctoken,boardExportType,sheetExportType,tableExportType,docExportType 的参数,并支持相应的下载导出逻辑
  3. 过程中发现非 yuque.com 下的链接无法下载,基于 url 扩展了一下对更多域名的支持

导出结构为
image

#47

@gxr404 gxr404 changed the base branch from main to feat/export-other-type October 13, 2024 12:32
@gxr404
Copy link
Owner

gxr404 commented Oct 13, 2024

感谢pr 改动有点多切了个新分支
项目初衷是想把语雀知识库本地化 如果导出lakesheet这种 就得依赖语雀的线上的导入功能,
如果能导出jpg、png这种不依赖语雀的格式就最好,看了下有点麻烦 估计是yuque自己的渲染器导出功能
现在导出lakesheet也行吧 有好过没有❤️

感兴趣的话可以试着跑下 npm test 估计config的改动 应该有测试失败的用例

@ruoqianfengshao
Copy link
Contributor Author

jpg 和 png 可以支持的,导出格式是把语雀支持的类型都声明了下,导出接口也是同一个,改下传参就行

测试用例我当时跑了一下发现里面依赖了一些其他的语雀知识库,就没管了,我空了再跑下测试用例

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants