Manticore Sphinx Theme Manticore Sphinx Theme
Manticore Sphinx Theme Manticore Sphinx Theme v1.0

Getting Started

  • Installation
    • Option A — pip install (recommended)
    • Option B — Copy the theme directory
    • Option C — Reference by path
    • Runtime Files
    • Prerequisites
  • Quick Start
    • 1. Install
    • 2. Configure
    • 3. Build
    • 4. Live-Reload
    • Minimal conf.py

Customisation

  • Configuration
    • Colour Roles
    • Sphinx-Level Settings
    • Landing Page Cards
  • Colours & Fonts
    • Colour Palette
      • Example Palettes
    • Font Stack
      • Changing Fonts
    • Link Colours
  • Corporate Branding
    • Sidebar Logo
      • Default Corporate Icon
    • Browser Favicon
    • Project Name & Version
    • Repository Link
    • Complete Branding Example
  • Dark Mode
    • How It Works
      • Persistence Across Pages
    • Architecture
      • Dark Palette
    • Customising Dark Mode
  • Landing Page
    • Enabling the Landing Page
      • What Gets Hidden
    • Content Layout
    • Landing Cards from conf.py
    • Mobile Behaviour
  • Sidebar Directive
    • Usage
    • Image Handling
    • Float Behaviour
    • Tips
  • SASS Customisation
    • Architecture
    • Workflow
    • Common Customisations
    • Pygments Style

Building & Deploying

  • Build System
    • Tool Detection
    • Command Reference
    • pipx Integration
  • Optimization
    • Usage
    • What It Does
    • Example Output
    • Pre-compiled CSS
  • Deployment
    • GitHub Pages
    • GitLab Pages
    • Read the Docs
    • Self-Hosted (Nginx)
    • S3 / CloudFront

Reference

  • Options Reference
    • Branding
    • Colours
    • Navigation
    • Footer
    • Content & Layout
    • Repository
    • html_context (Landing Cards)
  • Keyboard Shortcuts
    • Shortcuts
    • On-Page TOC Behaviour
    • TOC Filter
  • Directives Support
    • Admonitions
      • Version Directives
    • Sidebar Directive
    • Topic Directive
    • Code Blocks
    • Tables
    • Images & Figures
    • Domain Objects (Python, C++, JS)
    • Inline Roles
    • Block Elements
    • Footnotes, Citations, Glossary
    • HTML5 Elements (Sphinx 8+)
    • Search Results (Sphinx 8+)
    • External Link Indicator
  • Home
  • Sidebar Directive
GitHub

Sidebar Directive¶

The reStructuredText .. sidebar:: directive creates a floating box on the right side of the content. This theme provides full support including images, figures, and text wrapping.

Usage¶

.. sidebar:: My Caption

   .. image:: _images/screenshot.png

   Description text below the image.

Main body text flows here and wraps around the sidebar.
Paragraphs continue alongside the floating box.

The sidebar floats right with float: right !important and occupies 40% of the content width (capped at 22rem, minimum 12rem).

Image Handling¶

Sphinx generates images inside sidebars as:

<aside class="sidebar">
  <p class="sidebar-title">Caption</p>
  <a class="image-reference">
    <img class="align-right" style="width: 100%;">
  </a>
</aside>

The theme overrides Sphinx’s align-right class on images inside the sidebar to prevent the image from floating out of the box:

.sidebar img {
  display: block !important;
  float: none !important;       // kill align-right
  width: 100%;
  max-width: 100% !important;
}

The inline <style> block in layout.html provides the same rules at highest CSS priority as a safety net.

Float Behaviour¶

Paragraphs after the sidebar wrap normally alongside it.

Code blocks, tables, and other wide elements use clear: right to drop below the sidebar — they’re too wide to squeeze beside it.

On mobile (< 768px), the sidebar stops floating and goes full-width, with images capped at 60% of the screen.

Tips¶

  • Place the .. sidebar:: directive before the text that should wrap around it in your .rst source.

  • Add more content to the sidebar (text, lists) to make it taller and allow more wrapping.

  • For very short sidebars, the wrapping effect may not be visible because the following paragraphs fit entirely in the remaining width.

On this page

  • Sidebar Directive
    • Usage
    • Image Handling
    • Float Behaviour
    • Tips
Previous Landing Page Next SASS Customisation

Manticore Sphinx Theme — Manticore Projects

Powered by Sphinx & Bulma

© 2026, Manticore Projects