mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-06 13:26:23 +00:00
[docs] provide means to have collapsible code blocks without adding a new theme
This commit is contained in:
17
docs/_static/custom_collapsible_code.css
vendored
Normal file
17
docs/_static/custom_collapsible_code.css
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
.toggle {
|
||||
padding-bottom: 1em ;
|
||||
}
|
||||
|
||||
.toggle .header {
|
||||
display: block;
|
||||
clear: both;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.toggle .header:after {
|
||||
content: " ▼";
|
||||
}
|
||||
|
||||
.toggle .header.open:after {
|
||||
content: " ▲";
|
||||
}
|
||||
10
docs/_static/custom_collapsible_code.js
vendored
Normal file
10
docs/_static/custom_collapsible_code.js
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
let makeCodeBlocksCollapsible = function() {
|
||||
$(".toggle > *").hide();
|
||||
$(".toggle .header").show();
|
||||
$(".toggle .header").click(function() {
|
||||
$(this).parent().children().not(".header").toggle({"duration": 400});
|
||||
$(this).parent().children(".header").toggleClass("open");
|
||||
});
|
||||
};
|
||||
// we could use the }(); way if we would have access to jQuery in HEAD, i.e. we would need to force the theme
|
||||
// to load jQuery before our custom scripts
|
||||
Reference in New Issue
Block a user