Skip to content

Commit f429a4a

Browse files
authored
Merge pull request #1158 from VisLab/web_update
Revised the JSON format to account for attribute inheritance
2 parents 38ba2c9 + 6645366 commit f429a4a

File tree

11 files changed

+765
-160
lines changed

11 files changed

+765
-160
lines changed

.codeclimate.yml

Lines changed: 0 additions & 91 deletions
This file was deleted.

docs/_static/custom.css

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
/* Custom styles for HED Python Tools Documentation - Furo Theme */
2+
3+
/* Quick Links sidebar styling - darker gray box with proper padding */
4+
.sidebar-quicklinks {
5+
margin: 1rem 0.75rem 1rem 0.75rem;
6+
padding: 0.75rem 1rem;
7+
background-color: #e8e8e8;
8+
border-radius: 0.25rem;
9+
border: 1px solid #d0d0d0;
10+
}
11+
12+
/* Dark mode styling for quick links - much darker background */
13+
body[data-theme="dark"] .sidebar-quicklinks {
14+
background-color: #0d0d0d;
15+
border-color: #1a1a1a;
16+
}
17+
18+
.sidebar-quicklinks h3 {
19+
margin-top: 0;
20+
margin-bottom: 0.5rem;
21+
color: var(--color-sidebar-link-text);
22+
font-size: var(--sidebar-item-font-size);
23+
font-weight: 600;
24+
}
25+
26+
.sidebar-quicklinks ul {
27+
list-style: none;
28+
padding-left: 0;
29+
margin-bottom: 0;
30+
}
31+
32+
.sidebar-quicklinks li {
33+
margin-bottom: 0.25rem;
34+
}
35+
36+
.sidebar-quicklinks a {
37+
color: var(--color-link) !important;
38+
text-decoration: none;
39+
font-size: var(--sidebar-item-font-size);
40+
display: block;
41+
padding: 0.25rem 0;
42+
transition: color 0.2s ease;
43+
}
44+
45+
.sidebar-quicklinks a:hover {
46+
color: var(--color-link-hover) !important;
47+
text-decoration: underline;
48+
}
49+
50+
/* External link icon for quick links */
51+
.sidebar-quicklinks a[target="_blank"]::after {
52+
content: " ↗";
53+
font-size: 0.7em;
54+
opacity: 0.6;
55+
}
56+
57+
/* Make search field more visible with same background as quick links */
58+
.sidebar-search-container {
59+
margin: 0 0.75rem;
60+
}
61+
62+
.sidebar-search-container input {
63+
background-color: #e8e8e8 !important;
64+
border: 1px solid #d0d0d0 !important;
65+
color: var(--color-foreground-primary) !important;
66+
background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23666666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E") !important;
67+
background-repeat: no-repeat !important;
68+
background-position: right 0.5rem center !important;
69+
background-size: 1.2em !important;
70+
padding-right: 2.5rem !important;
71+
}
72+
73+
body[data-theme="dark"] .sidebar-search-container input {
74+
background-color: #0d0d0d !important;
75+
border: 1px solid #1a1a1a !important;
76+
color: #e8e8e8 !important;
77+
background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23cccccc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E") !important;
78+
}
79+
80+
/* Make search icon visible */
81+
.sidebar-search-container input::placeholder {
82+
color: var(--color-foreground-muted) !important;
83+
opacity: 1 !important;
84+
}
85+
86+
body[data-theme="dark"] .sidebar-search-container input::placeholder {
87+
color: #999999 !important;
88+
}
89+
90+
/* Style search icon/button visibility */
91+
.sidebar-search .icon {
92+
color: var(--color-foreground-muted) !important;
93+
}
94+
95+
body[data-theme="dark"] .sidebar-search .icon {
96+
color: #999999 !important;
97+
}
98+
99+
/* Hide view source and edit buttons in top-right header */
100+
a.muted-link[href*="_sources"],
101+
a.muted-link[title*="Edit this page"],
102+
a.muted-link[title*="View page source"],
103+
.content-icon-container a[href*="_sources"] {
104+
display: none !important;
105+
}
106+
107+
/* Ensure GitHub repository button shows as icon in top-right header */
108+
109+
/* Target the hijacked link using the class added by JS, OR the href attribute as fallback */
110+
.content-icon-container a.github-repo-link,
111+
.content-icon-container a[href*="github.com"]:not([href*="/edit/"]) {
112+
display: inline-flex !important;
113+
align-items: center !important;
114+
justify-content: center !important;
115+
width: 2rem !important;
116+
height: 2rem !important;
117+
118+
/* GitHub Icon */
119+
background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12' fill='%23666666'/%3E%3C/svg%3E") !important;
120+
background-repeat: no-repeat !important;
121+
background-position: center !important;
122+
background-size: 1.2rem !important;
123+
124+
color: transparent !important; /* Hide any text */
125+
overflow: hidden !important;
126+
}
127+
128+
/* Hide the original SVG icon inside the link */
129+
.content-icon-container a.github-repo-link svg,
130+
.content-icon-container a[href*="github.com"] svg {
131+
display: none !important;
132+
}
133+
134+
/* Dark mode icon color */
135+
body[data-theme="dark"] .content-icon-container a.github-repo-link,
136+
body[data-theme="dark"] .content-icon-container a[href*="github.com"]:not([href*="/edit/"]) {
137+
background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12' fill='%23cccccc'/%3E%3C/svg%3E") !important;
138+
}
139+
140+
/* Explicitly hide the edit link via CSS as well */
141+
.content-icon-container a[href*="/edit/"] {
142+
display: none !important;
143+
}
144+
145+
/* Logo styling - ensure visibility in both light and dark modes */
146+
.sidebar-brand-text {
147+
font-weight: 600;
148+
}
149+
150+
/* Adjust logo size if needed */
151+
.sidebar-logo {
152+
margin-bottom: 0.5rem;
153+
}
154+
155+
.sidebar-logo img {
156+
max-width: 100%;
157+
height: auto;
158+
}

