Skip to content

Commit 391a0db

Browse files
authored
Doc: Add footer with link to slack/issues (#236)
1 parent 15c5685 commit 391a0db

File tree

8 files changed

+222
-2
lines changed

8 files changed

+222
-2
lines changed

FOOTER_IMPLEMENTATION_SUMMARY.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Footer Implementation Summary
2+
3+
## What was implemented
4+
5+
A navigation footer similar to the one in SWE-agent commit 9a8f53c009227e7e3a796c9af89cba11cbbece5e has been successfully added to the mini-swe-agent project.
6+
7+
## Files created/modified:
8+
9+
1. **docs/_footer.md** - Contains the footer HTML with navigation cards
10+
- Links to GitHub issues for bug reports
11+
- Links to Slack for discussions
12+
- Uses Material Icons for visual elements
13+
14+
2. **docs/css/navigation_cards.css** - CSS styling for the navigation cards
15+
- Hover effects with shadow and transform
16+
- Responsive design using CSS variables
17+
- Clean, modern card-based layout
18+
19+
3. **mkdocs.yml** - Updated configuration
20+
- Added Material Icons font from Google Fonts
21+
- Added navigation_cards.css to extra_css
22+
- Maintains existing CSS files
23+
24+
4. **Documentation pages updated**:
25+
- docs/index.md
26+
- docs/usage.md
27+
- docs/installation.md
28+
- All now include the footer using `{% include-markdown "_footer.md" %}`
29+
30+
## Features:
31+
- ✅ Responsive navigation cards with hover effects
32+
- ✅ Material Icons integration
33+
- ✅ Links to GitHub issues and Slack
34+
- ✅ Consistent styling with the project theme
35+
- ✅ Successfully builds with MkDocs
36+
- ✅ Footer appears on main documentation pages
37+
38+
## Testing:
39+
- All required files exist
40+
- MkDocs configuration is correct
41+
- Footer content includes expected elements
42+
- Pages properly include the footer
43+
- Site builds successfully
44+
- Generated HTML contains the footer elements
45+
- CSS and fonts are properly loaded
46+
47+
The implementation is complete and ready for use!

docs/_footer.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<div class="grid cards">
2+
<a href="https://github.com/SWE-agent/swe-rex/issues/new" class="nav-card-link">
3+
<div class="nav-card">
4+
<div class="nav-card-header">
5+
<span class="material-icons nav-card-icon">bug_report</span>
6+
<span class="nav-card-title">Something broken/unclear?</span>
7+
</div>
8+
<p class="nav-card-description">Open an issue on GitHub!</p>
9+
</div>
10+
</a>
11+
12+
<a href="https://join.slack.com/t/swe-bench/shared_invite/zt-36pj9bu5s-o3_yXPZbaH2wVnxnss1EkQ" class="nav-card-link">
13+
<div class="nav-card">
14+
<div class="nav-card-header">
15+
<span class="material-icons nav-card-icon">help</span>
16+
<span class="nav-card-title">Open-ended discussions</span>
17+
</div>
18+
<p class="nav-card-description">Join our Slack!</p>
19+
</div>
20+
</a>
21+
</div>

docs/css/navigation_cards.css

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/* Navigation cards styling */
2+
.nav-card-link {
3+
text-decoration: none;
4+
color: inherit;
5+
display: block;
6+
}
7+
8+
.nav-card {
9+
padding: 1rem;
10+
border: 1px solid var(--md-default-fg-color--lighter);
11+
border-radius: 0.5rem;
12+
transition:
13+
box-shadow 0.2s,
14+
transform 0.2s;
15+
}
16+
17+
.nav-card:hover {
18+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
19+
transform: translateY(-2px);
20+
}
21+
22+
.nav-card-header {
23+
display: flex;
24+
align-items: center;
25+
margin-bottom: 0.5rem;
26+
}
27+
28+
.nav-card-icon {
29+
margin-right: 0.5rem;
30+
font-size: 1.2rem;
31+
color: var(--md-default-fg-color);
32+
}
33+
34+
.nav-card-description {
35+
margin: 0;
36+
color: var(--md-default-fg-color--light);
37+
}
38+
39+
.nav-card-title {
40+
margin: 0;
41+
font-weight: bold;
42+
color: var(--md-default-fg-color);
43+
}

docs/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,5 @@ Using SWE-ReX, we
3131

3232

3333
[SWE-agent]: https://swe-agent.com
34-
[enigma]: https://enigma-agent.com
34+
[enigma]: https://enigma-agent.com
35+
{% include-markdown "_footer.md" %}

docs/installation.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,5 @@ If you want to contribute, please also use [pre-commit](https://pre-commit.com/)
2525
```bash
2626
pre-commit install
2727
```
28+
29+
{% include-markdown "_footer.md" %}

docs/usage.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,4 +120,5 @@ stdout='Hello, world!\n' stderr='' exit_code=0
120120
output='' exit_code=0 failure_reason='' expect_string='SHELLPS1PREFIX' session_type='bash'
121121
output='test\n' exit_code=0 failure_reason='' expect_string='SHELLPS1PREFIX' session_type='bash'
122122
🦖 DEBUG Ensuring deployment is stopped because object is deleted
123-
```
123+
```
124+
{% include-markdown "_footer.md" %}

mkdocs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ repo_url: https://github.com/SWE-agent/SWE-ReX
108108
repo_name: SWE-agent/SWE-ReX
109109
edit_uri: edit/main/docs/
110110
extra_css:
111+
- https://fonts.googleapis.com/icon?family=Material+Icons
112+
- css/navigation_cards.css
111113
- css/custom.css
112114
- css/mkdocstrings.css
113115
- css/bubbles.css

test_footer.py

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
#!/usr/bin/env python3
2+
"""Test script to verify the footer implementation."""
3+
4+
import sys
5+
from pathlib import Path
6+
7+
8+
def test_footer_files_exist():
9+
"""Test that all required footer files exist."""
10+
required_files = ["docs/_footer.md", "docs/css/navigation_cards.css", "mkdocs.yml"]
11+
12+
for file_path in required_files:
13+
if not Path(file_path).exists():
14+
print(f"❌ Missing required file: {file_path}")
15+
return False
16+
else:
17+
print(f"✅ Found required file: {file_path}")
18+
19+
return True
20+
21+
22+
def test_mkdocs_config():
23+
"""Test that mkdocs.yml contains the required configuration."""
24+
with open("mkdocs.yml") as f:
25+
content = f.read()
26+
27+
required_items = [
28+
"https://fonts.googleapis.com/icon?family=Material+Icons",
29+
"css/navigation_cards.css",
30+
"include-markdown",
31+
]
32+
33+
for item in required_items:
34+
if item in content:
35+
print(f"✅ Found in mkdocs.yml: {item}")
36+
else:
37+
print(f"❌ Missing in mkdocs.yml: {item}")
38+
return False
39+
40+
return True
41+
42+
43+
def test_footer_content():
44+
"""Test that footer contains expected content."""
45+
with open("docs/_footer.md") as f:
46+
content = f.read()
47+
48+
expected_elements = ["nav-card", "material-icons", "bug_report", "help", "GitHub", "Slack"]
49+
50+
for element in expected_elements:
51+
if element in content:
52+
print(f"✅ Found in footer: {element}")
53+
else:
54+
print(f"❌ Missing in footer: {element}")
55+
return False
56+
57+
return True
58+
59+
60+
def test_pages_include_footer():
61+
"""Test that main pages include the footer."""
62+
pages_to_check = ["docs/index.md", "docs/usage.md", "docs/installation.md"]
63+
64+
for page in pages_to_check:
65+
if Path(page).exists():
66+
with open(page) as f:
67+
content = f.read()
68+
69+
if '{% include-markdown "_footer.md" %}' in content:
70+
print(f"✅ Footer included in: {page}")
71+
else:
72+
print(f"❌ Footer missing in: {page}")
73+
return False
74+
else:
75+
print(f"⚠️ Page not found: {page}")
76+
77+
return True
78+
79+
80+
def main():
81+
"""Run all tests."""
82+
print("🧪 Testing footer implementation...")
83+
print("=" * 50)
84+
85+
tests = [test_footer_files_exist, test_mkdocs_config, test_footer_content, test_pages_include_footer]
86+
87+
all_passed = True
88+
for test in tests:
89+
print(f"\n📋 Running {test.__name__}...")
90+
if not test():
91+
all_passed = False
92+
93+
print("\n" + "=" * 50)
94+
if all_passed:
95+
print("🎉 All tests passed! Footer implementation looks good.")
96+
return 0
97+
else:
98+
print("❌ Some tests failed. Please check the output above.")
99+
return 1
100+
101+
102+
if __name__ == "__main__":
103+
sys.exit(main())

0 commit comments

Comments
 (0)