jiridj / hugo-collapsible-code Goto Github PK
View Code? Open in Web Editor NEWA hugo shortcode for collapsible code blocks.
License: MIT License
A hugo shortcode for collapsible code blocks.
License: MIT License
Hi thanks for the shortcode βΒ it wasn't working for me and I finally figured out that in the "makeCollapsible" function, this line:
if (div.offsetHeight > height {
Needs to be changed to:
if (div.offsetHeight > parseInt(height, 10)) {
Because the maxHeight (max-height in CSS) property is not a number, it's a string with a 'px' at the end.
Likewise the var height at the top needs to be set to '300px' rather than just 300. Is this something that changed in the last few years since you made this? Possibly. Thanks!
Hi I am confused about what shortcode options are available to me. I ask because in code.html it shows that it can accept two different arguments.
Secondly, what syntax highlighting options are available for the shortcode?
Thirdly, and slightly unrelated, I would suggest a faq for the readme so I newbs at frontend (like me) can try to debug common problems. (For example, it took me a while to realize I had to reference the stylesheet and the script somewhere in my project's Hugo framework)
Great project btw. I got it to work. Will probably find more places to use it
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.