Skip to content

Click the top bar button to hide/show the highlighted text in SiYuan

License

Notifications You must be signed in to change notification settings

Achuan-2/siyuan-plugin-highlight-cloze

Folders and files

NameName
Last commit message
Last commit date

Latest commit

6f7fcfc · Jan 20, 2025

History

22 Commits
Nov 28, 2024
Nov 28, 2024
Nov 29, 2024
Nov 28, 2024
Dec 9, 2024
Nov 28, 2024
Dec 9, 2024
Jan 20, 2025
Nov 29, 2024
Nov 29, 2024
Nov 28, 2024
Nov 28, 2024
Dec 9, 2024
Nov 29, 2024
Nov 28, 2024
Nov 28, 2024
Nov 28, 2024
Nov 28, 2024
Nov 28, 2024
Nov 28, 2024
Nov 28, 2024

Repository files navigation

Highlight Cloze

🤔Background

While learning, we often encounter fill-in-the-blank questions and key points that need memorization. To aid in memorization, we can use the highlight cloze method to mark these key points and questions, ensuring we have truly remembered them.

✨Features

  • ✨Click the plugin button at the top to toggle the visibility of highlighted text.

  • ✨In highlight cloze mode, hovering over the cloze text reveals the highlighted content.

  • ✨When exporting to PDF in highlight cloze mode, the style is preserved, allowing you to print the document for review and testing.

  • ✨Support setting shortcut keys, default is empty

🎨Custom CSS

Custom highlight cloze styles are supported.

Example:

If you want the text with a hollow highlight style to have a black underline, you can modify the CSS in the settings as follows:

/* Style for text with  cloze */
.b3-typography mark,
.b3-typography span[data-type~=mark],
.protyle-wysiwyg mark,
.protyle-wysiwyg span[data-type~='mark'] {
    color: transparent !important;
    transition: color 0.5s ease-in-out;
    background: none !important;
    border-bottom: 2px solid var(--b3-theme-on-background) !important;
}
/* Style for text when hovering over cloze */
.b3-typography mark:hover,
.b3-typography span[data-type~=mark]:hover,
.protyle-wysiwyg mark:hover,
.protyle-wysiwyg span[data-type~='mark']:hover {
    color: var(--b3-protyle-inline-mark-color) !important;
    transition: color 0.5s ease-in-out;
}

If you want the exported PDF to have the hollow style with a black underline, while keeping the original highlight style in the Siyuan application, you can set the style specifically for #preview .protyle-wysiwyg span[data-type~='mark']

/* Style for text with cloze*/
.b3-typography mark,
.b3-typography span[data-type~=mark],
.protyle-wysiwyg mark,
.protyle-wysiwyg span[data-type~='mark'] {
    color: transparent !important;
    transition: color 0.5s ease-in-out;
}

/* Style for text when hovering over cloze */
.b3-typography mark:hover,
.b3-typography span[data-type~=mark]:hover,
.protyle-wysiwyg mark:hover,
.protyle-wysiwyg span[data-type~='mark']:hover {
    color: var(--b3-protyle-inline-mark-color) !important;
    transition: color 0.5s ease-in-out;
}

/* Style for cloze in exported PDF */
#preview .protyle-wysiwyg span[data-type~='mark'] {
    color: transparent !important;
    border-bottom: 2px solid var(--b3-theme-on-background);
}

❤️Powered by Love

If you like my plugin, please consider starring the GitHub repository and donating if possible. This will motivate me to continue improving this plugin and developing new ones.

About

Click the top bar button to hide/show the highlighted text in SiYuan

Resources

License

Stars

Watchers

Forks

Packages

No packages published