From 53faadcc32d7ae3fa0c26c512774e16ff1c504cb Mon Sep 17 00:00:00 2001 From: Fabian Braun Date: Wed, 29 Oct 2025 07:33:51 +0100 Subject: [PATCH] feat: Add readthedocs support --- .readthedocs.yaml | 20 ++++++++++++ docs/.gitignore | 15 --------- docs/Makefile | 2 +- docs/pyproject.toml | 32 ------------------- docs/requirements.txt | 9 ++++++ docs/{ => source}/_static/.gitkeep | 0 docs/{ => source}/changelog.rst | 0 docs/{ => source}/conf.py | 9 ++++-- docs/{ => source}/contributing.rst | 0 .../{ => source}/how-to/01-use-multi-site.rst | 0 .../how-to/02-plugin-creation.rst | 0 docs/{ => source}/how-to/index.rst | 0 docs/{ => source}/index.rst | 0 docs/{ => source}/reference/breadcrumbs.rst | 0 docs/{ => source}/reference/index.rst | 0 docs/{ => source}/reference/languages.rst | 0 docs/{ => source}/reference/menu.rst | 0 docs/{ => source}/reference/pages.rst | 0 docs/{ => source}/reference/placeholders.rst | 0 docs/{ => source}/reference/plugins.rst | 0 docs/{ => source}/reference/submenu.rst | 0 docs/{ => source}/tutorial/01-quickstart.rst | 0 .../{ => source}/tutorial/02-installation.rst | 0 .../tutorial/03-openapi-documentation.rst | 0 docs/{ => source}/tutorial/index.rst | 0 25 files changed, 36 insertions(+), 51 deletions(-) create mode 100644 .readthedocs.yaml delete mode 100644 docs/.gitignore delete mode 100644 docs/pyproject.toml create mode 100644 docs/requirements.txt rename docs/{ => source}/_static/.gitkeep (100%) rename docs/{ => source}/changelog.rst (100%) rename docs/{ => source}/conf.py (98%) rename docs/{ => source}/contributing.rst (100%) rename docs/{ => source}/how-to/01-use-multi-site.rst (100%) rename docs/{ => source}/how-to/02-plugin-creation.rst (100%) rename docs/{ => source}/how-to/index.rst (100%) rename docs/{ => source}/index.rst (100%) rename docs/{ => source}/reference/breadcrumbs.rst (100%) rename docs/{ => source}/reference/index.rst (100%) rename docs/{ => source}/reference/languages.rst (100%) rename docs/{ => source}/reference/menu.rst (100%) rename docs/{ => source}/reference/pages.rst (100%) rename docs/{ => source}/reference/placeholders.rst (100%) rename docs/{ => source}/reference/plugins.rst (100%) rename docs/{ => source}/reference/submenu.rst (100%) rename docs/{ => source}/tutorial/01-quickstart.rst (100%) rename docs/{ => source}/tutorial/02-installation.rst (100%) rename docs/{ => source}/tutorial/03-openapi-documentation.rst (100%) rename docs/{ => source}/tutorial/index.rst (100%) diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 0000000..4a3bb43 --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,20 @@ +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details +version: 2 + +build: + os: ubuntu-24.04 + tools: + python: "3.13" + +sphinx: + configuration: docs/source/conf.py + fail_on_warning: false + +formats: + - epub + - pdf + +python: + install: + - requirements: docs/requirements.txt diff --git a/docs/.gitignore b/docs/.gitignore deleted file mode 100644 index c798a8a..0000000 --- a/docs/.gitignore +++ /dev/null @@ -1,15 +0,0 @@ -# Sphinx build directory -_build/ - -# Python cache -__pycache__/ -*.pyc -*.pyo - -# IDE files -.vscode/ -.idea/ - -# OS files -.DS_Store -Thumbs.db diff --git a/docs/Makefile b/docs/Makefile index 67a089d..63480a3 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -5,7 +5,7 @@ # from the environment for the first two. SPHINXOPTS ?= SPHINXBUILD ?= sphinx-build -SOURCEDIR = . +SOURCEDIR = source/ BUILDDIR = _build # Put it first so that "make" without argument is like "make help". diff --git a/docs/pyproject.toml b/docs/pyproject.toml deleted file mode 100644 index 80ae7e1..0000000 --- a/docs/pyproject.toml +++ /dev/null @@ -1,32 +0,0 @@ -[tool.poetry] -name = "djangocms-rest-docs" -version = "0.1.0" -description = "Documentation for django CMS REST" -authors = ["Django CMS Association and contributors "] -readme = "README.md" -packages = [] -package-mode = false - -[tool.poetry.dependencies] -python = ">=3.9,<4" -sphinx = "^7.2.6" -sphinx-rtd-theme = "^2.0.0" -sphinx-autodoc-typehints = "^2.0.0" -sphinx-copybutton = "^0.5.2" -sphinx-tabs = "^3.4.4" -furo = "^2025.7.19" - -[tool.poetry.group.dev.dependencies] -sphinx-autobuild = "^2021.3.14" -sphinx-issues = "^3.0.1" -sphinx-removed-in = "^0.2.1" -sphinx-notfound-page = "^0.8.3" -rstfmt = "^0.0.14" - -[build-system] -requires = ["poetry-core"] -build-backend = "poetry.core.masonry.api" - -[tool.poetry.urls] -Homepage = "https://github.com/django-cms/djangocms-rest" -Documentation = "https://djangocms-rest.readthedocs.io/" \ No newline at end of file diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000..513271a --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,9 @@ +# Generated from docs/pyproject.toml [tool.poetry.dependencies] +# Note: Poetry caret constraints (^) converted to pip-compatible specifiers +sphinx>=7.2.6,<8.0.0 +sphinx-rtd-theme>=2.0.0,<3.0.0 +sphinx-autodoc-typehints>=2.0.0,<3.0.0 +sphinx-copybutton>=0.5.2,<0.6.0 +sphinx-tabs>=3.4.4,<4.0.0 +furo>=2025.7.19,<2026.0.0 +-e .. \ No newline at end of file diff --git a/docs/_static/.gitkeep b/docs/source/_static/.gitkeep similarity index 100% rename from docs/_static/.gitkeep rename to docs/source/_static/.gitkeep diff --git a/docs/changelog.rst b/docs/source/changelog.rst similarity index 100% rename from docs/changelog.rst rename to docs/source/changelog.rst diff --git a/docs/conf.py b/docs/source/conf.py similarity index 98% rename from docs/conf.py rename to docs/source/conf.py index 25929c7..aacc11b 100644 --- a/docs/conf.py +++ b/docs/source/conf.py @@ -13,6 +13,8 @@ import os import sys +from djangocms_rest import __version__ + sys.path.insert(0, os.path.abspath("..")) # -- Project information ----------------------------------------------------- @@ -22,7 +24,8 @@ author = "Django CMS Association and contributors" # The full version, including alpha/beta/rc tags -release = "0.1.0" + +release = __version__ # -- General configuration --------------------------------------------------- @@ -121,10 +124,10 @@ # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". -html_title = "djangocms-rest" +html_title = None # A shorter title for the navigation bar. Default is the same as html_title. -html_short_title = "djangocms-rest" +# html_short_title = "djangocms-rest" # The name of an image file (relative to this directory) to place at the top # of the sidebar. diff --git a/docs/contributing.rst b/docs/source/contributing.rst similarity index 100% rename from docs/contributing.rst rename to docs/source/contributing.rst diff --git a/docs/how-to/01-use-multi-site.rst b/docs/source/how-to/01-use-multi-site.rst similarity index 100% rename from docs/how-to/01-use-multi-site.rst rename to docs/source/how-to/01-use-multi-site.rst diff --git a/docs/how-to/02-plugin-creation.rst b/docs/source/how-to/02-plugin-creation.rst similarity index 100% rename from docs/how-to/02-plugin-creation.rst rename to docs/source/how-to/02-plugin-creation.rst diff --git a/docs/how-to/index.rst b/docs/source/how-to/index.rst similarity index 100% rename from docs/how-to/index.rst rename to docs/source/how-to/index.rst diff --git a/docs/index.rst b/docs/source/index.rst similarity index 100% rename from docs/index.rst rename to docs/source/index.rst diff --git a/docs/reference/breadcrumbs.rst b/docs/source/reference/breadcrumbs.rst similarity index 100% rename from docs/reference/breadcrumbs.rst rename to docs/source/reference/breadcrumbs.rst diff --git a/docs/reference/index.rst b/docs/source/reference/index.rst similarity index 100% rename from docs/reference/index.rst rename to docs/source/reference/index.rst diff --git a/docs/reference/languages.rst b/docs/source/reference/languages.rst similarity index 100% rename from docs/reference/languages.rst rename to docs/source/reference/languages.rst diff --git a/docs/reference/menu.rst b/docs/source/reference/menu.rst similarity index 100% rename from docs/reference/menu.rst rename to docs/source/reference/menu.rst diff --git a/docs/reference/pages.rst b/docs/source/reference/pages.rst similarity index 100% rename from docs/reference/pages.rst rename to docs/source/reference/pages.rst diff --git a/docs/reference/placeholders.rst b/docs/source/reference/placeholders.rst similarity index 100% rename from docs/reference/placeholders.rst rename to docs/source/reference/placeholders.rst diff --git a/docs/reference/plugins.rst b/docs/source/reference/plugins.rst similarity index 100% rename from docs/reference/plugins.rst rename to docs/source/reference/plugins.rst diff --git a/docs/reference/submenu.rst b/docs/source/reference/submenu.rst similarity index 100% rename from docs/reference/submenu.rst rename to docs/source/reference/submenu.rst diff --git a/docs/tutorial/01-quickstart.rst b/docs/source/tutorial/01-quickstart.rst similarity index 100% rename from docs/tutorial/01-quickstart.rst rename to docs/source/tutorial/01-quickstart.rst diff --git a/docs/tutorial/02-installation.rst b/docs/source/tutorial/02-installation.rst similarity index 100% rename from docs/tutorial/02-installation.rst rename to docs/source/tutorial/02-installation.rst diff --git a/docs/tutorial/03-openapi-documentation.rst b/docs/source/tutorial/03-openapi-documentation.rst similarity index 100% rename from docs/tutorial/03-openapi-documentation.rst rename to docs/source/tutorial/03-openapi-documentation.rst diff --git a/docs/tutorial/index.rst b/docs/source/tutorial/index.rst similarity index 100% rename from docs/tutorial/index.rst rename to docs/source/tutorial/index.rst