from importlib.metadata import version as pkg_version

# Sphinx extensions
extensions = [
    "sphinx.ext.autodoc",
    "sphinx.ext.viewcode",
    "sphinx.ext.napoleon",
    "sphinx.ext.intersphinx",
    "sphinxarg.ext",
]

intersphinx_mapping = {
    "numpy": ("https://numpy.org/doc/stable/", None),
    "pandas": ("https://pandas.pydata.org/docs/", None),
    "proj": ("https://proj.org/", None),
    "python": ("https://docs.python.org/3", None),
    "shapely": ("https://shapely.readthedocs.io/en/stable/", None),
    "xarray": ("https://docs.xarray.dev/en/stable/", None),
}

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = ".rst"

# The master toctree document.
master_doc = "index"

# General information about the project.
project = "pyproj"
copyright = "2006-2018, Jeffrey Whitaker; 2019-2022, Open source contributors"
author = "Jeffrey Whitaker"

version = release = pkg_version("pyproj")

exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "**.ipynb_checkpoints"]

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = "material"

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False


# -- Options for HTML output -------------------------------------------

# The theme to use for HTML and HTML Help pages.  See the documentation for
# a list of builtin themes.
#
html_theme = "furo"
html_logo = "media/logo.png"
html_favicon = "media/icon.png"

# Add any paths that contain custom static files (such as style sheets) here,
# html_static_path = ["_static"]


# -- Options for manual page output ------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [("cli", "pyproj", "pyproj CLI", [author], 1)]

@@ -1,8 +1,10 @@
-from
+import
  imp
@@ -22,38 +22,18 @@
 data
- 
+%0A
 import 
-version as pkg_version
+os
 %0A%0A# 
@@ -1061,12 +1061,27 @@
 e = 
-pkg_
+importlib.metadata.
 vers
@@ -1569,15 +1569,47 @@
 me =
+ os.getenv(%22PYPROJ_HTML_THEME%22,
  %22furo%22
+)
 %0Ahtm

Add PYPROJ_HTML_THEME environment variable (#1139)