Alabaster

1.0.0 · active · verified Sun Mar 29

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

Install

Imports

Quickstart

This quickstart guides you through configuring an existing Sphinx project to use the Alabaster theme. It demonstrates how to set the theme path using `alabaster.get_path()`, enable the `alabaster` extension, and apply common `html_theme_options` and `html_sidebars` configurations within your Sphinx `conf.py` file.

# 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

view raw JSON →