sphinx-daisyui¶
sphinx-daisyui is a Sphinx theme drawn with daisyUI 5 and Tailwind CSS 4. A project whose product is built on daisyUI gets documentation that takes on the same theme as the application, and any of daisyUI’s colour themes works in light and dark without a build step. The theme has its own options, many named after pydata-sphinx-theme’s.
Features¶
The
daisyuitheme, with its stylesheet compiled into the package, so using it never needs Node.The page frame: a header, two sidebars and a footer, arranged by one layout code and filled from lists of components.
Sections in the header, with the sidebar showing only the section being read.
Colour themes: every daisyUI theme, light and dark, and a picker for readers.
Search and versions: search as you type from Sphinx’s own index, and a version switcher.
Icon links and source links: accounts as icons, and edit and view buttons that lead to each page’s source file.
Page bodies drawn with daisyUI’s components and colour tokens, so code, admonitions, tables and sphinx-design components never sit in the wrong colours.
Requirements¶
Python 3.11 or later
Sphinx 7.4 or later
Installation¶
Install the package:
pip install sphinx-daisyui
Choose the theme in your conf.py:
html_theme = "daisyui"
Installation describes each step in full.
An example¶
Name the theme, give it a logo and link the repository:
html_theme = "daisyui"
html_theme_options = {
"logo": {"text": "My project", "image_light": "logo.svg"},
"icon_links": [
{
"name": "GitHub",
"url": "https://github.com/example/project",
"icon": "github",
},
],
"source_repository": "https://github.com/example/project",
"source_directory": "docs/",
}
The next build has the project’s name and logo in the header, a GitHub icon, and an edit button above each page that leads to the page’s source file.
Next steps¶
Install the theme, arrange the page, and set up search, versions and links.
Every option, component and layout letter the theme accepts.
Which option of this theme does what each of theirs did.
Every kind of content a page can hold, drawn in the theme.
About the project¶
Domain model: the words this project uses and what each means.
Constitution: the rules every change follows.
Changelog: what changed in each release.
Support¶
Report a problem in the issue tracker. Everyone taking part is expected to follow the Contributor Covenant.
Licence¶
MIT. See LICENSE.