Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 1 addition & 7 deletions scripts/organism_board.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,12 +316,6 @@ def _render_html(snapshot: dict) -> str:
{"href": b["url"], "label": b["name"]}
for b in snapshot.get("boards") or [] if b.get("url")
])
# The way back from the Pages board to the repository front door; the
# owner comes from the snapshot (the git remote), so the segment drops
# out when the origin is unknown.
gh_owner = snapshot.get("owner")
github_link = (f' · <a href="https://github.com/{gh_owner}/PyAutoScientist'
'/blob/main/README.md">GitHub Page</a>' if gh_owner else "")
# Brain's shared layout puts the slogan panel above the navigation cards
# and folds the titled section into a collapsed native disclosure; the
# verdict banner stays outside it so the routing answer is always visible.
Expand All @@ -339,7 +333,7 @@ def _render_html(snapshot: dict) -> str:
<h2 id="{SECTION_ID}">Organ dashboards</h2>
{''.join(rows)}
</section>
<p class="muted mdsrc"><a href="dashboard.md">markdown version</a>{github_link}</p>
<p class="muted mdsrc"><a href="dashboard.md">markdown version</a></p>
<footer>Rendered by <code>scripts/organism_board.py</code> from the boards'
own published headlines · generated {_html.escape(str(snapshot.get('generated') or '?'))}.</footer>
<script>{t.JS}</script>
Expand Down
7 changes: 3 additions & 4 deletions tests/test_organism_board.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,9 @@ def test_badge_carries_verdict_and_backlog():
def test_html_is_self_contained_with_door_chips():
out = ob.render(_snap(), "html")
assert out.lstrip().startswith("<!doctype html>")
# the header links the markdown twin and the repository front door
assert '<a href="dashboard.md">markdown version</a>' in out
assert ('<a href="https://github.com/SomeOrg/PyAutoScientist/blob/main/'
'README.md">GitHub Page</a>') in out
# Keep the Markdown source without the redundant repository link.
assert 'href="dashboard.md"' in out
assert 'GitHub Page</a>' not in out
assert "Use the health skill." in out and "Use the start-dev skill." in out and "data-cmd=" in out
assert "src=" not in out and "<link" not in out.lower()
assert "fetch(" not in out and "XMLHttpRequest" not in out
Expand Down
Loading