Skip to content

Commit c777429

Browse files
Modernize RTD site with Furo theme, improved structure, and new extensions
- Switch from Alabaster to Furo theme for modern look, dark mode, and responsive layout - Add sphinx-copybutton, sphinx-design, intersphinx, and opengraph extensions - Refactor comparison section to use tabbed layouts instead of long sequential code blocks - Fix user_guide.rst title mismatch (was "Installation", now "User Guide") - Replace redundant modules.rst/cruds.rst chain with single api.rst - Add CI, RTD, and PyPI version badges to index page - Use code-block:: console for shell commands (proper highlighting) - Expand development.rst with testing, code quality, and issue filing sections - Fix copyright year to be dynamic (2020-current) - Fix project.urls to use https for RTD links - Configure .readthedocs.yaml to install package with [rtd] extras Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 844ba01 commit c777429

10 files changed

Lines changed: 444 additions & 213 deletions

File tree

.readthedocs.yaml

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,19 @@
11
# Read the Docs configuration file for Sphinx projects
22
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
33

4-
# Required
54
version: 2
65

7-
# Set the OS, Python version and other tools you might need
86
build:
97
os: ubuntu-22.04
108
tools:
11-
python: "3.11"
12-
# You can also specify other tool versions:
13-
# nodejs: "20"
14-
# rust: "1.70"
15-
# golang: "1.20"
9+
python: "3.12"
1610

17-
# Build documentation in the "docs/" directory with Sphinx
1811
sphinx:
1912
configuration: docs/conf.py
20-
# You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs
21-
# builder: "dirhtml"
22-
# Fail on all warnings to avoid broken references
23-
# fail_on_warning: true
2413

25-
# Optionally build your docs in additional formats such as PDF and ePub
26-
# formats:
27-
# - pdf
28-
# - epub
29-
30-
# Optional but recommended, declare the Python requirements required
31-
# to build your documentation
32-
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
33-
# python:
34-
# install:
35-
# - requirements: docs/requirements.txt
14+
python:
15+
install:
16+
- method: pip
17+
path: .
18+
extra_requirements:
19+
- rtd

docs/_static/.gitkeep

Whitespace-only changes.
Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,43 @@
1-
cruds package
1+
.. _api-reference:
2+
3+
=============
4+
API Reference
25
=============
36

4-
Submodules
5-
----------
7+
This section documents the public API of the CRUDs package.
68

7-
cruds.auth module
8-
-----------------
9+
Client
10+
======
911

10-
.. automodule:: cruds.auth
12+
.. autoclass:: cruds.Client
1113
:members:
1214
:undoc-members:
1315
:show-inheritance:
1416

15-
cruds.core module
16-
-----------------
17+
Authentication
18+
==============
1719

18-
.. automodule:: cruds.core
20+
.. autoclass:: cruds.core.AuthABC
1921
:members:
20-
:undoc-members:
2122
:show-inheritance:
2223

23-
cruds.exception module
24-
----------------------
25-
26-
.. automodule:: cruds.exception
24+
.. automodule:: cruds.auth
2725
:members:
2826
:undoc-members:
2927
:show-inheritance:
3028

31-
cruds.interface module
32-
----------------------
29+
Exceptions
30+
==========
3331

34-
.. automodule:: cruds.interface
32+
.. automodule:: cruds.exception
3533
:members:
3634
:undoc-members:
3735
:show-inheritance:
3836

39-
Module contents
40-
---------------
37+
Interfaces
38+
==========
4139

42-
.. automodule:: cruds
40+
.. automodule:: cruds.interface
4341
:members:
4442
:undoc-members:
4543
:show-inheritance:

docs/conf.py

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# https://www.sphinx-doc.org/en/master/usage/configuration.html
55
import os
66
import sys
7+
from datetime import datetime
78

89
sys.path.insert(0, os.path.abspath("../src"))
910

@@ -13,7 +14,7 @@
1314
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
1415

1516
project = "CRUDs"
16-
copyright = "2024, John Brandborg"
17+
copyright = f"2020–{datetime.now().year}, John Brandborg"
1718
author = "John Brandborg"
1819
version = cruds.__version__
1920
release = cruds.__version__
@@ -23,8 +24,12 @@
2324

2425
extensions = [
2526
"sphinx.ext.autodoc",
27+
"sphinx.ext.intersphinx",
2628
"sphinx.ext.todo",
2729
"sphinx.ext.viewcode",
30+
"sphinx_copybutton",
31+
"sphinx_design",
32+
"sphinxext.opengraph",
2833
]
2934

3035
templates_path = ["_templates"]
@@ -34,12 +39,27 @@
3439
# -- Options for HTML output -------------------------------------------------
3540
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
3641

37-
html_theme = "alabaster"
42+
html_theme = "furo"
3843
html_static_path = ["_static"]
3944
html_theme_options = {
40-
"description": "API interaction made easy",
41-
"github_user": "johnbrandborg",
42-
"github_repo": "cruds",
43-
"github_banner": True,
44-
"fixed_sidebar": True,
45+
"source_repository": "https://github.com/johnbrandborg/cruds",
46+
"source_branch": "main",
47+
"source_directory": "docs/",
4548
}
49+
50+
# -- Intersphinx mapping ----------------------------------------------------
51+
52+
intersphinx_mapping = {
53+
"python": ("https://docs.python.org/3", None),
54+
"urllib3": ("https://urllib3.readthedocs.io/en/stable/", None),
55+
}
56+
57+
# -- Copy button settings ----------------------------------------------------
58+
59+
copybutton_prompt_text = r"^\$ "
60+
copybutton_prompt_is_regexp = True
61+
62+
# -- Open Graph settings -----------------------------------------------------
63+
64+
ogp_site_url = "https://cruds.readthedocs.io/en/latest/"
65+
ogp_description_length = 200

