Created
October 1, 2017 12:53
-
-
Save osvein/bd8701a1928743b8a8e0f376d5cf6c4e to your computer and use it in GitHub Desktop.
GreaseMonkey userscript to add some missing links from XBD header pages to XSU function pages in the online POSIX standard viewer
This file contains hidden or 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
| // ==UserScript== | |
| // @name posix-linker | |
| // @namespace https://github.com/osvein | |
| // @description adds some missing links from XBD header pages to XSU function pages in the online POSIX standard viewer | |
| // @include http://pubs.opengroup.org/onlinepubs/9699919799/ | |
| // @version 1 | |
| // @grant none | |
| // ==/UserScript== | |
| var frame = document.getElementById('main'); | |
| frame.addEventListener('load', function () { | |
| var re = /^https?:[/][/]pubs.opengroup.org[/]onlinepubs[/]9699919799[/]basedefs[/]\w+[.]h[.]html(#\w*)?$/; | |
| if (re.test(frame.contentWindow.location.href)) process(frame.contentDocument); | |
| }); | |
| function process(doc) { | |
| doc.querySelectorAll('pre > tt').forEach(function (node, index, list) { | |
| node.innerHTML = node.innerHTML.replace(/ ([*]?)(\w+)[(]/gm, ' $1<a href="../functions/$2.html">$2</a>('); | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment