docs/sphinx: Enable extlinks for shorthand URLs

Authors can use :wiki:`PageName` and :source:`libobs/obs.h` to link to
files/pages rather than providing full links. If custom test is needed,
wrap the path in additional <>.
Example:     :wiki:`Use the Wiki <Install-Instructions>`
master
Matt Gajownik 2022-06-05 13:18:09 +10:00 committed by Matt Gajownik
parent 9e22b6ad53
commit 60e94a2899
1 changed files with 6 additions and 1 deletions

View File

@ -38,6 +38,7 @@ extensions = [
"sphinx_rtd_theme",
"sphinxcontrib.napoleon",
"sphinx.ext.autosectionlabel",
"sphinx.ext.extlinks"
]
# Add any paths that contain templates here, relative to this directory.
@ -195,5 +196,9 @@ texinfo_documents = [
'Miscellaneous'),
]
extlinks = {
'source': ('https://github.com/OBSProject/obs-studio/blob/master/%s', '%s'),
'wiki': ('https://obsproject.com/wiki/%s', 'wiki/%s')
}
extlinks_detect_hardcoded_links = True