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

Fix Sphinx bugs to enable readthedocs #147

Merged
merged 2 commits into from
Jan 7, 2025
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
13 changes: 9 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Configuration file for the Sphinx documentation builder.
# This script is only used for Ianvs documents maintainer,
# This script is only used for Ianvs documents maintainers,
# who can use this script to configure the page display effect.
# It can be ignored for Ianvs User and Developer.
# It can be ignored for Ianvs Users and Developers.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
Expand All @@ -19,12 +19,16 @@
import subprocess
import sys

import sphinx_rtd_theme


try:
import m2r2
except ModuleNotFoundError:
subprocess.check_call([sys.executable, "-m", "pip", "install", "m2r2"])
try:
import sphinx_rtd_theme
except ModuleNotFoundError:
subprocess.check_call([sys.executable, "-m", "pip", "install", "sphinx_rtd_theme"])
_base_path = os.path.abspath('..')
BASE_URL = 'https://github.com/kubeedge/ianvs/'

Expand Down Expand Up @@ -63,6 +67,7 @@
# ones.
extensions = [
"m2r2",
'sphinx_rtd_theme',
"sphinx.ext.autodoc",
"sphinx.ext.todo",
"sphinx.ext.coverage",
Expand Down Expand Up @@ -91,7 +96,7 @@
html_static_path = ['_static']

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

import sphinx_rtd_theme
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
Expand Down
35 changes: 35 additions & 0 deletions docs/readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Read the Docs configuration file for Sphinx projects
# 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.6"
# You can also specify other tool versions:
# nodejs: "20"
# rust: "1.70"
# golang: "1.20"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/conf.py
# You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs
# builder: "dirhtml"
# Fail on all warnings to avoid broken references
# fail_on_warning: true

# 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
Loading