Jelajahi Sumber

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>`
Matt Gajownik 3 tahun lalu
induk
melakukan
60e94a2899
1 mengubah file dengan 6 tambahan dan 1 penghapusan
  1. 6 1
      docs/sphinx/conf.py

+ 6 - 1
docs/sphinx/conf.py

@@ -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