WeScheme
WeScheme copied to clipboard
request: print whole page
Request from a Stack Overflow user: provide ability to print source code. http://stackoverflow.com/questions/9346711/how-to-print-wescheme-programs
This is tricky, since CodeMirror never actually renders the entire program (if it did, we could just change the CSS).We'll have to detect print events programmatically.
There's a cross-browser javascript solution for detecting printEvents here: http://tjvantoll.com/2012/06/15/detecting-print-requests-with-javascript/
All we need to do is add a
node, and fill it with the program contents. Then we can use CSS to make sure that the only thing ever printed is div#print.