cherry-studio icon indicating copy to clipboard operation
cherry-studio copied to clipboard

feat:add MrDoc export functionality add configuration

Open zmister2016 opened this issue 1 year ago • 2 comments

增加导出到觅思文档(MrDoc)的功能。

MrDoc 是一个开源的在线知识库系统,项目地址为 https://github.com/zmister2016/MrDoc 。

其配置方式和使用方式与「思源笔记」类似,填入觅思文档的URL、用户Token和文集ID即配置完成,导出行为则是通过「用户Token」的 API 接口在觅思文档中新建一篇 Markdown 文档。

配置界面

配置信息如图

用户Token的获取

image

Summary by Sourcery

Add functionality to export content to the MrDoc knowledge base system.

New Features:

  • Implement export logic for sending Markdown content to a configured MrDoc instance via its API.
  • Add a settings page for configuring the MrDoc API URL, authentication token, and target Box ID.
  • Integrate the MrDoc export option into message and topic context menus.
  • Add an option in settings to show or hide the MrDoc export menu item.

zmister2016 avatar Apr 24 '25 13:04 zmister2016

@sourcery-ai review

DeJeune avatar Apr 27 '25 04:04 DeJeune

Reviewer's Guide by Sourcery

This pull request adds functionality to export Markdown content to MrDoc, an open-source online knowledge base system. The implementation involves adding configuration settings for the MrDoc API URL, User Token, and Collection ID, similar to the existing Siyuan integration. The export process uses API calls to check the connection and create new Markdown documents in the specified MrDoc collection.

No diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Implement the core logic for exporting Markdown content to MrDoc.
  • Added a function to handle the overall MrDoc export flow.
  • Included a connection test to verify the MrDoc API and token.
  • Created a helper function to make the API call for creating a new document in MrDoc.
  • Implemented error handling and status updates during the export process.
src/renderer/src/utils/export.ts
Add state management and initial settings for MrDoc configuration.
  • Added state properties for MrDoc API URL, User Token, and Collection ID.
  • Added a setting to control the visibility of the MrDoc export option in menus.
  • Created Redux actions to update the new MrDoc settings.
  • Initialized the new MrDoc settings fields and export menu option state.
src/renderer/src/store/settings.ts
Create and integrate the MrDoc settings configuration interface.
  • Created a new React component specifically for MrDoc settings.
  • Added input fields for the API URL, Token, and Collection ID in the settings UI.
  • Included a button within the settings to test the connection to the MrDoc API.
  • Added a help icon and link for guidance on obtaining MrDoc credentials.
  • Integrated the new MrDoc settings component into the main Data Settings page menu and rendering logic.
src/renderer/src/pages/settings/DataSettings/MrdocSettings.tsx
src/renderer/src/pages/settings/DataSettings/DataSettings.tsx
Integrate the MrDoc export functionality into message and topic context menus and add a settings toggle.
  • Added an option to export individual messages to MrDoc in the message menubar.
  • Added an option to export entire topics to MrDoc in the topics tab context menu.
  • Added a switch in the Export Menu settings to enable or disable the MrDoc export option.
src/renderer/src/pages/home/Messages/MessageMenubar.tsx
src/renderer/src/pages/home/Tabs/TopicsTab.tsx
src/renderer/src/pages/settings/DataSettings/ExportMenuSettings.tsx
Add localization strings for MrDoc features across supported languages.
  • Added translated text for MrDoc settings titles and descriptions.
  • Added translated text for placeholders in MrDoc settings input fields.
  • Added translated text for MrDoc export menu options.
  • Added translated text for messages related to MrDoc export success, warnings, and errors.
  • Added translated text for the MrDoc connection check button and results.
src/renderer/src/i18n/locales/en-us.json
src/renderer/src/i18n/locales/ja-jp.json
src/renderer/src/i18n/locales/ru-ru.json
src/renderer/src/i18n/locales/zh-cn.json
src/renderer/src/i18n/locales/zh-tw.json

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an issue from a review comment by replying to it. You can also reply to a review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull request title to generate a title at any time. You can also comment @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in the pull request body to generate a PR summary at any time exactly where you want it. You can also comment @sourcery-ai summary on the pull request to (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the pull request to resolve all Sourcery comments. Useful if you've already addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull request to dismiss all existing Sourcery reviews. Especially useful if you want to start fresh with a new review - don't forget to comment @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

  • Contact our support team for questions or feedback.
  • Visit our documentation for detailed guides and information.
  • Keep in touch with the Sourcery team by following us on X/Twitter, LinkedIn or GitHub.

sourcery-ai[bot] avatar Apr 27 '25 04:04 sourcery-ai[bot]