docs/development.rst

Lines changed: 54 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
.. _development:
22

3+
===========
34
Development
45
===========
56

6-
At this time because the CRUDs code base is located on a repository not located
7-
under an Organization, to contribute it is recommended that you create a fork of
8-
CRUDs and then `Create a PR <https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork>`_
7+
Contributions are welcome! At this time because the CRUDs code base is located on
8+
a repository not located under an Organization, to contribute it is recommended
9+
that you create a fork of CRUDs and then `Create a PR
10+
<https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork>`_
911
from there.
1012

1113
Setup
@@ -15,23 +17,67 @@ It is highly recommended to create a virtual environment of Python. There are
1517
multiple ways to do this. The standard way is using Pythons very own
1618
`venv <https://docs.python.org/3/library/venv.html>`_.
1719

18-
Once you have a forked the CRUD repository and obtained a local copy of the
19-
source code use the develop target to install the package in edit mode and the
20-
extra packages used for development.
20+
Once you have forked the CRUDs repository and obtained a local copy of the
21+
source code, use the develop target to install the package in edit mode and the
22+
extra packages used for development:
2123

2224
.. code-block:: console
2325
2426
$ cd cruds
2527
$ make develop
2628
2729
The reason for using the Makefile is that the targets within it are also used by
28-
the Github Actions when testing, and linting. By making these available on the
30+
the Github Actions when testing and linting. By making these available on the
2931
command line it's easy to run the same commands and ensure everything passes before
30-
commiting the code.
32+
committing the code.
3133

3234
To display the menu of the Makefile, run ``make`` with no target (argument).
3335

3436
.. tip::
3537

3638
If you don't use Make you can run the commands manually, by opening the Makefile
3739
and copying the commands under the relevant targets into a terminal.
40+
41+
Running Tests
42+
-------------
43+
44+
CRUDs uses `pytest <https://docs.pytest.org/>`_ for testing with coverage
45+
reporting enabled by default:
46+
47+
.. code-block:: console
48+
49+
$ make test
50+
51+
To generate an XML coverage report (used by CI):
52+
53+
.. code-block:: console
54+
55+
$ make test-report
56+
57+
Code Quality
58+
------------
59+
60+
Linting and formatting are handled by `Ruff <https://docs.astral.sh/ruff/>`_:
61+
62+
.. code-block:: console
63+
64+
$ make lint
65+
$ make format
66+
67+
Static type checking is done with `ty <https://docs.astral.sh/ty/>`_:
68+
69+
.. code-block:: console
70+
71+
$ make typecheck
72+
73+
Filing Issues
74+
-------------
75+
76+
If you find a bug or have a feature request, please open an issue on the
77+
`GitHub issue tracker <https://github.com/johnbrandborg/cruds/issues>`_.
78+
When reporting bugs, include:
79+
80+
- Python version and OS
81+
- CRUDs version (``python -c "import cruds; print(cruds.__version__)"`` )
82+
- A minimal reproducible example
83+
- The full traceback if applicable

docs/index.rst

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
.. CRUDs documentation master file, created by
2-
sphinx-quickstart on Thu Aug 8 10:58:11 2024.
3-
You can adapt this file completely to your liking, but it should at least
4-
contain the root `toctree` directive.
5-
6-
====
1+
=====
72
CRUDs
8-
====
3+
=====
94

105
Release v\ |version|
116

7+
.. image:: https://img.shields.io/pypi/v/cruds
8+
:target: https://pypi.org/project/cruds/
9+
:alt: PyPI Version
10+
1211
.. image:: https://img.shields.io/pypi/pyversions/cruds?logo=python&logoColor=FFE873
1312
:target: https://pypi.org/project/cruds/
1413
:alt: Supported Python Version
@@ -17,6 +16,14 @@ Release v\ |version|
1716
:target: https://pypistats.org/packages/cruds
1817
:alt: PyPI downloads
1918

19+
.. image:: https://github.com/johnbrandborg/cruds/actions/workflows/development.yml/badge.svg
20+
:target: https://github.com/johnbrandborg/cruds/actions/workflows/development.yml
21+
:alt: CI Status
22+
23+
.. image:: https://readthedocs.org/projects/cruds/badge/?version=latest
24+
:target: https://cruds.readthedocs.io/en/latest/
25+
:alt: Documentation Status
26+
2027
.. image:: https://img.shields.io/pypi/l/cruds.svg
2128
:target: https://github.com/johnbrandborg/cruds/blob/main/LICENSE
2229
:alt: License Badge
@@ -29,7 +36,9 @@ and delete with zero boilerplate.
2936
Quickstart
3037
----------
3138

32-
Install from PyPI::
39+
Install from PyPI:
40+
41+
.. code-block:: console
3342
3443
$ pip install cruds
3544
@@ -110,13 +119,10 @@ User Guide
110119
API Reference
111120
-------------
112121

113-
For developers searching for information relating more closely to code
114-
115122
.. toctree::
116123
:maxdepth: 2
117-
:caption: Contents:
118124

119-
modules
125+
api
120126

121127
Indices and tables
122128
==================

docs/modules.rst

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)