Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Print Git Books
/*
If you try to print a gitbook directly, you get nothing but the contents because of their *just* use of `@media print` styling to hide away the content section of the books.
Fret not, here is the codez:
*/
$(".book-header,.book-summary,.navigation,.book-progress").remove();
$(".book.with-summary .book-body").css('left', '0px');
$("*").css('position', 'static');
window.print()
/*
You still have to run this for each chapter page to save the chapter as pdf and club them together later(this is drag and drop on mac). You can further use calibre to convert to kindle or whatever you need.
Perhaps some one will go one step more to write a node.js utility to print git books.
But hey, do buy the books to support the authors.
*/
@codemilli

This comment has been minimized.

Copy link

@codemilli codemilli commented Jul 20, 2016

It does not work, maybe things have changed.

@andineck

This comment has been minimized.

Copy link

@andineck andineck commented Jul 20, 2016

worked like a charm :-)

@eimfach

This comment has been minimized.

Copy link

@eimfach eimfach commented Oct 1, 2016

Works for windows edge better than chrome (Windows 10)

@engwansong

This comment has been minimized.

Copy link

@engwansong engwansong commented Jul 1, 2019

Thanks! Still works for Firefox Quantum 67.0 (Mac), no longer working for Chrome 75.0.3770.100 (Mac)

@aabeben

This comment has been minimized.

Copy link

@aabeben aabeben commented Jul 16, 2019

Thanks! working in Opera
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment