Skip to content

Commit

Permalink
Fix website env pages
Browse files Browse the repository at this point in the history
  • Loading branch information
pseudo-rnd-thoughts committed Jan 11, 2025
1 parent 023d387 commit 8e52dc5
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 40 deletions.
1 change: 0 additions & 1 deletion docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
environments/**/*.md
content/env_list.html
27 changes: 13 additions & 14 deletions docs/_scripts/gen_envs_display.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,26 @@
def create_grid_cell(env_id):
env_name = env_id.split("-")[-2]
return f"""
<a href="{env_name.lower()}">
<div class="env-grid__cell">
<div class="cell__image-container">
<img src="/_static/environments/{env_name.lower()}.jpg">
</div>
<div class="cell__title">
<span>{env_name}</span>
</div>
</div>
</a>
"""
<a href="{env_name.lower()}">
<div class="env-grid__cell">
<div class="cell__image-container">
<img src="/_static/environments/{env_name.lower()}.jpg">
</div>
<div class="cell__title">
<span>{env_name}</span>
</div>
</div>
</a>"""


def generate_page(env_list):
cells = [create_grid_cell(env_id) for env_id in env_list]
cells = "\n".join(cells)

return f"""
<div class="env-grid">
return f"""<div class="env-grid">
{cells}
</div>
"""
"""


if __name__ == "__main__":
Expand All @@ -58,6 +56,7 @@ def generate_page(env_list):
"environments",
"env_list.html",
)
print(file_path)

res = generate_page(filtered_env_ids)

Expand Down
24 changes: 0 additions & 24 deletions docs/content/environments.md

This file was deleted.

24 changes: 24 additions & 0 deletions docs/environments/environments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Environments

```{toctree}
:hidden:
collecthealth
fourrooms
hallway
maze
oneroom
pickupobjects
putnext
roomobjects
sidewalk
sign
threerooms
tmaze
wallgap
ymaze
```

```{raw} html
:file: env_list.html
```
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ lastpage:
content/design
content/troubleshooting
content/create_env
content/environments
environments/environments
```

```{toctree}
Expand Down

0 comments on commit 8e52dc5

Please sign in to comment.