LoginSignup
0
0

More than 3 years have passed since last update.

How to print Qiita and Zhihu document

Last updated at Posted at 2020-02-13

Run the code in your browser console.

Not print link URL

@media print {
  a[href]:after {
    content: none !important;
  }
}

Windows: Ctrl+Shift+I

Mac: Cmd+Opt+I

/* for Qiita */

function remove_ele(selector){
  try {
    $(selector).remove();
  }catch(error) {}
}


$('body').append($('.p-items_article'))

do {
  var e=$('body>*');
  if(e.className.indexOf('p-items_article')==-1){
    e.remove();
  }else{
    e.OK = 1;
  }
} while (e.OK != 1)

remove_ele('.u-flex-center-between');
remove_ele('.ai-Container');
remove_ele('.it-Footer');
remove_ele('.it-DeprecationAlert_one');

window.print();
/* for Jianshu */
$('body').innerHTML = $('.ouvJEz').innerHTML
$('.rEsl9f').remove();
$('._1kCBjS').remove();
$('._19DgIp').remove();
$('._13lIbp').remove();
$('.d0hShY').remove();
window.print();
/* for Zhihu */

function remove_ele(selector){
  try {
    $(selector).remove();
  }catch(error) {}
}


$('body').append($('article.Post-Main'))

do {
  var e=$('body>*');
  if(e.className.indexOf('Post-Main')==-1){
    e.remove();
  }else{
    e.OK = 1;
  }
} while (e.OK != 1)

remove_ele('.Sticky');
remove_ele('.Post-topicsAndReviewer');
remove_ele('.Post-Author');

window.print();
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0