A custom directive that creates graphical boxes (cards) for navigation and content organization.
.. topic-box::
<options>
<text>The topic-box directive supports the following options:
| Option | Type | Required | Example Value | Description |
|---|---|---|---|---|
title |
string | |v| | Lorem ipsum | Topic box title. |
class |
string | Custom CSS class. | ||
icon |
string | icon-home | A list of CSS classes to render icons, separated by comma or space. | |
image |
string | /_static/img/mascots-2/enterprise.svg | Path to the image. The image should be located in the project's _static folder. |
|
link |
string | getting-started | Relative link or external URL for the call to action. Do not use leading and trailing ("/") symbols to define relative links. (e.g. instead of /getting-started/, use getting-started). |
|
link_target |
string | auto | Defines if the link should be opened in a new tab or not. Available values: auto, _blank, _self. Defaults to auto. When set to auto, external links will open in a new tab while internal links will open in the same tab. | |
anchor |
string | Getting Started > | Text for the call to action. |
The topic-box directive handles different types of links:
- External links (e.g. https://example.com)
- Internal links with different path formats: * Absolute paths (e.g. /getting-started/installation) * Relative paths (e.g. code-blocks) * Parent directory references (e.g. ../getting-started) * Index files (e.g. index)
Examples:
# External link
.. topic-box::
:title: ScyllaDB
:link: https://scylladb.com
:anchor: Learn more
# Absolute path (from project root)
.. topic-box::
:title: Getting Started
:link: /getting-started/installation
:anchor: Learn more
# Relative path (same directory)
.. topic-box::
:title: Code Blocks
:link: code-blocks
:anchor: Learn more
# Parent directory
.. topic-box::
:title: Parent Section
:link: ../getting-started/installation
:anchor: Learn more
# Index file
.. topic-box::
:title: Examples
:link: index
:anchor: Learn moreRenders:
.. topic-box::
:title: ScyllaDB
:link: https://scylladb.com
:anchor: Learn more
.. topic-box::
:title: Getting Started
:link: /getting-started/installation
:anchor: Learn more
.. topic-box::
:title: Code Blocks
:link: code-blocks
:anchor: Learn more
.. topic-box::
:title: Parent Section
:link: ../getting-started/installation
:anchor: Learn more
.. topic-box::
:title: Examples
:link: index
:anchor: Learn more
To display topic boxes in responsive grid layouts, use the :doc:`grid` directive. The grid directive is specifically designed to work with topic boxes and supports Foundation's grid system for responsive layouts.
Using:
.. topic-box::
:title: Lorem Ipsum
:icon: icon-github
:link: #
:anchor: Lorem ipsum
Lorem ipsum dolor sit amet, consectetur adipiscing elit.Results in:
.. topic-box::
:title: Lorem Ipsum
:icon: icon-github
:link: #
:anchor: Lorem ipsum
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Using:
.. topic-box::
:title: Lorem Ipsum
:image: /_static/img/mascots-2/enterprise.svg
:link: #
:anchor: Lorem ipsum
Lorem ipsum dolor sit amet, consectetur adipiscing elit.Results in:
.. topic-box::
:title: Lorem Ipsum
:image: /_static/img/mascots-2/enterprise.svg
:link: #
:anchor: Lorem ipsum
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Using:
.. topic-box::
:title: Lorem Ipsum
:link: https://scylladb.com
:anchor: Lorem ipsum
Lorem ipsum dolor sit amet, consectetur adipiscing elit.Results in:
.. topic-box::
:title: Lorem Ipsum
:link: https://scylladb.com
:anchor: Lorem ipsum
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Using:
.. topic-box::
:title: Lorem Ipsum
:link: https://scylladb.com
:link_target: _self
:anchor: Lorem ipsum
Lorem ipsum dolor sit amet, consectetur adipiscing elit.Results in:
.. topic-box::
:title: Lorem Ipsum
:link: https://scylladb.com
:link_target: _self
:anchor: Lorem ipsum
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Using:
.. topic-box::
:title: Lorem Ipsum
:link: #
:image: /_static/img/mascots-2/enterprise.svg
:class: topic-box--product
Lorem ipsum dolor sit amet, consectetur adipiscing elit.Results in:
.. topic-box::
:title: Lorem Ipsum
:link: #
:image: /_static/img/mascots-2/enterprise.svg
:class: topic-box--product
Lorem ipsum dolor sit amet, consectetur adipiscing elit.