Skip to content

Instantly share code, notes, and snippets.

@angusdev
Created July 1, 2024 00:47
Show Gist options
  • Save angusdev/8724a1cb2dc23bfce508d15722ebaa4e to your computer and use it in GitHub Desktop.
Save angusdev/8724a1cb2dc23bfce508d15722ebaa4e to your computer and use it in GitHub Desktop.
Make a printable version of tennis draw in Wiki
e=document.querySelector('h3:has(#Top_half)');while(e.previousSibling)e.parentNode.removeChild(e.previousSibling);
e=document.querySelector('#bodyContent');while(e.previousSibling)e.parentNode.removeChild(e.previousSibling);
e=document.querySelector('.mw-page-container');while(e.previousSibling)e.parentNode.removeChild(e.previousSibling);
e=document.querySelector('#mw-content-text');while(e.previousSibling)e.parentNode.removeChild(e.previousSibling);
e=document.querySelector('.mw-content-container');while(e.previousSibling)e.parentNode.removeChild(e.previousSibling);
e=document.querySelector('h2:has(#Seeded_players)').previousSibling;while(e.nextSibling)e.parentNode.removeChild(e.nextSibling);
document.querySelectorAll('.mw-editsection,#catlinks,.mw-footer-container,.vector-settings').forEach(e=>e.parentNode.removeChild(e));
document.querySelectorAll('h4:has(#Section_3),h3:has(#Bottom_half),h4:has(#Section_7)').forEach(e=>e.style.pageBreakBefore='always');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment