qtbase/doc/global/htmltabs.qdocconf
Topi Reinio 562e74e3b4 Doc: Modify \tabcontent..\endtabcontent macros
QDoc markup following the \tabcontent macro should start a new
paragraph. As HTML-specific macros are injected directly into
the output, QDoc's doc parser is not aware that the macro should
start a new paragraph.

Turn the macros into generic, non-format-specific macros,
expanding to \div and \enddiv commands that wrap the tab
content.

Pick-to: 6.8 6.5
Change-Id: Ie8313af391b1a38ef74592acac3198fef5b7b310
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
(cherry picked from commit 5c0b08a20dd14f7fd8632495aa911fe427f58f7f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-15 12:37:46 +00:00

61 lines
1.9 KiB
Plaintext

#Macros for HTML tabs
#Usage:
#\tab {name}{tab-id}{title}{checked}
#\tabcontent {tab-id}
# content
#\endtabcontent
# Ensure that the {name} is unique for the group.
# i.e A group of tabs can have the same name, whereas
# {tab-id} should be unique. In addition, the argument
# for \tabcontent macro should match the {tab-id} for the
# corresponding \tab.
# The {checked} argument ensures that the tab is selected
# by default when the HTML page is loaded. For the other
# tabs that are not selected, pass and empty argument {}.
#
# Note that these macros work with the online template only.
#
# Example:
# \if defined(onlinedocs)
# \tab {build-qt-app}{tab-cmake}{CMake}{checked}
# \tab {build-qt-app}{tab-qmake}{qmake}{}
# \tabcontent {tab-cmake}
# \else
# \section1 Using CMake
# \endif
# CMake-specific instructions go here
# \if defined(onlinedocs)
# \endtabcontent
# \tabcontent {tab-qmake}
# \else
# \section1 Using qmake
# \endif
# qmake-specific instructions go here
# \if defined(onlinedocs)
# \endtabcontent
# \endif
macro.tab.HTML = "<input type=\"radio\" name=\"tabs_\1\" id=\"\2\" \4/><label for=\"\2\">\3</label><style>#\2:checked ~ .\2{display: block;}</style>"
macro.tabcontent = "\\div {class=\"tabcontent \1\"}"
macro.endtabcontent = "\\enddiv"
HTML.extraimages += template/style/htmltabs.css
HTML.headerstyles += \
" <link rel=\"stylesheet\" type=\"text/css\" href=\"images/htmltabs.css\" />\n"
HTML.headerscripts += \
" <script type=\"text/javascript\">\n" \
" \$(document).ready(function(){\n" \
" \$(\"input[type=radio]\").on(\"click\", function() {\n" \
" var lbl = \$(this).next().text();\n" \
" \$(\"input[type=radio]:not(checked)\").filter(function() {\n" \
" if (\$(this).next().text() == lbl)\n" \
" \$(this).prop(\"checked\", true);\n" \
" });\n" \
" });\n" \
" });\n" \
" </script>\n"