Easy runnable code blocks on Jekyll sites.
Include interactive trinkets in your Jekyll site with 2 lines of code. Why? Because static sites are better when they’re interactive!
Trinkets are designed for teaching but you can use them whenever you want your readers to see your code work interactively.
After installation, make your code blocks interactive and awesome with just two additional lines:
That’s it! As of Sept 2014 Jekyll Tools supports Python and HTML/CSS.
This code:
Gives you this interactive Python trinket on your Jekyll site:
This code:
Gives you this interactive HTML trinket on your Jekyll site:
Note: These trinkets support HTML, CSS, and Javascript. You can find a live version of the trinket above here.
Make your trinkets the right height:
Gives you this interactive Python trinket:
Drop the trinket-open
and trinket-close
files into the _includes
folder of your Jekyll site.
If you’re lazy, here’s a one-liner you can run from the root of your Jekyll project:
Our interactive Python trinket makes heavy use of the awesome Skulpt project, which uses client side Javascript to interpret Python in your browser. Check em out and contribute on Github!
The interactive HTML trinket is soulmates with Mozilla Thimble, which is another awesome project that you can contribute to on Github.
Contributions to these tools are welcome. Contact us or open an issue to discuss what you want to do.
Released under the MIT License. (C) 2014-2016 Ben Wheeler and Trinket. See LICENSE for details.