Skip to content
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
92 changes: 56 additions & 36 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
SRC = HERE.parent / "src"
sys.path.insert(0, str(SRC)) # update docs from icalendar source for livehtml

project = "icalendar"
this_year = datetime.date.today().year # noqa: DTZ011
copyright = f"{this_year}, Plone Foundation" # noqa: A001

extensions = [
"notfound.extension",
"sphinx.ext.apidoc",
Expand All @@ -28,18 +32,8 @@
source_suffix = {".rst": "restructuredtext"}
master_doc = "index"

project = "icalendar"
this_year = datetime.date.today().year # noqa: DTZ011
copyright = f"{this_year}, Plone Foundation" # noqa: A001

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

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.

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

# Define the json_url for our version switcher.
json_url = "https://icalendar.readthedocs.io/en/latest/_static/version-switcher.json"

Expand All @@ -64,6 +58,17 @@
exclude_patterns = [
"reference/api/modules.rst",
]
html_context = {
"github_user": "PyCalendar",
"github_repo": "icalendar",
"github_version": "main",
"doc_path": "docs",
}
# Custom fa-custom/fa-pypi icon used in icon_links above.
html_js_files = [
("js/custom-icons.js", {"defer": "defer"}),
]
html_static_path = ["_static"]
html_theme = "pydata_sphinx_theme"
html_theme_options = {
"icon_links": [
Expand All @@ -72,22 +77,14 @@
"url": "https://github.com/PyCalendar/icalendar",
"icon": "fa-brands fa-square-github",
"type": "fontawesome",
"attributes": {
"target": "_blank",
"rel": "noopener me",
"class": "nav-link custom-fancy-css",
},
"attributes": {"target": "_blank", "rel": "noopener me"},
},
{
"name": "PyPI",
"url": "https://pypi.org/project/icalendar",
"icon": "fa-custom fa-pypi",
"type": "fontawesome",
"attributes": {
"target": "_blank",
"rel": "noopener me",
"class": "nav-link custom-fancy-css",
},
"attributes": {"target": "_blank", "rel": "noopener me"},
},
],
"footer_start": ["nlnet", "donate"],
Expand All @@ -107,21 +104,11 @@
},
"use_edit_page_button": True,
}
html_context = {
# "github_url": "https://github.com", # or your GitHub Enterprise site
"github_user": "PyCalendar",
"github_repo": "icalendar",
"github_version": "main",
"doc_path": "docs",
}
html_static_path = [
"_static",
]
html_js_files = [
("js/custom-icons.js", {"defer": "defer"}),
]
pygments_style = "sphinx"
smartquotes_action = "De"
# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]


# -- linkcheck builder configuration ----------------------------------
# Ignore localhost
Expand Down Expand Up @@ -162,9 +149,15 @@
# -- notfound.extension configuration ----------------------------------
# https://sphinx-notfound-page.readthedocs.io/en/latest/configuration.html
notfound_template = "404.html"
# Defaults to READTHEDOCS_CANONICAL_URL's path on RTD. Outside RTD, that env
# var isn't set and the extension falls back to a hardcoded "/en/latest/",
# which 404s every asset on a local build. Use root-relative paths instead
# when not building on RTD.
if not os.environ.get("READTHEDOCS"):
notfound_urls_prefix = "/"


# -- sphinx.ext.apidoc options -------------------------------------------------
# -- sphinx.ext.apidoc configuration -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/extensions/apidoc.html#
apidoc_modules = [
{
Expand All @@ -183,10 +176,11 @@
},
}
]
autoclass_content = "both"

# -- sphinx.ext.autodoc options -------------------------------------------------

# -- sphinx.ext.autodoc configuration ------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html
autoclass_content = "both"
autodoc_default_options = {
"ignore-module-all": True,
"no-inherited-members": "object,CaselessDict,str,bool,NamedTuple,int,float,Enum",
Expand Down Expand Up @@ -229,6 +223,12 @@
# -- sphinx_issues configuration ----------------------------------
issues_github_path = "PyCalendar/icalendar"

# -- sphinx_llms_txt builder configuration ----------------------------------
llms_txt_exclude = [
"search", # Exclude the search page
"genindex", # Exclude the index page
]


# -- sphinx_reredirects configuration ----------------------------------
# https://documatt.com/sphinx-reredirects/usage.html
Expand All @@ -246,6 +246,26 @@
"usage": "how-to/usage.html",
}

# -- sphinxext.opengraph configuration -----------------------------------------
html_baseurl = os.environ.get(
"READTHEDOCS_CANONICAL_URL", "https://icalendar.readthedocs.io/en/stable/"
)

ogp_site_url = html_baseurl
ogp_site_name = "icalendar"
ogp_description_length = 200
ogp_type = "website"
ogp_social_cards = {
"image": "_static/img/pycal-icon.png",
"image_mini": "_static/img/pycal-icon.png",
"line_color": "#0f766e",
"background_color": "#f8f7f4",
}


# -- man pages output ----------------------------------------------------------
man_pages = [("index", "icalendar", "icalendar Documentation", ["Plone Foundation"], 1)]


# -- HTML help output ----------------------------------------------------------
htmlhelp_basename = "icalendardoc"
1 change: 1 addition & 0 deletions news/+llms-txt.documentation
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added configuration for Sphinx extension :program:`sphinx-llms-txt` to exclude automatically generated files for the documentation. @stevepiercy