Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rtd config #410

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.12"
jobs:
pre_build:
- cd docs && make actionlinks

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/conf.py

# Optionally build your docs in additional formats such as PDF and ePub
# formats:
# - pdf
# - epub

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: docs/requirements.txt
15 changes: 3 additions & 12 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,7 @@
import re
import sys

# on_rtd is whether we are on readthedocs.org, this line of code grabbed from docs.readthedocs.org
on_rtd = os.environ.get("READTHEDOCS", None) == "True"

if not on_rtd: # only import and set the theme if we're building docs locally
import sphinx_rtd_theme

html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
html_theme = "sphinx_rtd_theme"

# sys.path.insert(0, os.path.join('ztpserver', 'lib'))
# sys.path.insert(0, os.path.join('ztpserver'))
Expand All @@ -34,7 +27,6 @@
sys.path.insert(0, os.path.join("client"))
sys.path.insert(0, os.path.abspath(".."))


# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
Expand Down Expand Up @@ -69,7 +61,7 @@

# General information about the project.
project = "ZTPServer"
copyright = "2015, Arista Networks" # pylint: disable=W0622
copyright = "2024, Arista Networks" # pylint: disable=W0622

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand All @@ -82,7 +74,7 @@

release = open("../VERSION").read().split()[0].strip()
# Assume PEP 440 version strings
p = re.compile("(\d+!)?((\d+)(.\d+)*(.\d+)*)(.?[a|b|rc]\d*)?(.post\d*)?(.dev\d*)?", re.IGNORECASE)
p = re.compile(r"(\d+!)?((\d+)(.\d+)*(.\d+)*)(.?(a|b|rc)\d*)?(.post\d*)?(.dev\d*)?", re.IGNORECASE)
vers = p.search(release)
version = vers.group(2)

Expand Down Expand Up @@ -207,7 +199,6 @@
# Output file base name for HTML help builder.
htmlhelp_basename = "ZTPServerdoc"


# -- Options for LaTeX output --------------------------------------------------

latex_elements = {
Expand Down