Last active
March 10, 2023 10:28
-
-
Save socheatsok78/1cecbb97919d7375e5f9560d26fc02e0 to your computer and use it in GitHub Desktop.
Print GitHub Markdown Document
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Print GitHub Markdown Document | |
// Copy following scripts in the developer console of page included markdown content you want to print and run "printMarkdown("#readmy") | |
function printMarkdown(selector) { | |
var $ = document.querySelector.bind(document); | |
$(selector).setAttribute('style', 'position:absolute;top:0;left:0;right:0;bottom:0;z-index:100;background-color:white'); | |
$(selector + '>article').setAttribute('style', 'border: none'); | |
$('body').innerHTML = $(selector).outerHTML; | |
window.print(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment