Plugin for show more code block

Hi folks,
I want to include code blocks into my blogs posts, this is all working fine, but some of the code blocks can be quite long, is there a way of limiting the number of lines shown with with a display more/expand functionality?

1 Like

Hi Gabriel.

Indeed there is a way! In short, here is how to do it:


{% highlight ruby %}
puts 'Expanded message'
{% endhighlight %}


Here is my cheatsheet doc covering that in more detail - I added a Jekyll section to explain and demo this in more detail.



Hi Michael. Your link is 404 but here is one I just read that works: Collapsible items | Dev Cheatsheets

Also github gist has other tips:

Thanks for fixing that - the link you gave is correct now.

And thanks for the gist.