Skip to content

Instantly share code, notes, and snippets.

@kf6kjg
Created December 6, 2018 16:22
Show Gist options
  • Save kf6kjg/7f27c1d4beab58036c2e1facb540255c to your computer and use it in GitHub Desktop.
Save kf6kjg/7f27c1d4beab58036c2e1facb540255c to your computer and use it in GitHub Desktop.
Nice formatting of TXT files
// ==UserScript==
// @name Nice formatting of TXT files
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Format online text files in a clean and easy to read way without losing fixed width needs.
// @author Ricky Curtice
// @match *://*/*.txt
// @grant none
// ==/UserScript==
(function() {
'use strict';
// Your code here...
let el = document.querySelector("body > pre");
if (el) {
el.style.fontSize = "14pt";
el.style.marginLeft = "auto";
el.style.marginRight = "auto";
el.style.width = "44em";
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment