Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
faa6bb0
first implementation
RemDelaporteMathurin Apr 29, 2026
dedff13
update CSS
RemDelaporteMathurin Apr 29, 2026
da7a869
dark mode greyscale images
RemDelaporteMathurin Apr 29, 2026
c52b515
raw html for navigation
RemDelaporteMathurin Apr 29, 2026
303ecb9
try removing unwanted background in dark mode
RemDelaporteMathurin Apr 29, 2026
447046c
added images to gallery
RemDelaporteMathurin Apr 29, 2026
4d7bb98
removed double title
RemDelaporteMathurin Apr 29, 2026
837d9ae
improved why FESTIM
RemDelaporteMathurin Apr 29, 2026
558f708
improve citing section
RemDelaporteMathurin Apr 29, 2026
51b6d9f
added favicon
RemDelaporteMathurin Apr 29, 2026
6a80bd8
text coloured festim
RemDelaporteMathurin Apr 29, 2026
bcbcea4
update citation
RemDelaporteMathurin Apr 29, 2026
8cbce5d
added title
RemDelaporteMathurin Apr 29, 2026
5b2b05f
fixed equation
RemDelaporteMathurin Apr 29, 2026
a293c67
added Rochester
RemDelaporteMathurin Apr 29, 2026
abbb6f5
fixed more eqs
RemDelaporteMathurin Apr 29, 2026
812d9e4
added more colours
RemDelaporteMathurin Apr 29, 2026
9da4e54
two lines for ribbon
RemDelaporteMathurin Apr 29, 2026
995c2da
colour for nav card in dark mode
RemDelaporteMathurin Apr 29, 2026
53b0865
bigger icons
RemDelaporteMathurin Apr 29, 2026
5a1e04a
removed permeation
RemDelaporteMathurin Apr 29, 2026
83812f9
Merge remote-tracking branch 'origin/main' into update-homepage
RemDelaporteMathurin Apr 29, 2026
e878df3
update detection
RemDelaporteMathurin Apr 29, 2026
ae0e267
added specific link to issue
RemDelaporteMathurin Apr 29, 2026
4ce10dc
added comments
RemDelaporteMathurin Apr 29, 2026
6fa284d
correct indent
RemDelaporteMathurin Apr 29, 2026
cfd65d8
remove branch
RemDelaporteMathurin Apr 29, 2026
46a68a3
form instead of issue
RemDelaporteMathurin Apr 29, 2026
7db06b0
svg colours in dark mode
RemDelaporteMathurin Apr 29, 2026
e794cbb
don't show prev_next
RemDelaporteMathurin Apr 29, 2026
d66e0f5
lighter colours for community buttons
RemDelaporteMathurin Apr 29, 2026
daf930e
override secondary theme colour
RemDelaporteMathurin Apr 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 63 additions & 36 deletions .github/scripts/add_institution.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ def main():
short_name = extract_field(body, "Short name or acronym")
logo_url = extract_image_url(body)

print(f"Parsed name: {name}")
print(f"Parsed short_name: {short_name}")
print(f"Parsed logo_url: {logo_url}")

if not name or not logo_url:
print("ERROR: Could not parse institution name or logo URL")
exit(1)
Expand All @@ -26,11 +30,25 @@ def main():
os.makedirs(logo_dir, exist_ok=True)
logo_path = os.path.join(logo_dir, filename)

response = requests.get(logo_url)
response = requests.get(logo_url, allow_redirects=True)
response.raise_for_status()
with open(logo_path, "wb") as f:
f.write(response.content)

# Detect actual content type if URL had no extension
if filename.endswith(".png"):
content_type = response.headers.get("Content-Type", "")
if "svg" in content_type:
new_filename = filename[:-4] + ".svg"
os.rename(logo_path, os.path.join(logo_dir, new_filename))
filename = new_filename
logo_path = os.path.join(logo_dir, filename)
elif "jpeg" in content_type or "jpg" in content_type:
new_filename = filename[:-4] + ".jpg"
os.rename(logo_path, os.path.join(logo_dir, new_filename))
filename = new_filename
logo_path = os.path.join(logo_dir, filename)

print(f"Downloaded logo to {logo_path}")

# Update index.rst
Expand All @@ -43,50 +61,44 @@ def main():
f' <img src="_static/logos/{filename}" alt="{short_name}" title="{name}">'
)

# Insert before the duplicate comment in the first ribbon track
# Find the first "<!-- Duplicate for seamless loop -->" and insert before it
marker = "<!-- Duplicate for seamless loop -->"
# Find all duplicate markers
marker = " <!-- Duplicate for seamless loop -->"
first_marker = content.find(marker)
second_marker = content.find(marker, first_marker + 1)

if first_marker == -1:
print("ERROR: Could not find duplicate marker in index.rst")
exit(1)

