Skip to content

Commit

Permalink
docs: setup readthedocs
Browse files Browse the repository at this point in the history
Configured readthedocs for the project.
  • Loading branch information
mariugul committed Sep 11, 2024
1 parent b674b81 commit 5eab88d
Show file tree
Hide file tree
Showing 5 changed files with 110 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -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
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -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)
36 changes: 36 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -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"]
16 changes: 16 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -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 <https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html>`_
documentation for details.


.. toctree::
:maxdepth: 2
:caption: Contents:
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down

0 comments on commit 5eab88d

Please sign in to comment.