feat: add admonitions

This commit is contained in:
rxchi1d
2025-12-21 16:40:25 +08:00
committed by ZhenShuo Leo
parent 1fc6058426
commit 775d5b1bbf
18 changed files with 664 additions and 5 deletions

View File

@@ -0,0 +1,17 @@
(function() {
'use strict';
var closedDetails = [];
window.addEventListener('beforeprint', function() {
var allDetails = document.querySelectorAll('details:not([open])');
for (var i = 0; i < allDetails.length; i++) {
allDetails[i].open = true;
closedDetails.push(allDetails[i]);
}
});
window.addEventListener('afterprint', function() {
for (var i = 0; i < closedDetails.length; i++) {
closedDetails[i].open = false;
}
closedDetails = [];
});
})();