# Determine which row has fewer logos (count img tags before each marker)
second_marker = content.find(marker, first_marker + 1)
# Count logos in each row to decide where to add
row1_section = content[:first_marker]
row2_section = content[first_marker:second_marker] if second_marker != -1 else ""

row1_count = row1_section.count('<img src="_static/logos/')
row2_count = row2_section.count('<img src="_static/logos/')

if second_marker != -1 and row2_count < row1_count:
# Add to second row
insert_pos = second_marker
if second_marker != -1:
row2_section = content[first_marker:second_marker]
row2_count = row2_section.count('<img src="_static/logos/')
else:
# Add to first row
insert_pos = first_marker
row2_count = row1_count # fallback: add to row 1

# Insert the logo line (and its duplicate after the marker)
indent_and_newline = "\n"
insertion = logo_html + indent_and_newline + " " + indent_and_newline
# Choose the row with fewer logos
if second_marker != -1 and row2_count < row1_count:
target_marker = second_marker
else:
target_marker = first_marker

# Find the marker after the chosen insert position
target_marker_pos = content.find(
marker, insert_pos if insert_pos == first_marker else second_marker
)
# Insert before the marker (original set)
content = content[:target_marker] + logo_html + "\n" + content[target_marker:]

# Insert before marker
content = content[:insert_pos] + logo_html + "\n " + content[insert_pos:]
# Recalculate marker position after insertion
marker_pos = content.find(marker, target_marker)
after_marker = marker_pos + len(marker)

# Also insert after the duplicate section (for seamless loop)
# Find the closing </div> of the track after the marker
after_marker = content.find(marker, insert_pos) + len(marker)
# Find end of duplicated logos (next </div>)
track_end = content.find("</div>", after_marker)
# Find the closing </div> of this track
track_end_marker = " </div>"
track_end = content.find(track_end_marker, after_marker)

# Insert before the </div>
content = content[:track_end] + logo_html + "\n " + content[track_end:]
# Insert before </div> (duplicate set)
content = content[:track_end] + logo_html + "\n" + content[track_end:]

with open(index_path, "w") as f:
f.write(content)
Expand All @@ -96,23 +108,37 @@ def main():

def extract_field(body, label):
"""Extract a field value from the issue form body."""
# GitHub issue forms format: ### Label\n\nValue\n
pattern = rf"### {re.escape(label)}\s*\n\s*\n(.+?)(?=\n\s*\n###|\Z)"
pattern = rf"###\s*{re.escape(label)}\s*\n\s*\n(.+?)(?=\n\s*\n###|\n\s*\n\s*$|\Z)"
match = re.search(pattern, body, re.DOTALL)
if match:
return match.group(1).strip()
value = match.group(1).strip()
# Remove any HTML tags (in case the value contains them)
value = re.sub(r"<[^>]+>", "", value).strip()
return value if value else None
return None


def extract_image_url(body):
"""Extract the first image URL from the issue body."""
# GitHub-hosted images
pattern = r"https://(?:user-images\.githubusercontent\.com|github\.com)[^\s\)\]]*\.(?:png|jpg|jpeg|svg|gif)"
# HTML img tag (GitHub drag-and-drop renders as <img> tags)
pattern = r'<img[^>]+src=["\']([^"\']+)["\']'
match = re.search(pattern, body, re.IGNORECASE)
if match:
return match.group(1)

# GitHub user-attachments URLs (no file extension)
pattern = r"https://github\.com/user-attachments/assets/[^\s\"\'\)<]+"
match = re.search(pattern, body)
if match:
return match.group(0)

# GitHub user-images URLs (with file extension)
pattern = r"https://user-images\.githubusercontent\.com/[^\s\)\]]+"
match = re.search(pattern, body)
if match:
return match.group(0)

# Also try markdown image syntax
# Markdown image syntax
pattern = r"!\[.*?\]\((https?://[^\s\)]+)\)"
match = re.search(pattern, body)
if match:
Expand All @@ -127,6 +153,7 @@ def get_extension(url):
ext = os.path.splitext(path)[1].lower()
if ext in (".png", ".jpg", ".jpeg", ".svg", ".gif"):
return ext
# Default to .png for extensionless URLs (like user-attachments)
return ".png"


Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/add-institution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
# for testing, remove this once update-homepage is merged
with:
ref: update-homepage

- name: Set up Python
uses: actions/setup-python@v5
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ instance/

# Sphinx documentation
docs/*/_build/
docs/*/_static/
# docs/*/_static/
docs/*/_templates/

# PyBuilder
Expand Down Expand Up @@ -116,7 +116,7 @@ venv.bak/

# Docs files
docs/source/_build/
docs/source/_static/
# docs/source/_static/

# Visual Studio Code settings
.vscode/
Binary file added docs/source/_static/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/gallery/arc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/gallery/fitting_tds.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/gallery/hx.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/gallery/microstructure.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/gallery/monoblock.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/gallery/openmc_coupling.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/gallery/probe.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/gallery/tds.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/source/_static/logos/rochester.svg
Loading
Loading