From a05596610bbbe9274d9300882fbbbfb41eec107d Mon Sep 17 00:00:00 2001 From: kat Date: Fri, 26 May 2023 10:40:40 -0400 Subject: Add a thread safety indicator for C++ docs --- api-docs/cppdocs/USEBUILDMINDOCS | 4 +- api-docs/cppdocs/_static/img/thread.png | Bin 0 -> 26740 bytes api-docs/cppdocs/build_min_docs.py | 2 + api-docs/cppdocs/custom.css | 65 ++++++++++++++++++++++++++++++++ 4 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 api-docs/cppdocs/_static/img/thread.png (limited to 'api-docs') diff --git a/api-docs/cppdocs/USEBUILDMINDOCS b/api-docs/cppdocs/USEBUILDMINDOCS index 9c33604c..e15cfe15 100644 --- a/api-docs/cppdocs/USEBUILDMINDOCS +++ b/api-docs/cppdocs/USEBUILDMINDOCS @@ -259,7 +259,7 @@ TAB_SIZE = 4 # commands \{ and \} for these it is advised to use the version @{ and @} or use # a double escape (\\{ and \\}) -ALIASES = +ALIASES = threadsafety{1}="
Thread Safe:
\1
" threadsafe="\threadsafety{Yes}" threadunsafe="\threadsafety{No}" # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For @@ -941,7 +941,7 @@ EXAMPLE_RECURSIVE = YES # that contain images that are to be included in the documentation (see the # \image command). -IMAGE_PATH = +IMAGE_PATH = _static/img # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program diff --git a/api-docs/cppdocs/_static/img/thread.png b/api-docs/cppdocs/_static/img/thread.png new file mode 100644 index 00000000..7a4d725a Binary files /dev/null and b/api-docs/cppdocs/_static/img/thread.png differ diff --git a/api-docs/cppdocs/build_min_docs.py b/api-docs/cppdocs/build_min_docs.py index 92fde5fc..00a0767b 100644 --- a/api-docs/cppdocs/build_min_docs.py +++ b/api-docs/cppdocs/build_min_docs.py @@ -148,6 +148,8 @@ def build_doxygen(): stat, out, err = system_with_output("doxygen USEBUILDMINDOCS") print(f"Built Doxygen with status code {stat}") print("Output dir is ./html/") + stat, out, err = system_with_output("cp _static/img/* html/") + print(f"Copied images with status code {stat}") def main(): diff --git a/api-docs/cppdocs/custom.css b/api-docs/cppdocs/custom.css index 11997bbe..fff8d2dc 100644 --- a/api-docs/cppdocs/custom.css +++ b/api-docs/cppdocs/custom.css @@ -107,4 +107,69 @@ a.index\.html { padding-top: 0px; right: -22px; } +} + +.memitem { + position:relative; +} + +dl.threadsafe { + position: absolute; + top: 0px; + right: 8px; + margin-top: 10px; + background-color: #434956; + font-weight: normal; + padding: 2px 10px; + border-radius: 4px; +} +.threadsafe dt { + padding-right: 35px; +} +.threadsafe.Yes dd { + display: inline!important; + margin-inline-start: 0; + position: absolute; + top: 1px; + right: 1px; + padding: 1px 6px 1px 5px; + background-color: #4e8646; + border-bottom-right-radius: 3px; + border-top-right-radius: 3px; + width: 25px; + text-align: center; +} +.threadsafe.No dd { + display: inline!important; + margin-inline-start: 0; + position: absolute; + top: 1px; + right: 1px; + padding: 1px 6px 1px 5px; + background-color: #d0584d; + border-bottom-right-radius: 3px; + border-top-right-radius: 3px; + width: 25px; + text-align: center; +} + +.light-mode dl.threadsafe { + background-color: #d0d6e2; +} +.light-mode .threadsafe.Yes dd { + background-color: #9af78c; +} +.light-mode .threadsafe.No dd { + background-color: #fb877d; +} + +img.thread { + max-width: 15px; + position: relative; + top: 2px; + padding-right: 3px; +} + +.dark-mode img.thread { + filter: invert(0.7); } \ No newline at end of file -- cgit v1.3.1