Skip to content

Commit

Permalink
conf.py should always open files relative to script
Browse files Browse the repository at this point in the history
Fixes tests importing this script from other places
  • Loading branch information
HexDecimal committed Feb 20, 2024
1 parent 63e98d9 commit 336aa0a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/conf.py
Expand Up @@ -25,6 +25,8 @@

sys.path.insert(0, str(Path("..").resolve(strict=True)))

THIS_DIR = Path(__file__).parent

# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
Expand Down Expand Up @@ -378,8 +380,8 @@
napoleon_use_param = True
napoleon_use_rtype = True

rst_prolog = Path("prolog.rst").read_text(encoding="utf-8") # Added to the beginning of every source file.
rst_epilog = Path("epilog.rst").read_text(encoding="utf-8") # Added to the end of every source file.
rst_prolog = (THIS_DIR / "prolog.rst").read_text(encoding="utf-8") # Added to the beginning of every source file.
rst_epilog = (THIS_DIR / "epilog.rst").read_text(encoding="utf-8") # Added to the end of every source file.

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {
Expand Down

0 comments on commit 336aa0a

Please sign in to comment.