Getting Started
Install
Install the library with pip:
pip install sphinx-carousel
pip install git+https://github.com/Robpol86/sphinx-carousel@main
Enable
Add sphinx_carousel.carousel to your extensions list in your conf.py file:
extensions = [
"sphinx_carousel.carousel",
]
Configuration
The following optional configuration settings are available for use in your conf.py file:
- carousel_bootstrap_add_css_js
Default: True
Include Bootstrap CSS and javascript files on pages that contain carousels via
<link>and<script>HTML tags.If you’re using a Sphinx theme or another Sphinx extension that includes Bootstrap you can set this to
Falseto avoid multiple Bootstrap files from being loaded. You’ll also want to look at thecarousel_bootstrap_prefixoption.
- carousel_bootstrap_prefix
Default: scbs-
Prefix all CSS classes with this string.
If you set
carousel_bootstrap_add_css_jstoFalseyou’ll want to set this to an empty string.
- carousel_show_buttons_on_top
Default: False
Set :show_buttons_on_top: on all carousels by default. Can be disabled on a per-usage basis with
:no_buttons_on_top:.
- carousel_show_captions_below
Default: False
Set :show_captions_below: on all carousels by default. Can be disabled on a per-usage basis with
:no_captions_below:.
- carousel_show_controls
Default: False
Set :show_controls: on all carousels by default. Can be disabled on a per-usage basis with
:no_controls:.
- carousel_show_dark
Default: False
Set :show_dark: on all carousels by default. Can be disabled on a per-usage basis with
:no_dark:.
- carousel_show_fade
Default: False
Set :show_fade: on all carousels by default. Can be disabled on a per-usage basis with
:no_fade:.
- carousel_show_indicators
Default: False
Set :show_indicators: on all carousels by default. Can be disabled on a per-usage basis with
:no_indicators:.
- carousel_show_shadows
Default: False
Set :show_shadows: on all carousels by default. Can be disabled on a per-usage basis with
:no_shadows:.