Skip to content

思源笔记插件,粘贴时自动处理(LaTeX公式转换,ppt、word列表粘贴适配,富文本颜色背景色保留、去除上标、去除链接、去除空格、去除换行),对块进行处理(合并块、拆分块、复制到小红书带emoji、去除上标、去除空格、链接转文本、英文符号转中文符号、批量调整图片宽度、代码块语言等)

License

Notifications You must be signed in to change notification settings

Achuan-2/siyuan-plugin-text-process

Repository files navigation

🤔 Development Background

When pasting content from external sources into SiYuan Notes, processing is required. The aim is to automate these processes to eliminate repetitive tasks, save time, and allow more time for thinking and creation.

Examples:

  • AI-generated mathematical formulas are often in LaTeX format and need conversion to Markdown math format
  • List structures are lost when copying from PowerPoint or Word to SiYuan, requiring manual list recreation
  • Text copied from PDF contains extra line breaks and spaces that need to be automatically removed
  • And more...

✨ Plugin Features

The plugin has two main functions:

  • Automatic processing during pasting
  • Block processing

Automatic Processing During Pasting

A button is added to SiYuan's top bar where you can enable or disable specific processing features.

Current features include:

  • Convert LaTeX display math (\[...\]) to $$...$$ format, and inline math (\(...\)) to $...$ format
  • Remove line breaks (useful for removing extra line breaks from PDF copies)
  • Remove spaces (useful for removing extra spaces from PDF copies)
  • Remove empty lines (useful for keeping pasted content in a single block)
  • Add empty lines (useful for separating pasted content into blocks by paragraph)
  • Rich text list conversion (supports maintaining list styles and hierarchy when pasting lists from PowerPoint or Word, and converts bullet symbols like •○▪▫◆◇►▻❖✦✴✿❀⚪☐ to SiYuan Notes list format)

Note: The plugin only affects external plain text pasting and some HTML pasting. It may not affect HTML copying and rich text pasting within SiYuan Notes. If it's not working, you can use the plain text paste option in the right-click menu to achieve automatic processing (although formatting will be lost, this is currently unavoidable).

Block Processing

The plugin adds the following buttons to the block menu:

  • Merge blocks (appears when two or more blocks are selected)
  • Split blocks
  • Convert list symbols to Markdown list format
    • Converts bullet symbols like •○▪▫◆◇►▻❖✦✴✿❀⚪☐ to SiYuan Notes list format
  • Copy list as plain text with symbols (appears when a list block is selected)
    • Useful for sharing on platforms like social media that only support plain text
    • Note: Ordered lists use number emojis (1️⃣2️⃣3️⃣), unordered lists can use custom symbols specified in settings. By default, first level uses ■, multi-level uses 💡■

❤️ Support

If you like my plugin, please star the GitHub repository and consider making a donation. This will motivate me to continue improving this plugin and developing new ones.

For the list of donors, please visit: https://www.yuque.com/achuan-2

About

思源笔记插件,粘贴时自动处理(LaTeX公式转换,ppt、word列表粘贴适配,富文本颜色背景色保留、去除上标、去除链接、去除空格、去除换行),对块进行处理(合并块、拆分块、复制到小红书带emoji、去除上标、去除空格、链接转文本、英文符号转中文符号、批量调整图片宽度、代码块语言等)

Resources

License

Stars

Watchers

Forks

Packages

No packages published