diff options
| author | Dan McDonald <danmcd@joyent.com> | 2022-04-12 12:16:39 -0400 |
|---|---|---|
| committer | Dan McDonald <danmcd@joyent.com> | 2022-04-12 12:16:39 -0400 |
| commit | ff6e09a70764926bb336e3b767bc1a2e0c86ae9d (patch) | |
| tree | 03e85ebd4e8e374989cc7442ae1ab1b505d06f9c /sort-xrefs.py | |
| parent | 79b3281baf5e5b2ad91859a9b57f45ef46016af4 (diff) | |
| download | illumos-joyent-ff6e09a70764926bb336e3b767bc1a2e0c86ae9d.tar.gz | |
OS-8375 Cleanup on aisle IPD 4
Diffstat (limited to 'sort-xrefs.py')
| -rwxr-xr-x | sort-xrefs.py | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/sort-xrefs.py b/sort-xrefs.py deleted file mode 100755 index f9c1f1fa90..0000000000 --- a/sort-xrefs.py +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env python3 - -import re -import sys - -# group 0: The whole shebang -# group 1 or group 2: The page name (sans fonts, if any) -# group 3: The section -REFERENCE = re.compile(r'(?:\\fB([a-zA-Z0-9_.-]+)\\fR|([a-zA-Z0-9_.-]+))\(([0-9][A-Za-z]*)\)') -def match_section(match): - return match.group(3).upper() - -def match_page(match): - return match.group(1) or match.group(2) - -def sort_key(line): - match = REFERENCE.match(line) # If this fails we're hosed - assert(match) - return [match_section(match), match_page(match)] - - -lines = [f.rstrip(',\n') for f in sys.stdin] -lines.sort(key=sort_key) -print(',\n'.join(lines)) |
