File: base.html

package info (click to toggle)
sqlite-utils 3.38-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,544 kB
  • sloc: python: 14,245; makefile: 33; ansic: 26; javascript: 21; sh: 5
file content (37 lines) | stat: -rw-r--r-- 1,148 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{%- extends "!base.html" %}

{% block scripts %}
{{ super() }}
<style type="text/css">
.highlight-output .highlight {
  border-left: 9px solid #30c94f;
}
</style>
<script>
document.addEventListener("DOMContentLoaded", function() {
  // Show banner linking to /stable/ if this is a /latest/ page
  if (!/\/latest\//.test(location.pathname)) {
    return;
  }
  var stableUrl = location.pathname.replace("/latest/", "/stable/");
  // Check it's not a 404
  fetch(stableUrl, { method: "HEAD" }).then((response) => {
    if (response.status === 200) {
      var warning = document.createElement("div");
      warning.className = "admonition warning";
      warning.innerHTML = `
        <p class="first admonition-title">Note</p>
        <p class="last">
          This documentation covers the <strong>development version</strong> of Datasette.
        </p>
        <p>
          See <a href="${stableUrl}">this page</a> for the current stable release.
        </p>
      `;
      var mainArticle = document.querySelector("article[role=main]");
      mainArticle.insertBefore(warning, mainArticle.firstChild);
    }
  });
});
</script>
{% endblock %}