Skip to content

Instantly share code, notes, and snippets.

@girvan
Last active March 27, 2019 07:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save girvan/f2c1755abc7f5409eb3bd756611cb2e5 to your computer and use it in GitHub Desktop.
Save girvan/f2c1755abc7f5409eb3bd756611cb2e5 to your computer and use it in GitHub Desktop.
Exclude some file paths in git file changes
document.querySelectorAll("#toc li").forEach(function(li, idx){
if(li.innerText.indexOf('/SOME-PATH-YOU-WANT-TO-EXCLUDE/') === -1)
return;
var id = li.querySelector('a').href.split('#')[1];
var block = document.querySelector('a[name=' + id + ']').nextElementSibling;
block.parentNode.removeChild(block);
li.parentNode.removeChild(li);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment