Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit 7ffcedf

Browse files
authored
Fixup generated documentation (#5)
1 parent 2516cbb commit 7ffcedf

39 files changed

+338
-119
lines changed

docs/_sources/api/sdk/conference.rst.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ Other structures used by the :ref:`api_conference`, which are not defined in the
120120
.. doxygenenum:: dolbyio::comms::participant_type
121121
:project: C++ SDK
122122

123+
.. doxygenenum:: dolbyio::comms::video_codec
124+
:project: C++ SDK
125+
123126
.. doxygenenum:: dolbyio::comms::video_forwarding_strategy
124127
:project: C++ SDK
125128

docs/_sources/api/sdk/device_management.rst.txt

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,28 +24,28 @@ The :ref:`api_device_management` events that are emitted by the SDK. They can be
2424
:cpp:func:`device_management::add_event_handler <dolbyio::comms::services::device_management::add_event_handler>` methods.
2525

2626
.. doxygenstruct:: dolbyio::comms::audio_device_added
27-
:project: C++ SDK
27+
:project: C++ SDK
2828

2929
.. doxygenstruct:: dolbyio::comms::audio_device_removed
30-
:project: C++ SDK
30+
:project: C++ SDK
3131

3232
.. doxygenstruct:: dolbyio::comms::audio_device_changed
33-
:project: C++ SDK
33+
:project: C++ SDK
3434

3535
.. doxygenstruct:: dolbyio::comms::audio_device_timeout_failure
36-
:project: C++ SDK
36+
:project: C++ SDK
3737

3838
.. doxygenstruct:: dolbyio::comms::video_device_added
39-
:project: C++ SDK
39+
:project: C++ SDK
4040

4141
.. doxygenstruct:: dolbyio::comms::video_device_removed
42-
:project: C++ SDK
42+
:project: C++ SDK
4343

4444
.. doxygenstruct:: dolbyio::comms::video_device_changed
45-
:project: C++ SDK
45+
:project: C++ SDK
4646

4747
.. doxygenstruct:: dolbyio::comms::video_device_error
48-
:project: C++ SDK
48+
:project: C++ SDK
4949

5050
.. _devman_models:
5151

@@ -54,7 +54,10 @@ Device Structs
5454
Other structures used by the :ref:`api_device_management` that are not defined in the :ref:`devman_serv` interface.
5555

5656
.. doxygenclass:: dolbyio::comms::dvc_device
57-
:project: C++ SDK
57+
:project: C++ SDK
5858

5959
.. doxygenstruct:: dolbyio::comms::camera_device
60-
:project: C++ SDK
60+
:project: C++ SDK
61+
62+
.. doxygenenum:: dolbyio::comms::default_audio_device_policy
63+
:project: C++ SDK

docs/_static/basic.css

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Sphinx stylesheet -- basic theme.
66
*
7-
* :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS.
7+
* :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS.
88
* :license: BSD, see LICENSE for details.
99
*
1010
*/
@@ -324,15 +324,13 @@ aside.sidebar {
324324
p.sidebar-title {
325325
font-weight: bold;
326326
}
327-
328327
nav.contents,
329328
aside.topic,
330329
div.admonition, div.topic, blockquote {
331330
clear: left;
332331
}
333332

334333
/* -- topics ---------------------------------------------------------------- */
335-
336334
nav.contents,
337335
aside.topic,
338336
div.topic {
@@ -608,7 +606,6 @@ ol.simple p,
608606
ul.simple p {
609607
margin-bottom: 0;
610608
}
611-
612609
aside.footnote > span,
613610
div.citation > span {
614611
float: left;

docs/_static/doctools.js

Lines changed: 120 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,12 @@
44
*
55
* Base JavaScript utilities for all Sphinx HTML documentation.
66
*
7-
* :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS.
7+
* :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS.
88
* :license: BSD, see LICENSE for details.
99
*
1010
*/
1111
"use strict";
1212

13-
const BLACKLISTED_KEY_CONTROL_ELEMENTS = new Set([
14-
"TEXTAREA",
15-
"INPUT",
16-
"SELECT",
17-
"BUTTON",
18-
]);
19-
2013
const _ready = (callback) => {
2114
if (document.readyState !== "loading") {
2215
callback();
@@ -25,11 +18,73 @@ const _ready = (callback) => {
2518
}
2619
};
2720

21+
/**
22+
* highlight a given string on a node by wrapping it in
23+
* span elements with the given class name.
24+
*/
25+
const _highlight = (node, addItems, text, className) => {
26+
if (node.nodeType === Node.TEXT_NODE) {
27+
const val = node.nodeValue;
28+
const parent = node.parentNode;
29+
const pos = val.toLowerCase().indexOf(text);
30+
if (
31+
pos >= 0 &&
32+
!parent.classList.contains(className) &&
33+
!parent.classList.contains("nohighlight")
34+
) {
35+
let span;
36+
37+
const closestNode = parent.closest("body, svg, foreignObject");
38+
const isInSVG = closestNode && closestNode.matches("svg");
39+
if (isInSVG) {
40+
span = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
41+
} else {
42+
span = document.createElement("span");
43+
span.classList.add(className);
44+
}
45+
46+
span.appendChild(document.createTextNode(val.substr(pos, text.length)));
47+
parent.insertBefore(
48+
span,
49+
parent.insertBefore(
50+
document.createTextNode(val.substr(pos + text.length)),
51+
node.nextSibling
52+
)
53+
);
54+
node.nodeValue = val.substr(0, pos);
55+
56+
if (isInSVG) {
57+
const rect = document.createElementNS(
58+
"http://www.w3.org/2000/svg",
59+
"rect"
60+
);
61+
const bbox = parent.getBBox();
62+
rect.x.baseVal.value = bbox.x;
63+
rect.y.baseVal.value = bbox.y;
64+
rect.width.baseVal.value = bbox.width;
65+
rect.height.baseVal.value = bbox.height;
66+
rect.setAttribute("class", className);
67+
addItems.push({ parent: parent, target: rect });
68+
}
69+
}
70+
} else if (node.matches && !node.matches("button, select, textarea")) {
71+
node.childNodes.forEach((el) => _highlight(el, addItems, text, className));
72+
}
73+
};
74+
const _highlightText = (thisNode, text, className) => {
75+
let addItems = [];
76+
_highlight(thisNode, addItems, text, className);
77+
addItems.forEach((obj) =>
78+
obj.parent.insertAdjacentElement("beforebegin", obj.target)
79+
);
80+
};
81+
2882
/**
2983
* Small JavaScript module for the documentation.
3084
*/
3185
const Documentation = {
3286
init: () => {
87+
Documentation.highlightSearchWords();
3388
Documentation.initDomainIndexTable();
3489
Documentation.initOnKeyListeners();
3590
},
@@ -71,6 +126,51 @@ const Documentation = {
71126
Documentation.LOCALE = catalog.locale;
72127
},
73128

129+
/**
130+
* highlight the search words provided in the url in the text
131+
*/
132+
highlightSearchWords: () => {
133+
const highlight =
134+
new URLSearchParams(window.location.search).get("highlight") || "";
135+
const terms = highlight.toLowerCase().split(/\s+/).filter(x => x);
136+
if (terms.length === 0) return; // nothing to do
137+
138+
// There should never be more than one element matching "div.body"
139+
const divBody = document.querySelectorAll("div.body");
140+
const body = divBody.length ? divBody[0] : document.querySelector("body");
141+
window.setTimeout(() => {
142+
terms.forEach((term) => _highlightText(body, term, "highlighted"));
143+
}, 10);
144+
145+
const searchBox = document.getElementById("searchbox");
146+
if (searchBox === null) return;
147+
searchBox.appendChild(
148+
document
149+
.createRange()
150+
.createContextualFragment(
151+
'<p class="highlight-link">' +
152+
'<a href="javascript:Documentation.hideSearchWords()">' +
153+
Documentation.gettext("Hide Search Matches") +
154+
"</a></p>"
155+
)
156+
);
157+
},
158+
159+
/**
160+
* helper function to hide the search marks again
161+
*/
162+
hideSearchWords: () => {
163+
document
164+
.querySelectorAll("#searchbox .highlight-link")
165+
.forEach((el) => el.remove());
166+
document
167+
.querySelectorAll("span.highlighted")
168+
.forEach((el) => el.classList.remove("highlighted"));
169+
const url = new URL(window.location);
170+
url.searchParams.delete("highlight");
171+
window.history.replaceState({}, "", url);
172+
},
173+
74174
/**
75175
* helper function to focus on search bar
76176
*/
@@ -110,11 +210,15 @@ const Documentation = {
110210
)
111211
return;
112212

213+
const blacklistedElements = new Set([
214+
"TEXTAREA",
215+
"INPUT",
216+
"SELECT",
217+
"BUTTON",
218+
]);
113219
document.addEventListener("keydown", (event) => {
114-
// bail for input elements
115-
if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return;
116-
// bail with special keys
117-
if (event.altKey || event.ctrlKey || event.metaKey) return;
220+
if (blacklistedElements.has(document.activeElement.tagName)) return; // bail for input elements
221+
if (event.altKey || event.ctrlKey || event.metaKey) return; // bail with special keys
118222

119223
if (!event.shiftKey) {
120224
switch (event.key) {
@@ -136,6 +240,10 @@ const Documentation = {
136240
event.preventDefault();
137241
}
138242
break;
243+
case "Escape":
244+
if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) break;
245+
Documentation.hideSearchWords();
246+
event.preventDefault();
139247
}
140248
}
141249

docs/_static/graphviz.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Sphinx stylesheet -- graphviz extension.
66
*
7-
* :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS.
7+
* :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS.
88
* :license: BSD, see LICENSE for details.
99
*
1010
*/

docs/_static/language_data.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* This script contains the language-specific data used by searchtools.js,
66
* namely the list of stopwords, stemmer, scorer and splitter.
77
*
8-
* :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS.
8+
* :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS.
99
* :license: BSD, see LICENSE for details.
1010
*
1111
*/

0 commit comments

Comments
 (0)