docs/_static/gh_icon_fix.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
document.addEventListener("DOMContentLoaded", function() {
2+
// Function to fix the icons
3+
function fixGitHubIcons() {
4+
// Furo puts icons in .content-icon-container
5+
// We look for links that point to GitHub
6+
const links = document.querySelectorAll(".content-icon-container a");
7+
8+
links.forEach(link => {
9+
const href = link.getAttribute("href");
10+
if (!href) return;
11+
12+
// Check if it's a GitHub link (edit or blob/view)
13+
if (href.includes("github.com")) {
14+
15+
// If it's the Edit link, hide it
16+
if (href.includes("/edit/")) {
17+
link.style.display = "none";
18+
link.classList.add("hidden-edit-link"); // Marker for CSS
19+
}
20+
// If it's the View/Blob link, hijack it
21+
else if (href.includes("/blob/") || href.includes("/tree/")) {
22+
// Change URL to repo root
23+
link.href = "https://github.com/hed-standard/hed-python";
24+
link.title = "Go to repository";
25+
link.setAttribute("aria-label", "Go to repository");
26+
27+
// Remove any text content (like "View source") to ensure only icon shows
28+
// But keep the SVG if we were using the original, but we are replacing it via CSS.
29+
// Safest is to empty the text content but keep the element structure if needed.
30+
// Actually, Furo puts an SVG inside. We want to hide that SVG and show our own background.
31+
link.classList.add("github-repo-link"); // Add class for CSS targeting
32+
link.style.display = "inline-flex";
33+
}
34+
}
35+
});
36+
}
37+
38+
fixGitHubIcons();
39+
});

docs/_templates/quicklinks.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<div class="sidebar-quicklinks">
2+
<h3>Quick links</h3>
3+
<ul>
4+
<li><a href="https://www.hedtags.org/" target="_blank">HED homepage</a></li>
5+
<li><a href="https://www.hedtags.org/hed-resources" target="_blank">HED resources</a></li>
6+
<li><a href="https://www.hedtags.org/hed-schema-browser" target="_blank">HED schema browser</a></li>
7+
<li><a href="https://www.hedtags.org/hed-specification" target="_blank">HED specification</a></li>
8+
<li><a href="https://hedtools.org/hed" target="_blank">HED online tools</a></li>
9+
</ul>
10+
</div>

docs/conf.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
author = "HED Standard"
1212

1313
# The full version, including alpha/beta/rc tags
14-
release = "0.6.0"
14+
release = "0.8.0"
1515

1616
# -- General configuration ---------------------------------------------------
1717
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
@@ -34,6 +34,11 @@
3434

3535
html_theme = "furo"
3636
html_static_path = ["_static"]
37+
html_css_files = ["custom.css"]
38+
html_js_files = ["gh_icon_fix.js"]
39+
40+
# Add logo
41+
html_logo = "assets/images/croppedWideLogo.png"
3742

3843
# Furo theme options
3944
html_theme_options = {
@@ -53,6 +58,19 @@
5358

5459
html_title = "HED Python Tools"
5560

61+
# Configure sidebar to show logo, search, navigation, and quick links
62+
html_sidebars = {
63+
"**": [
64+
"sidebar/brand.html",
65+
"sidebar/search.html",
66+
"sidebar/scroll-start.html",
67+
"sidebar/navigation.html",
68+
"quicklinks.html",
69+
"sidebar/ethical-ads.html",
70+
"sidebar/scroll-end.html",
71+
]
72+
}
73+
5674
# -- Extension configuration -------------------------------------------------
5775

5876
# Napoleon settings for Google/NumPy style docstrings

0 commit comments

Comments
 (0)