comparison COBRAxy/docs/index.html @ 542:fcdbc81feb45 draft

Uploaded
author francesco_lapi
date Sun, 26 Oct 2025 19:27:41 +0000
parents 4ed95023af20
children
comparison
equal deleted inserted replaced
541:fa93040a75af 542:fcdbc81feb45
32 32
33 .sidebar-nav a:hover { 33 .sidebar-nav a:hover {
34 color: var(--theme-color); 34 color: var(--theme-color);
35 } 35 }
36 36
37 /* Main category styling - bold and larger */
38 .sidebar-nav > ul > li > a,
39 .sidebar-nav > ul > li > strong > a {
40 font-weight: 700 !important;
41 font-size: 1.1em !important;
42 color: var(--theme-color) !important;
43 text-transform: uppercase;
44 letter-spacing: 0.5px;
45 margin-top: 1em;
46 display: block;
47 }
48
49 /* Sub-items styling - normal weight and smaller */
50 .sidebar-nav > ul > li > ul > li > a {
51 font-weight: 400 !important;
52 font-size: 0.95em !important;
53 color: var(--text-color-base) !important;
54 padding-left: 1.5em;
55 }
56
57 /* Collapsible arrows */
58 .sidebar-nav > ul > li.folder > a::before {
59 content: '▶';
60 display: inline-block;
61 margin-right: 0.5em;
62 transition: transform 0.2s;
63 font-size: 0.7em;
64 }
65
66 .sidebar-nav > ul > li.folder.open > a::before {
67 transform: rotate(90deg);
68 }
69
70 /* Hide sub-items by default */
71 .sidebar-nav > ul > li.folder > ul {
72 display: none;
73 }
74
75 .sidebar-nav > ul > li.folder.open > ul {
76 display: block;
77 }
78
37 .app-name-link { 79 .app-name-link {
38 color: var(--theme-color) !important; 80 color: var(--theme-color) !important;
39 font-weight: 600; 81 font-weight: 600;
40 } 82 }
41 83
100 loadSidebar: true, 142 loadSidebar: true,
101 loadNavbar: false, 143 loadNavbar: false,
102 subMaxLevel: 3, 144 subMaxLevel: 3,
103 auto2top: true, 145 auto2top: true,
104 146
147 // Sidebar configuration
148 alias: {
149 '/.*/_sidebar.md': '/_sidebar.md'
150 },
151 sidebarDisplayLevel: 1, // Expand sidebar to level 1 by default
152
105 // Search plugin 153 // Search plugin
106 search: { 154 search: {
107 maxAge: 86400000, // Expiration time, the default one day 155 maxAge: 86400000, // Expiration time, the default one day
108 paths: 'auto', 156 paths: 'auto',
109 placeholder: 'Search documentation...', 157 placeholder: 'Search documentation...',
158 <script src="//cdn.jsdelivr.net/npm/prismjs@1/components/prism-bash.min.js"></script> 206 <script src="//cdn.jsdelivr.net/npm/prismjs@1/components/prism-bash.min.js"></script>
159 <script src="//cdn.jsdelivr.net/npm/prismjs@1/components/prism-python.min.js"></script> 207 <script src="//cdn.jsdelivr.net/npm/prismjs@1/components/prism-python.min.js"></script>
160 <script src="//cdn.jsdelivr.net/npm/prismjs@1/components/prism-yaml.min.js"></script> 208 <script src="//cdn.jsdelivr.net/npm/prismjs@1/components/prism-yaml.min.js"></script>
161 <script src="//cdn.jsdelivr.net/npm/prismjs@1/components/prism-xml.min.js"></script> 209 <script src="//cdn.jsdelivr.net/npm/prismjs@1/components/prism-xml.min.js"></script>
162 <script src="//cdn.jsdelivr.net/npm/prismjs@1/components/prism-json.min.js"></script> 210 <script src="//cdn.jsdelivr.net/npm/prismjs@1/components/prism-json.min.js"></script>
211
212 <!-- Sidebar collapse script -->
213 <script>
214 window.addEventListener('load', function() {
215 // Wait for sidebar to be rendered
216 setTimeout(function() {
217 const sidebar = document.querySelector('.sidebar-nav');
218 if (!sidebar) return;
219
220 // Mark items with sub-lists as folders
221 const items = sidebar.querySelectorAll('ul > li');
222 items.forEach(item => {
223 const hasSublist = item.querySelector('ul');
224 if (hasSublist) {
225 item.classList.add('folder');
226
227 // Get the main link
228 const mainLink = item.querySelector('a');
229 if (mainLink) {
230 // Create a toggle button for the arrow
231 const arrow = mainLink.querySelector('::before') || mainLink;
232
233 // Add click handler that allows navigation but also toggles on second click
234 let clickCount = 0;
235 let clickTimer = null;
236
237 mainLink.addEventListener('click', function(e) {
238 clickCount++;
239
240 if (clickCount === 1) {
241 // First click: navigate to the page
242 clickTimer = setTimeout(function() {
243 clickCount = 0;
244 }, 300);
245 // Don't prevent default, allow navigation
246 item.classList.add('open');
247 } else if (clickCount === 2) {
248 // Second click: toggle the folder
249 clearTimeout(clickTimer);
250 clickCount = 0;
251 e.preventDefault();
252 item.classList.toggle('open');
253 }
254 });
255 }
256 }
257 });
258
259 // Open the active section by default
260 const activeLink = sidebar.querySelector('li.active');
261 if (activeLink) {
262 let parent = activeLink.parentElement;
263 while (parent && parent.tagName === 'UL') {
264 const parentLi = parent.parentElement;
265 if (parentLi && parentLi.classList.contains('folder')) {
266 parentLi.classList.add('open');
267 }
268 parent = parentLi ? parentLi.parentElement : null;
269 }
270 }
271 }, 300);
272 });
273 </script>
163 </body> 274 </body>
164 </html> 275 </html>