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

是否可以加入 codeblock 的 fold 功能 #178

Closed
CCCarrion opened this issue Jan 12, 2021 · 8 comments · Fixed by #679
Closed

是否可以加入 codeblock 的 fold 功能 #178

CCCarrion opened this issue Jan 12, 2021 · 8 comments · Fixed by #679
Labels
Feature Request New feature or request
Milestone

Comments

@CCCarrion
Copy link

加入codeblock 的折叠功能。
具体来说可以参考 theme butterfly 的 highlight_shrink 功能。
附上 该主题的 git地址 https://github.com/jerryc127/hexo-theme-butterfly/
感谢开发者

@CCCarrion CCCarrion added the Feature Request New feature or request label Jan 12, 2021
@welcome
Copy link

welcome bot commented Jan 12, 2021

Thanks for opening this issue, maintainers will get back to you as soon as possible!

@stevenjoezhang
Copy link
Member

已经有这个功能了

{% note info no-icon This is a summary %}
{% code %}
code block in note tag
code block in note tag
code block in note tag
{% endcode %}
{% endnote %}

@fightinggg
Copy link

已经有这个功能了

{% note info no-icon This is a summary %}
{% code %}
code block in note tag
code block in note tag
code block in note tag
{% endcode %}
{% endnote %}

代码折叠,有些代码特别长,挂上去以后影响阅读,想要的应该是代码的部分折叠,这个已有的功能是全部折叠

@liuccch
Copy link

liuccch commented Feb 7, 2022

image
就是类似这种的代码折叠,我在另一个主题中看到了,可以连同代码框一起折叠
image
大佬看能不能改进下

@ljcbaby
Copy link
Member

ljcbaby commented Feb 7, 2022

我的个人观点:
现有的 {% note info no-icon This is a summary %} 方式已经能够满足要求。
折叠是为了解决代码长度过长的问题,那样只显示头几行是没有用的,所以全部折叠也可以。至于短的,不需要折叠的代码块,直接就完全展示不就行了

@zhaomoran
Copy link

可以给个是否进行折叠的开关,根据代码长度和配置项,自动确定是否折叠展示还是展示全部。当然折叠按钮可以在所有的代码块展示。

@stevenjoezhang
Copy link
Member

添加了,欢迎测试: #679

@stevenjoezhang stevenjoezhang added this to the 8.18.0 milestone Jul 25, 2023
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. It is possible issue was solved or at least outdated. Feel free to open new for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Feature Request New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants