Skip to content

Commit

Permalink
DOC: Add Google Analytics to READTHEDOCS documentation builds
Browse files Browse the repository at this point in the history
  • Loading branch information
scottclowe committed Feb 24, 2025
1 parent a175315 commit a5957ac
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ def setup(app):
"nbsphinx", # Execute .ipynb files to generate html
]

# Some extensions should only be run if we are on Read the Docs
if os.environ.get("READTHEDOCS") == "True":
extensions.append("sphinxcontrib.googleanalytics")

# Napoleon settings
napoleon_google_docstring = True
napoleon_numpy_docstring = True
Expand Down Expand Up @@ -324,3 +328,7 @@ def setup(app):

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

# -- Options for Google Analytics extension ----------------------------------

googleanalytics_id = "G-PXNCNN1G5C"
1 change: 1 addition & 0 deletions requirements-docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ sphinx; python_version<'3.6'
sphinx>=6.0.0; python_version>='3.6'
sphinx-autobuild
sphinx_rtd_theme; python_version<'3.6'
sphinxcontrib-googleanalytics>=0.4

0 comments on commit a5957ac

Please # to comment.