diff --git a/docs/tools/mkdocs-material-theme/base.html b/docs/tools/mkdocs-material-theme/base.html index adbb17c27967e482fefb02abb7b8f28c59defa0c..849b096f06de271cc2c23632c346985e24f8f629 100644 --- a/docs/tools/mkdocs-material-theme/base.html +++ b/docs/tools/mkdocs-material-theme/base.html @@ -231,6 +231,20 @@ base: "{{ base_url }}" } }); + var beforePrint = function() { + var details = document.getElementsByTagName("details"); + for (var i = 0; i < details.length; ++i) { + details[i].open = 1; + } + }; + if (window.matchMedia) { + window.matchMedia('print').addListener(function(q) { + if (q.matches) { + beforePrint(); + } + }); + } + window.onbeforeprint = beforePrint; });