diff mbox series

[3/8] conf.py: enable the sphinx-tags extension

Message ID 20261028-tags-v1-3-d5ad01019eae@bootlin.com
State New
Headers show
Series Add support for documentation tags | expand

Commit Message

Antonin Godard Oct. 28, 2026, 8:04 a.m. UTC
The sphinx-tags extension can be used to add tags to document, which
then creates a section of the documentation with a list of tags which
group documents. This should help users finding the different documents
across the Yocto Project documentation which fall under a common
category.

Update the Makefile to remove the generated _tags/ directory on a make
clean, and the .gitignore.

Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
---
 documentation/.gitignore | 1 +
 documentation/Makefile   | 2 +-
 documentation/conf.py    | 8 ++++++++
 3 files changed, 10 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/documentation/.gitignore b/documentation/.gitignore
index d6d020efb..84d82f45d 100644
--- a/documentation/.gitignore
+++ b/documentation/.gitignore
@@ -1,5 +1,6 @@ 
 sphinx/__pycache__
 _build/
+_tags/
 Pipfile.lock
 poky.yaml
 sphinx-static/switchers.js
diff --git a/documentation/Makefile b/documentation/Makefile
index 2df23ebf4..f165e36c2 100644
--- a/documentation/Makefile
+++ b/documentation/Makefile
@@ -33,7 +33,7 @@  publish: Makefile checks epub latexpdf html singlehtml
 	sed -i -e 's@index.html#@singleindex.html#@g' $(BUILDDIR)/$(DESTDIR)/singleindex.html
 
 clean:
-	@rm -rf $(BUILDDIR) poky.yaml sphinx-static/switchers.js releases.rst releases.json
+	@rm -rf $(BUILDDIR) _tags/ poky.yaml sphinx-static/switchers.js releases.rst releases.json
 
 checks:
 	$(SOURCEDIR)/tools/check-glossaries --docs-dir $(SOURCEDIR)
diff --git a/documentation/conf.py b/documentation/conf.py
index d2252d5ab..75d062945 100644
--- a/documentation/conf.py
+++ b/documentation/conf.py
@@ -50,6 +50,7 @@  extensions = [
     'sphinx.ext.extlinks',
     'sphinx.ext.intersphinx',
     'sphinx_copybutton',
+    'sphinx_tags',
     'sphinxcontrib.rsvgconverter',
     'yocto-vars'
 ]
@@ -260,3 +261,10 @@  copybutton_prompt_is_regexp = True
 copybutton_only_copy_prompt_lines = True
 copybutton_remove_prompts = True
 copybutton_line_continuation_character = "\\"
+
+# -- sphinx_tags configuration -----------------------------------------------
+
+tags_create_tags = True
+tags_page_title = "Tag"
+tags_page_header = "Document(s) with this tag"
+tags_create_badges = True