Home Comments Thread
New Thread

Code Folding with 6 Lines of Vanilla JavaScript | /en/2023/09/code-folding/

giscus giscus 2023-09-20 09:47:02

Code Folding with 6 Lines of Vanilla JavaScript

Do you know what the top requested feature of blogdown has been in the past six years? Code folding. I have rarely seen 34 upvotes on a Github issue in projects that I maintain.
[…] The …

https://yihui.org/en/2023/09/code-folding/

2 Comments

chuxinyuan chuxinyuan 2023-09-20 09:47:05

我想给代码块上增加一个复制按钮,当鼠标放在代码块上时才出现,这个功能在代码块比较长的情况下比较方便,类似Manjaro 论坛的这种效果。

yihui yihui 2023-09-20 22:03:44

走你:https://yihui.org/en/2023/09/copy-button/

6 行 JS 代码加 10 行 CSS 就足以搞定了。

albertjin albertjin 2023-09-21 04:10:37

To correct a trivial typo :)

For example, if you want fold tables

=> want to fold

yihui yihui 2023-09-21 05:44:52

Thanks! Fixed via 1a79b92. Next time please feel free to use the menu "Edit this page" at the bottom of the post to send a Github pull request to fix any typo you find.

Sign in to join the discussion

Sign in with GitHub