summaryrefslogtreecommitdiff
path: root/api-docs
diff options
context:
space:
mode:
authorkat <kat@vector35.com>2023-05-26 10:40:40 -0400
committerkat <kat@vector35.com>2023-05-26 11:07:22 -0400
commita05596610bbbe9274d9300882fbbbfb41eec107d (patch)
treefeb0e15a6c908bd1a65e0d3dd5226bd44782534d /api-docs
parentf8ba38091323f7e3402bd73bb1e53ac358696dd0 (diff)
Add a thread safety indicator for C++ docs
Diffstat (limited to 'api-docs')
-rw-r--r--api-docs/cppdocs/USEBUILDMINDOCS4
-rw-r--r--api-docs/cppdocs/_static/img/thread.pngbin0 -> 26740 bytes
-rw-r--r--api-docs/cppdocs/build_min_docs.py2
-rw-r--r--api-docs/cppdocs/custom.css65
4 files changed, 69 insertions, 2 deletions
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}="<dl class=\"threadsafe \1\"><dt><img class=\"thread\" src=\"thread.png\"> Thread Safe: <dd>\1</dd></dt></dl>" 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
--- /dev/null
+++ b/api-docs/cppdocs/_static/img/thread.png
Binary files 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