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: 8 additions & 0 deletions src/vfbquery/api_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,14 @@ def build_docs_spec(version, query_types=None, catmaid_commands=None):
.ep .body .ep{margin:12px 0;background:var(--bg)}
footer{border-top:1px solid var(--line);margin-top:40px;padding:22px 20px;color:var(--muted);font-size:13px;text-align:center}
</style>
<!-- Google Analytics (main VFB GA4 property) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-K7DDZVVXM7"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-K7DDZVVXM7');
</script>
</head>
<body>
<header><div class="nav">
Expand Down
8 changes: 6 additions & 2 deletions tests/test_api_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,12 @@ def test_html_is_self_contained():
assert "renderCatmaidCommands" in html
assert "ep-catmaid-commands" in html
assert "catmaidCommandEndpoint" in html
# Self-contained: no external scripts, styles or images.
assert 'src="http' not in html and "src='http" not in html
# Self-contained: no external scripts, styles or images - the one
# exception is the main VFB Google Analytics tag.
ga_src = 'src="https://www.googletagmanager.com/gtag/js?id=G-K7DDZVVXM7"'
assert html.count(ga_src) == 1
without_ga = html.replace(ga_src, "")
assert 'src="http' not in without_ga and "src='http" not in without_ga
assert '<link' not in html
assert html.lstrip().startswith("<!DOCTYPE html>")

Expand Down
Loading