File tree Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Original file line number Diff line number Diff line change 25
25
margin : 0.5in 0.1in 0.5in 0.1in ; /* Adjust margins for header/footer space */
26
26
}
27
27
28
+
29
+ /* Hide the print button when printing */
30
+ .print-button {
31
+ display : none;
32
+ }
28
33
}
Original file line number Diff line number Diff line change
1
+ document . addEventListener ( 'DOMContentLoaded' , function ( ) {
2
+ const header = document . querySelector ( 'main h1' ) ; // Insert below the main title
3
+ if ( header ) {
4
+ const printButton = document . createElement ( 'button' ) ;
5
+ printButton . textContent = '🖨️ Print this page' ;
6
+ printButton . className = 'print-button' ;
7
+ printButton . addEventListener ( 'click' , function ( ) {
8
+ window . print ( ) ;
9
+ } ) ;
10
+ header . after ( printButton ) ; // Add the button after the title
11
+ }
12
+ } ) ;
Original file line number Diff line number Diff line change @@ -96,6 +96,8 @@ markdown_extensions:
96
96
- pymdownx.superfences
97
97
extra_css :
98
98
- css/custom.css
99
+ extra_javascript :
100
+ - js/extra.js
99
101
copyright : >
100
102
Copyright © 2024 Nomana-IT –
101
103
<a href="#__consent">Change cookie settings</a>
You can’t perform that action at this time.
0 commit comments