2022-08-01 12:40:26 +02:00
|
|
|
|
import datetime
|
2016-10-19 11:21:42 -06:00
|
|
|
|
import os
|
|
|
|
|
|
import sys
|
|
|
|
|
|
|
2023-10-28 17:43:16 +02:00
|
|
|
|
if sys.version_info >= (3, 11):
|
|
|
|
|
|
import tomllib
|
|
|
|
|
|
else:
|
|
|
|
|
|
import tomli as tomllib
|
|
|
|
|
|
|
2010-10-13 23:08:08 +01:00
|
|
|
|
|
2013-03-11 08:25:47 -04:00
|
|
|
|
sys.path.append(os.path.abspath(os.pardir))
|
2012-03-15 00:23:07 +00:00
|
|
|
|
|
2023-10-28 17:43:16 +02:00
|
|
|
|
|
|
|
|
|
|
with open("../pyproject.toml", "rb") as f:
|
|
|
|
|
|
project_data = tomllib.load(f).get("project")
|
|
|
|
|
|
if project_data is None:
|
|
|
|
|
|
raise KeyError("project data is not found")
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-10-19 11:21:42 -06:00
|
|
|
|
# -- General configuration ----------------------------------------------------
|
2023-10-28 17:43:16 +02:00
|
|
|
|
templates_path = ["_templates"]
|
2023-10-13 08:01:29 +02:00
|
|
|
|
extensions = [
|
|
|
|
|
|
"sphinx.ext.autodoc",
|
|
|
|
|
|
"sphinx.ext.extlinks",
|
|
|
|
|
|
"sphinxext.opengraph",
|
|
|
|
|
|
]
|
2023-10-28 17:43:16 +02:00
|
|
|
|
source_suffix = ".rst"
|
|
|
|
|
|
master_doc = "index"
|
|
|
|
|
|
project = project_data.get("name").upper()
|
2022-08-01 12:40:26 +02:00
|
|
|
|
year = datetime.datetime.now().date().year
|
2024-05-31 10:41:24 -05:00
|
|
|
|
copyright = f"2010–{year}" # noqa: RUF001
|
2023-10-28 17:43:16 +02:00
|
|
|
|
exclude_patterns = ["_build"]
|
|
|
|
|
|
release = project_data.get("version")
|
|
|
|
|
|
version = ".".join(release.split(".")[:1])
|
|
|
|
|
|
last_stable = project_data.get("version")
|
|
|
|
|
|
rst_prolog = f"""
|
|
|
|
|
|
.. |last_stable| replace:: :pelican-doc:`{last_stable}`
|
|
|
|
|
|
.. |min_python| replace:: {project_data.get('requires-python').split(",")[0]}
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
|
extlinks = {"pelican-doc": ("https://docs.getpelican.com/en/latest/%s.html", "%s")}
|
2010-10-13 23:08:08 +01:00
|
|
|
|
|
2016-10-19 11:21:42 -06:00
|
|
|
|
# -- Options for HTML output --------------------------------------------------
|
2010-10-13 23:08:08 +01:00
|
|
|
|
|
2023-10-28 17:43:16 +02:00
|
|
|
|
html_theme = "furo"
|
|
|
|
|
|
html_title = f"<strong>{project}</strong> <i>{release}</i>"
|
|
|
|
|
|
html_static_path = ["_static"]
|
2022-01-04 18:34:35 +01:00
|
|
|
|
html_theme_options = {
|
2023-10-28 17:43:16 +02:00
|
|
|
|
"light_logo": "pelican-logo.svg",
|
|
|
|
|
|
"dark_logo": "pelican-logo.svg",
|
|
|
|
|
|
"navigation_with_keys": True,
|
2022-01-04 18:34:35 +01:00
|
|
|
|
}
|
2010-10-13 23:08:08 +01:00
|
|
|
|
|
|
|
|
|
|
# Output file base name for HTML help builder.
|
2023-10-28 17:43:16 +02:00
|
|
|
|
htmlhelp_basename = "Pelicandoc"
|
2010-10-13 23:08:08 +01:00
|
|
|
|
|
2014-03-31 14:28:46 +05:30
|
|
|
|
html_use_smartypants = True
|
|
|
|
|
|
|
|
|
|
|
|
# If false, no module index is generated.
|
|
|
|
|
|
html_use_modindex = False
|
|
|
|
|
|
|
|
|
|
|
|
# If false, no index is generated.
|
|
|
|
|
|
html_use_index = False
|
|
|
|
|
|
|
|
|
|
|
|
# If true, links to the reST sources are added to the pages.
|
|
|
|
|
|
html_show_sourcelink = False
|
|
|
|
|
|
|
2014-04-28 20:37:49 +02:00
|
|
|
|
|
|
|
|
|
|
def setup(app):
|
|
|
|
|
|
# overrides for wide tables in RTD theme
|
2023-10-28 17:43:16 +02:00
|
|
|
|
app.add_css_file("theme_overrides.css") # path relative to _static
|
2014-04-28 20:37:49 +02:00
|
|
|
|
|
|
|
|
|
|
|
2016-10-19 11:21:42 -06:00
|
|
|
|
# -- Options for LaTeX output -------------------------------------------------
|
2010-10-13 23:08:08 +01:00
|
|
|
|
latex_documents = [
|
2023-10-28 17:43:16 +02:00
|
|
|
|
("index", "Pelican.tex", "Pelican Documentation", "Justin Mayer", "manual"),
|
2010-10-13 23:08:08 +01:00
|
|
|
|
]
|
|
|
|
|
|
|
2016-10-19 11:21:42 -06:00
|
|
|
|
# -- Options for manual page output -------------------------------------------
|
2010-10-13 23:08:08 +01:00
|
|
|
|
man_pages = [
|
2023-10-28 17:43:16 +02:00
|
|
|
|
("index", "pelican", "pelican documentation", ["Justin Mayer"], 1),
|
|
|
|
|
|
(
|
|
|
|
|
|
"pelican-themes",
|
|
|
|
|
|
"pelican-themes",
|
|
|
|
|
|
"A theme manager for Pelican",
|
|
|
|
|
|
["Mickaël Raybaud"],
|
|
|
|
|
|
1,
|
|
|
|
|
|
),
|
|
|
|
|
|
(
|
|
|
|
|
|
"themes",
|
|
|
|
|
|
"pelican-theming",
|
|
|
|
|
|
"How to create themes for Pelican",
|
|
|
|
|
|
["The Pelican contributors"],
|
|
|
|
|
|
1,
|
|
|
|
|
|
),
|
2010-10-13 23:08:08 +01:00
|
|
|
|
]
|