From cd48e13fb1f331dfd494a9b749bfadb8f75028e6 Mon Sep 17 00:00:00 2001 From: Tiago Nobrega Date: Thu, 25 Apr 2024 20:44:38 -0300 Subject: [PATCH] docs: use canonical-sphinx (#209) --- docs/conf.py | 76 +++++++++++++++++++++++++++++--------------------- pyproject.toml | 5 +--- 2 files changed, 45 insertions(+), 36 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index eeb0257..d3f052d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,47 +1,59 @@ -# Configuration file for the Sphinx documentation builder. +# This file is part of starbase. # -# For the full list of built-in configuration values, see the documentation: -# https://www.sphinx-doc.org/en/master/usage/configuration.html +# Copyright 2024 Canonical Ltd. +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 3, as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranties of MERCHANTABILITY, +# SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . -# -- Project information ----------------------------------------------------- -# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information +import datetime -project = "starcraft" -copyright = "2023, Canonical" +project = "Starbase" author = "Canonical" -# region General configuration -# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration +copyright = "2023-%s, %s" % (datetime.date.today().year, author) + +# region Configuration for canonical-sphinx +ogp_site_url = "https://canonical-starbase.readthedocs-hosted.com/" +ogp_site_name = project +ogp_image = "https://assets.ubuntu.com/v1/253da317-image-document-ubuntudocs.svg" + +html_context = { + "product_page": "github.com/canonical/starbase", + "github_url": "https://github.com/canonical/starbase", +} extensions = [ - "sphinx.ext.intersphinx", - "sphinx.ext.viewcode", - "sphinx.ext.coverage", - "sphinx.ext.doctest", - "sphinx_design", - "sphinx_copybutton", - "sphinx-pydantic", - "sphinx_toolbox", - "sphinx_toolbox.more_autodoc", - "sphinx.ext.autodoc", # Must be loaded after more_autodoc + "canonical_sphinx", ] +# endregion -templates_path = ["_templates"] -exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] +# region General configuration +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration -show_authors = False +extensions.extend( + [ + "sphinx.ext.intersphinx", + "sphinx.ext.viewcode", + "sphinx.ext.coverage", + "sphinx.ext.doctest", + "sphinx-pydantic", + "sphinx_toolbox", + "sphinx_toolbox.more_autodoc", + "sphinx.ext.autodoc", # Must be loaded after more_autodoc + ] +) # endregion -# region Options for HTML output -# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output -html_theme = "furo" -html_static_path = ["_static"] -html_css_files = [ - "css/custom.css", -] - -# endregion # region Options for extensions # Intersphinx extension # https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html#configuration @@ -57,6 +69,6 @@ # Github config github_username = "canonical" -github_repository = "starcraft-base" +github_repository = "starbase" # endregion diff --git a/pyproject.toml b/pyproject.toml index 3c68f60..449813c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,11 +33,8 @@ types = [ "pyright==1.1.359", ] docs = [ - "furo==2024.1.29", - "sphinx~=7.1", + "canonical-sphinx~=0.1", "sphinx-autobuild~=2024.2", - "sphinx-copybutton==0.5.2", - "sphinx-design==0.5.0", "sphinx-pydantic==0.1.1", "sphinx-toolbox~=3.5", "sphinx-lint==0.9.1",