Alabaster
Alabaster is a visually clean, responsive, and configurable theme for the Sphinx documentation system. It is currently at version 1.0.0 and is actively maintained, with releases typically tied to Sphinx compatibility and feature enhancements. It started as a third-party theme but is now an install-time dependency and the default theme for Sphinx since version 1.3.
Warnings
- breaking Alabaster 1.0.0 dropped support for Python 3.9 and earlier, and Sphinx 6.1 and earlier.
- breaking The layout changed significantly between Alabaster 0.7.16 and 1.0.0 due to the removal of `@import url("basic.css");` from `alabaster.css`. This can cause tables, TOCs, and figures to display incorrectly, potentially extending beyond screen width.
- deprecated The `canonical_url` theme option was deprecated in Alabaster 0.7.15 in favor of Sphinx's `html_baseurl` configuration.
- gotcha Some older theme options (implemented prior to 0.7.8) that modify minor styles might be more appropriately handled via custom CSS stylesheet overrides. The theme maintainers now generally prefer custom stylesheets for small CSS modifications.
Install
-
pip install alabaster
Imports
- alabaster.get_path
import alabaster html_theme_path = [alabaster.get_path()] extensions = ['alabaster'] html_theme = 'alabaster'
Quickstart
# 1. First, set up a basic Sphinx project (if you haven't already):
# sphinx-quickstart
# (accept defaults or configure as needed)
# 2. In your conf.py (located in your Sphinx project's source directory):
import os
import sys
import alabaster
# Project information
project = 'My Awesome Project'
copyright = '2026, Your Name'
author = 'Your Name'
release = '0.1.0'
# -- General configuration ---------------------------------------------------
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.napoleon',
'sphinx.ext.viewcode',
'alabaster' # Important: include 'alabaster' in extensions
]
templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
# -- Options for HTML output -------------------------------------------------
html_theme = 'alabaster'
html_theme_path = [alabaster.get_path()] # This dynamically sets the theme path
# Optional: Alabaster theme options (customize appearance)
html_theme_options = {
'logo': 'logo.png', # Requires a logo.png in _static/ if used
'github_user': 'your-github-user',
'github_repo': 'your-github-repo',
'description': 'A brief description of your project.',
'fixed_sidebar': True,
'show_relbars': True,
'show_related': True,
'sidebar_width': '250px'
# Many other options available, see Alabaster documentation
}
# Optional: Custom sidebar templates, maps document names to template names.
# Alabaster provides about.html, navigation.html, searchbox.html, donate.html
# searchbox.html comes with Sphinx itself.
html_sidebars = {
'**': [
'about.html',
'navigation.html',
'searchbox.html',
'donate.html'
]
}
# If you have custom CSS, add it here (e.g., in _static/custom.css)
# html_static_path = ['_static']
# html_css_files = [
# 'css/custom.css',
# ]
# To build your docs:
# cd <your_sphinx_project_root>
# make html