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
7 changes: 6 additions & 1 deletion scripts/board.py
Original file line number Diff line number Diff line change
Expand Up @@ -1160,6 +1160,11 @@ def _fresh_span(fresh: dict, now_text: str, stale_text: str,
hero = t_.hero(BOARD_KEY, "Dashboard", _LEDE)
stats = t_.stats((t["pages"], "Pages"), (f"{pct}%", "Cited"),
(t["todo"], "To cite"), (t["queued"], "Queued"))
# The way back from the Pages board to the repository front door; the
# segment drops out when the snapshot carries no owner/repo.
repo_url = _repo_url(snapshot)
github_link = (f' · <a href="{repo_url}/blob/main/README.md">'
"GitHub Page</a>" if repo_url else "")
return f"""<!doctype html>
<html lang="en"><head><meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
Expand All @@ -1169,7 +1174,7 @@ def _fresh_span(fresh: dict, now_text: str, stale_text: str,
<body>
{hero}
{stats}
<p class="muted mdsrc"><a href="dashboard.md">markdown version</a></p>
<p class="muted mdsrc"><a href="dashboard.md">markdown version</a>{github_link}</p>
<h2>arXiv inbox <span class="muted">(suggested overnight — un-acted papers
lapse after {inbox_actions.INBOX_WINDOW_DAYS} days)</span></h2>
{inbox_block}
Expand Down
6 changes: 6 additions & 0 deletions tests/test_board.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ def test_work_queue_prompts_reference_the_documented_workflow(tmp_path):

def test_paper_links_and_issue_actions(tmp_path):
html = board.render(_snap_with_remote(tmp_path), "html")
# the header links the markdown twin and the repository front door
assert '<a href="dashboard.md">markdown version</a>' in html
assert ('<a href="https://github.com/PyAutoLabs/PyAutoMemory/blob/main/'
'README.md">GitHub Page</a>') in html
# ref'd paper → its abstract page; bare title → an arXiv title search
assert "https://arxiv.org/abs/2406.01234" in html
assert ("https://arxiv.org/search/?searchtype=title&amp;query=Title%20One"
Expand Down Expand Up @@ -209,6 +213,8 @@ def test_badge_shape(tmp_path):
def test_html_is_self_contained(tmp_path):
out = board.render(board.collect(_tree(tmp_path)), "html")
assert out.lstrip().startswith("<!doctype html>")
# no repo identity in this snapshot → the GitHub Page segment drops out
assert "GitHub Page" not in out
assert "src=" not in out and "<link" not in out.lower()
assert "fetch(" not in out and "XMLHttpRequest" not in out
stripped = re.sub(r'data-cmd="[^"]*"', "", out)
Expand Down
Loading