mirror of https://github.com/ansible/ansible.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
426 B
Python
16 lines
426 B
Python
2 years ago
|
"""Unwrap URLs to docs.ansible.com and remove version"""
|
||
|
|
||
|
import re
|
||
|
import sys
|
||
|
|
||
|
|
||
|
def main():
|
||
|
data = sys.stdin.read()
|
||
|
data = re.sub('(https://docs\\.ansible\\.com/[^ ]+)\n +([^ ]+)\n', '\\1\\2\n', data, flags=re.MULTILINE)
|
||
|
data = re.sub('https://docs\\.ansible\\.com/ansible(|-core)/(?:[^/]+)/', 'https://docs.ansible.com/ansible\\1/devel/', data)
|
||
|
sys.stdout.write(data)
|
||
|
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
main()
|