hexo-theme-next
hexo-theme-next copied to clipboard
是否可以加入 codeblock 的 fold 功能
加入codeblock 的折叠功能。 具体来说可以参考 theme butterfly 的 highlight_shrink 功能。 附上 该主题的 git地址 https://github.com/jerryc127/hexo-theme-butterfly/ 感谢开发者
Thanks for opening this issue, maintainers will get back to you as soon as possible!
已经有这个功能了
{% 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 %}
已经有这个功能了
{% 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 %}
代码折叠,有些代码特别长,挂上去以后影响阅读,想要的应该是代码的部分折叠,这个已有的功能是全部折叠
就是类似这种的代码折叠,我在另一个主题中看到了,可以连同代码框一起折叠
大佬看能不能改进下
我的个人观点:
现有的 {% note info no-icon This is a summary %}
方式已经能够满足要求。
折叠是为了解决代码长度过长的问题,那样只显示头几行是没有用的,所以全部折叠也可以。至于短的,不需要折叠的代码块,直接就完全展示不就行了
可以给个是否进行折叠的开关,根据代码长度和配置项,自动确定是否折叠展示还是展示全部。当然折叠按钮可以在所有的代码块展示。
添加了,欢迎测试: https://github.com/next-theme/hexo-theme-next/pull/679