Content Tabs¶
When creating an installation topic that requires covering multiple operating systems, you could create one topic per operating system or create one longer topic that includes all of the operating systems.
Material for MkDocs has a content tab feature that allows you to add tabbed content inside a topic. Using the installation example, you can use content tabs to have a tab for Windows, one for macOS, and one for Linux (or multiple tabs for different Linux distributions). Now all the installation content is in one topic that users can simply click tab they need instead of having to scroll and search through a long topic.
Installation steps for a Windows system.
Installation steps for a macOS system.
Installation steps for a Linux Debian system, like Debian or Ubuntu.
Installation steps for a Linux RPM system, like Red Hat, CentOS, or SUSE.
Using Content Tabs¶
-
In the
mkdocs.yml
file, add the following information. -
In a topic, use
===
to separate tabbed content, enclose the tab title in quotation marks, and make sure the tabbed content is properly indented.