summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-07-27 15:22:18 +0200
committerGitHub <noreply@github.com>2022-07-27 15:22:18 +0200
commit23f385b1f6f88680bb54121e3215d6ee1a943d87 (patch)
tree05f766ab963479522a787bdc7f1db0833e836f51 /doc
parentcc5135959b8d7956e93c566916352f5818f008f1 (diff)
parentf66527ddc39dc5e0c0d04cc4d84d92687fb7205f (diff)
Merge pull request #63530 from akien-mga/doc-makerst-relpath
Diffstat (limited to 'doc')
-rwxr-xr-xdoc/tools/make_rst.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/doc/tools/make_rst.py b/doc/tools/make_rst.py
index a56e4b338e..2aa4cb8ec1 100755
--- a/doc/tools/make_rst.py
+++ b/doc/tools/make_rst.py
@@ -11,8 +11,8 @@ import xml.etree.ElementTree as ET
from collections import OrderedDict
# Import hardcoded version information from version.py
-script_directory = os.path.dirname(os.path.abspath(__file__))
-sys.path.append(os.path.join(script_directory, "../../")) # Include the root directory
+root_directory = os.path.join(os.path.dirname(os.path.abspath(__file__)), "../../")
+sys.path.append(root_directory) # Include the root directory
import version
# Uncomment to do type checks. I have it commented out so it works below Python 3.5
@@ -602,7 +602,7 @@ def make_rst_class(class_def, state, dry_run, output_dir): # type: (ClassDef, S
if hasattr(version, "docs") and version.docs != "latest":
git_branch = version.docs
- source_xml_path = os.path.normpath(os.path.join("doc", class_def.filepath)).replace("\\", "/")
+ source_xml_path = os.path.relpath(class_def.filepath, root_directory).replace("\\", "/")
source_github_url = "https://github.com/godotengine/godot/tree/{}/{}".format(git_branch, source_xml_path)
generator_github_url = "https://github.com/godotengine/godot/tree/{}/doc/tools/make_rst.py".format(git_branch)