Skip to content

Commit

Permalink
docs: use canonical-sphinx (#209)
Browse files Browse the repository at this point in the history
  • Loading branch information
tigarmo authored Apr 25, 2024
1 parent 439dad6 commit cd48e13
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 36 deletions.
76 changes: 44 additions & 32 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.

# -- 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
Expand All @@ -57,6 +69,6 @@

# Github config
github_username = "canonical"
github_repository = "starcraft-base"
github_repository = "starbase"

# endregion
5 changes: 1 addition & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit cd48e13

Please sign in to comment.