Skip to content

Commit

Permalink
add the possibility to define tags
Browse files Browse the repository at this point in the history
Tags can be used for conditional content. However, they cannot be
specified in custom_conf.py (not quite sure why - they probably
require some library that isn't available in custom_conf.py).
So let's have a way to define them in custom_conf.py, but add them
in conf.py.

Signed-off-by: Ruth Fuchss <[email protected]>
  • Loading branch information
ru-fu committed Sep 19, 2023
1 parent f0d0330 commit 78ccfd3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@
]
linkcheck_anchors_ignore_for_url.extend(custom_linkcheck_anchors_ignore_for_url)

# Tags cannot be added directly in custom_conf.py, so add them here
for tag in custom_tags:
tags.add(tag)

############################################################
### Styling
############################################################
Expand Down
4 changes: 4 additions & 0 deletions custom_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@
# You can disable it by setting the following configuration to True.
disable_feedback_button = False

# Add tags that you want to use for conditional inclusion of text
# (https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#tags)
custom_tags = []

############################################################
### Additional configuration
############################################################
Expand Down

0 comments on commit 78ccfd3

Please sign in to comment.