From 5eab88d0235ca76f37b7208b60fdd7479792aacb Mon Sep 17 00:00:00 2001 From: mariugul Date: Tue, 10 Sep 2024 23:48:42 +0200 Subject: [PATCH] docs: setup readthedocs Configured readthedocs for the project. --- .readthedocs.yaml | 31 +++++++++++++++++++++++++++++++ docs/Makefile | 20 ++++++++++++++++++++ docs/source/conf.py | 36 ++++++++++++++++++++++++++++++++++++ docs/source/index.rst | 16 ++++++++++++++++ pyproject.toml | 7 +++++++ 5 files changed, 110 insertions(+) create mode 100644 .readthedocs.yaml create mode 100644 docs/Makefile create mode 100644 docs/source/conf.py create mode 100644 docs/source/index.rst diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 0000000..5f42170 --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,31 @@ +# .readthedocs.yaml +# Read the Docs configuration file +# 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-lts-latest + tools: + python: "3.12" + jobs: + post_create_environment: + - pip install poetry + post_install: + # VIRTUAL_ENV needs to be set manually for now. + - VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry install --with docs + +# Build documentation in the "docs/" directory with Sphinx +sphinx: + builder: html + configuration: docs/source/conf.py + +# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html +# Use Poetry for managing dependencies +# python: +# install: +# - method: poetry +# path: . +# - requirements: docs/requirements.txt \ No newline at end of file diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..d0c3cbf --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = source +BUILDDIR = build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/source/conf.py b/docs/source/conf.py new file mode 100644 index 0000000..1f94ad4 --- /dev/null +++ b/docs/source/conf.py @@ -0,0 +1,36 @@ +# Configuration file for the Sphinx documentation builder. +# +# For the full list of built-in configuration values, see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Project information ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information + +project = "comeit" +copyright = "2024, Marius C. K. Gulbrandsen" +author = "Marius C. K. Gulbrandsen" +release = "0.2.0" + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = [ + "myst_parser", + "sphinx_copybutton", + "sphinx.ext.autosectionlabel", + "sphinx.ext.napoleon", +] +source_suffix = { + ".rst": "restructuredtext", + ".md": "markdown", +} + +templates_path = ["_templates"] +exclude_patterns = [] + + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_theme = "sphinx_rtd_theme" +html_static_path = ["_static"] diff --git a/docs/source/index.rst b/docs/source/index.rst new file mode 100644 index 0000000..3aa0dbf --- /dev/null +++ b/docs/source/index.rst @@ -0,0 +1,16 @@ +.. comeit documentation master file, created by + sphinx-quickstart on Wed Sep 11 21:40:17 2024. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +comeit documentation +==================== + +Add your content using ``reStructuredText`` syntax. See the +`reStructuredText `_ +documentation for details. + + +.. toctree:: + :maxdepth: 2 + :caption: Contents: diff --git a/pyproject.toml b/pyproject.toml index a4a4fbc..f135f72 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,6 +23,13 @@ ruff = "0.6.1" isort = "^5.13.2" black = "^24.8.0" +[tool.poetry.group.docs.dependencies] +sphinx = "^7.0.0" +sphinx-rtd-theme = "^2.0.0" +sphinx-autobuild = "^2024.4.16" +sphinx-copybutton = "^0.5.2" +myst-parser = "^4.0.0" + [tool.black] line-length = 100 target-version = ["py310"]