Last active
August 29, 2015 14:10
-
-
Save bidulock/779e831e6bf014ff9aaa to your computer and use it in GitHub Desktop.
Add shell colour codes to a web page - bookmarklet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function () { | |
var l = ['#000', '#A00', '#0A0', '#A50', '#00A', '#A0A', '#0AA', '#AAA']; | |
document.body.innerHTML = document.body.innerHTML.replace(/\u001b\[([0-9;]*)m/g, function (m, k) { | |
return k - 30 < 8 ? "<span style='color: " + l[k - 30] + "'>" : k == 39 ? "</span>" : "<span>"; | |
}); | |
document.body.style.backgroundColor = "#000"; | |
document.body.style.color = "#AAA"; | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A simple bookmarklet to make viewing log files generated as artifacts by jenkins nicer.