From 7ff50b007d5ac2a383b8824d19f80e1ee14ccd8e Mon Sep 17 00:00:00 2001 From: Gunashekar31742 <2400031742@kluniversity.in> Date: Tue, 21 Oct 2025 14:03:11 +0530 Subject: [PATCH] Docs: Add documentation for Sphinx tags (#4603) --- docs/user/reference/features.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/user/reference/features.rst b/docs/user/reference/features.rst index b6bf1884c1b..658f0746c00 100644 --- a/docs/user/reference/features.rst +++ b/docs/user/reference/features.rst @@ -63,3 +63,20 @@ Feature reference `robots.txt` files allow you to customize how your documentation is indexed in search engines. We provide a default robots.txt file, but you can also customize it. + +Content filtering with Tags +--------------------------- +Sphinx allows you to include content based on tags. This is useful if you want to show specific + content only for certain output formats (like HTML or PDF) or under other custom conditions. + This is controlled with the .. only:: directive. + +.. code-block:: rst + :caption: Example of tag-based content + + .. only:: html + + This paragraph is only included in the HTML documentation. + + .. only:: latex + + This paragraph is only included in the PDF (LaTeX) documentation. \ No newline at end of file