Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.