Skip to content

Commit b2fc6db

Browse files
committed
Add function to toggle TryExamples buttons from console
1 parent 0fec48d commit b2fc6db

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

jupyterlite_sphinx/jupyterlite_sphinx.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,15 @@ window.loadTryExamplesConfig = async (ignoreFilePath) => {
118118
console.error(error);
119119
}
120120
};
121+
122+
123+
window.toggleTryExamplesButtons = () => {
124+
/* Toggle visibility of TryExamples buttons. For use in console for debug
125+
* purposes. */
126+
var buttons = document.getElementsByClassName('try_examples_button');
127+
128+
for (var i = 0; i < buttons.length; i++) {
129+
buttons[i].classList.toggle('hidden');
130+
}
131+
132+
};

0 commit comments

Comments
 (0)