Use pathlib in examples

This commit is contained in:
Adam Turner
2024-11-03 03:14:57 +00:00
parent 1094556afb
commit a6559d496b
2 changed files with 5 additions and 5 deletions

View File

@@ -203,10 +203,10 @@ using the :meth:`~sphinx.application.Sphinx.add_html_theme` API:
.. code-block:: python
# your_theme_package.py
from os import path
from pathlib import Path
def setup(app):
app.add_html_theme('name_of_theme', path.abspath(path.dirname(__file__)))
app.add_html_theme('name_of_theme', Path(__file__).resolve().parent)
If your theme package contains two or more themes, please call
``add_html_theme()`` twice or more.