Fix test failures introduced by PR #113697 (#116941)
[llvm-project.git] / clang / docs / ghlinks.py
blobbad0f9fbf0adbcb621ffa36e4c8d604c9de27a3b
1 #!/usr/bin/env python3
3 from sphinx.application import Sphinx
4 import re
6 __version__ = "1.0"
9 def subst_gh_links(app: Sphinx, docname, source):
10 regex = re.compile("#GH([0-9]+)")
11 out_pattern = r"`#\1 <https://github.com/llvm/llvm-project/issues/\1>`_"
12 result = source[0]
13 result = regex.sub(out_pattern, result)
14 source[0] = result
17 def setup(app: Sphinx):
18 app.connect("source-read", subst_gh_links)
19 return dict(version=__version__, parallel_read_safe=True, parallel_write_safe=True)