Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to furo for docs #636

Merged
merged 1 commit into from
Jan 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Homepage: https://marshmallow-sqlalchemy.readthedocs.io/

`SQLAlchemy <http://www.sqlalchemy.org/>`_ integration with the `marshmallow <https://marshmallow.readthedocs.io/en/latest/>`_ (de)serialization library.

.. start elevator-pitch

Declare your models
===================

Expand Down Expand Up @@ -131,6 +133,8 @@ Get it now

Requires Python >= 3.9, marshmallow >= 3.18.0, and SQLAlchemy >= 1.4.40.

.. end elevator-pitch

Documentation
=============

Expand Down
177 changes: 0 additions & 177 deletions docs/Makefile

This file was deleted.

23 changes: 23 additions & 0 deletions docs/_static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/* Headings */

h2, h3, h4, h5, h6 {
font-weight: 400;
}

/* UI elements: left and right sidebars, "Back to top" button, admonitions, Copy button */
.sidebar-drawer, .toc-drawer, .back-to-top, .admonition, .copybtn {
/* Sans-serif system font stack */
font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, arial, sans-serif;
}

/* Links */

a:link, a:visited {
color: var(--color-link);
}

/* Hide ToC caption text within the main body (but leave them in the side-bar). */
/* https://github.com/hynek/structlog/blob/b488a8bf589a01aabc41e3bf8df81a9848cd426c/docs/_static/custom.css#L17-L20 */
#furo-main-content span.caption-text {
display: none;
}
7 changes: 0 additions & 7 deletions docs/_templates/_templates/useful-links.html

This file was deleted.

7 changes: 0 additions & 7 deletions docs/_templates/useful-links.html

This file was deleted.

20 changes: 8 additions & 12 deletions docs/api_reference.rst
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
.. _api:

*************
API Reference
*************

Core
====

.. automodule:: marshmallow_sqlalchemy
:members:

.. autodata:: marshmallow_sqlalchemy.fields_for_model
:annotation: =func(...)
.. autodata:: marshmallow_sqlalchemy.fields_for_model
:annotation: =func(...)

.. autodata:: marshmallow_sqlalchemy.property2field
:annotation: =func(...)
.. autodata:: marshmallow_sqlalchemy.property2field
:annotation: =func(...)

.. autodata:: marshmallow_sqlalchemy.column2field
:annotation: =func(...)
.. autodata:: marshmallow_sqlalchemy.column2field
:annotation: =func(...)

.. autodata:: marshmallow_sqlalchemy.field_for
:annotation: =func(...)
.. autodata:: marshmallow_sqlalchemy.field_for
:annotation: =func(...)

Fields
======
Expand Down
71 changes: 26 additions & 45 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import importlib.metadata
from collections import OrderedDict

import alabaster

extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.autodoc.typehints",
"sphinx.ext.intersphinx",
"sphinx.ext.viewcode",
"sphinx_copybutton",
"sphinx_issues",
"sphinxext.opengraph",
]

primary_domain = "py"
Expand All @@ -23,56 +23,37 @@

source_suffix = ".rst"
master_doc = "index"

project = "marshmallow-sqlalchemy"
copyright = "Steven Loria and contributors"

version = release = importlib.metadata.version("marshmallow-sqlalchemy")

exclude_patterns = ["_build"]

html_theme_path = [alabaster.get_path()]
html_theme = "alabaster"
html_static_path = ["_static"]
templates_path = ["_templates"]
html_show_sourcelink = False
# THEME

html_theme = "furo"
html_logo = "_static/marshmallow-sqlalchemy-logo.png"
html_theme_options = {
"logo": "marshmallow-sqlalchemy-logo.png",
"description": "SQLAlchemy integration with the marshmallow (de)serialization library",
"description_font_style": "italic",
"github_user": "marshmallow-code",
"github_repo": "marshmallow-sqlalchemy",
"github_banner": True,
"github_button": False,
"code_font_size": "0.85em",
"warn_bg": "#FFC",
"warn_border": "#EEE",
# Used to populate the useful-links.html template
"extra_nav_links": OrderedDict(
[
(
"marshmallow-sqlalchemy @ PyPI",
"http://pypi.python.org/pypi/marshmallow-sqlalchemy",
),
(
"marshmallow-sqlalchemy @ GitHub",
"http://github.com/marshmallow-code/marshmallow-sqlalchemy",
),
(
"Issue Tracker",
"http://github.com/marshmallow-code/marshmallow-sqlalchemy/issues",
),
]
),
"source_repository": "https://github.com/marshmallow-code/marshmallow-sqlalchemy",
"source_branch": "dev",
"source_directory": "docs/",
"sidebar_hide_name": True,
"light_css_variables": {
# Serif system font stack: https://systemfontstack.com/
"font-stack": "Iowan Old Style, Apple Garamond, Baskerville, Times New Roman, Droid Serif, Times, Source Serif Pro, serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;",
},
"top_of_page_buttons": ["view"],
}
html_static_path = ["_static"]
html_css_files = ["custom.css"]
html_show_sourcelink = False
ogp_image = "_static/marshmallow-sqlalchemy-logo.png"

html_sidebars = {
"index": ["about.html", "useful-links.html", "searchbox.html"],
"**": [
"about.html",
"useful-links.html",
"localtoc.html",
"relations.html",
"searchbox.html",
],
}
# Strip the dollar prompt when copying code
# https://sphinx-copybutton.readthedocs.io/en/latest/use.html#strip-and-configure-input-prompts-for-code-cells
copybutton_prompt_text = "$ "

autodoc_typehints = "both"
autodoc_member_order = "bysource"
Loading
Loading