diff options
| author | Fuwn <[email protected]> | 2022-02-04 17:38:04 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-06-09 00:43:14 -0700 |
| commit | 8a78f62e4cb0890cd0ed9c663a21f809013b959e (patch) | |
| tree | be25df618590569d62f3279a1c2cdffd7ddeeb08 /lib/debug/templates/node.ibis | |
| download | documentation-8a78f62e4cb0890cd0ed9c663a21f809013b959e.tar.xz documentation-8a78f62e4cb0890cd0ed9c663a21f809013b959e.zip | |
feat: setup documentation
Diffstat (limited to 'lib/debug/templates/node.ibis')
| -rw-r--r-- | lib/debug/templates/node.ibis | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/lib/debug/templates/node.ibis b/lib/debug/templates/node.ibis new file mode 100644 index 0000000..6bb4221 --- /dev/null +++ b/lib/debug/templates/node.ibis @@ -0,0 +1,77 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + <title>Debugging: {{ site.title || "Mystery Site" }}</title> + <link rel="stylesheet" href="@root/debug.css"> + <link rel="stylesheet" href="@root/pygments.css"> + </head> + <body> + <div id="wrap"> + <h1> + {$ node $} + {% if node.parent %} + <a href="{$ node.parent.url $}">↑</a> + {% endif %} + </h1> + + {% if inc.menu %} + <div class="menu"> + {{ inc.menu }} + </div> + {% endif %} + + <button class="button">Automenu</button> + <div class="panel"> + {{ automenu }} + </div> + + <button class="button">Node Children</button> + <div class="panel"> + <ul> + {% for child in node.children %} + <li><a href="{$ child.url $}">{$ child $}</a></li> + {% empty %} + <li>None.</li> + {% endfor %} + </ul> + </div> + + <button class="button">Node Meta</button> + <div class="panel"> + <pre>{{ node.meta|pprint|pygmentize('python') }}</pre> + </div> + + <button class="button">Node Text</button> + <div class="panel"> + <pre>{{ node.text.strip()|escape }}</pre> + </div> + + <button class="button">Node HTML</button> + <div class="panel"> + <pre>{{ node.html|escape }}</pre> + </div> + + <button class="button">Page Data</button> + <div class="panel last"> + <pre>{{ context.data.stack|index(2)|pprint|pygmentize('python') }}</pre> + </div> + </div> + + <script> + var buttons = document.getElementsByClassName("button"); + for (let i = 0; i < buttons.length; i++) { + buttons[i].addEventListener("click", function() { + this.classList.toggle("active"); + var panel = this.nextElementSibling; + if (panel.style.maxHeight) { + panel.style.maxHeight = null; + } else { + panel.style.maxHeight = panel.scrollHeight + "px"; + } + }); + } + </script> + + </body> +</html> |