mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-29 18:46:06 +00:00
20 lines
511 B
Python
20 lines
511 B
Python
![]() |
#!/usr/bin/env python3
|
||
|
|
||
|
from sphinx.application import Sphinx
|
||
|
import re
|
||
|
|
||
|
__version__ = "1.0"
|
||
|
|
||
|
|
||
|
def subst_gh_links(app: Sphinx, docname, source):
|
||
|
regex = re.compile("#GH([0-9]+)")
|
||
|
out_pattern = r"`#\1 <https://github.com/llvm/llvm-project/issues/\1>`_"
|
||
|
result = source[0]
|
||
|
result = regex.sub(out_pattern, result)
|
||
|
source[0] = result
|
||
|
|
||
|
|
||
|
def setup(app: Sphinx):
|
||
|
app.connect("source-read", subst_gh_links)
|
||
|
return dict(version=__version__, parallel_read_safe=True, parallel_write_safe=True)
|