mugiwara85 / CodeblockCustomizer

Codeblock Customizer plugin for Obsidian
MIT License
148 stars 7 forks source link

FR: Can we achieve the semi folding effect shown in the figure below #43

Closed doit132 closed 10 months ago

doit132 commented 10 months ago

image

mugiwara85 commented 10 months ago

Yes, I think, this would be possible. I was considering adding a feature something like this. Although, I am not yet sure, if the uncollapse button at the bottom, should be added or not? If the button is added then it could be confusing that normally the header controls folding, but in this case the lower button. Maybe it could be an option. I think it through, but generally it is a good idea. It will be available in a future release.

YukiLx commented 10 months ago

I have seen this semi folding effect in other tools, and it feels good. It would be a surprise if the plugin can achieve this effect.

I have a little question:in some tools, it can be set to automatically render such a semi folding effect when the number of lines in a code block exceeds a certain number of lines. I want to know whether this is achievable.

mugiwara85 commented 10 months ago

It definitely is. I am already working on it, just have to make a little smoother, so the difference in opacity between the lines is not visible. This what I have now: image You can set the number of visible lines. If you fold a code block, and it contains the previously set number + 4 lines (for the fade effect), then it will semi-fold.

mugiwara85 commented 10 months ago

Available in release 1.2.1 :) I hope you like it. Please give a feedback, if it's ok, or I should change something. I am closing the issue.