Docs: fix sphinx error which can't find image path on windows

This commit is contained in:
neofelis2X
2025-01-29 11:43:40 +01:00
parent 783d683f1d
commit 0260250cea

View File

@@ -1163,7 +1163,9 @@ class Image(Node):
rel_path = os.path.normpath(static_path[rel_path_index:])
docstrings = '\n\n'
docstrings += '.. figure:: %s\n' % rel_path
# Sphinx (on windows) can't parse windows style paths when reading
# .rst files. Therefore paths are written unix style.
docstrings += '.. figure:: %s\n' % rel_path.replace('\\', '/')
docstrings += ' :align: center\n\n\n'
docstrings += '|\n\n'