Skip to content

Metalabel filters

The new feature for sphinx tango extension allows filtering after the metalabels. Example below:

:audience:`developers`

Example of Toctree showing only this document that has the value of metalabel "audience" set on "developer" or "advanced developers":

.. toctree::
   :glob:
   :name: indexfordevelopers
   :maxdepth: 2
   :metalabel: {"audience": ["developers", "advanced developers"]}

   *

In this PR was created the example for filtering all documentation and find content for "developers" or "administartor" in two new index file : source/index_for_administrators.rst and source/index_for_developers.rst.

For use the * syntax we must use the :glob: option. To allow two toctree directives contain the same root directory the configuration was changed:

html_theme_options = {
    "sticky_navigation": True,
    "collapse_navigation": False
}

This change caused the visible change on the Sidebar in the website, and now it looks like in the screen below:

now

Before:

before

Merge request reports