diff options
Diffstat (limited to 'lib/debug')
| -rw-r--r-- | lib/debug/license.txt | 24 | ||||
| -rw-r--r-- | lib/debug/readme.md | 6 | ||||
| -rw-r--r-- | lib/debug/resources/debug.css | 109 | ||||
| -rw-r--r-- | lib/debug/resources/pygments.css | 73 | ||||
| -rw-r--r-- | lib/debug/templates/node.ibis | 77 |
5 files changed, 289 insertions, 0 deletions
diff --git a/lib/debug/license.txt b/lib/debug/license.txt new file mode 100644 index 0000000..53261fe --- /dev/null +++ b/lib/debug/license.txt @@ -0,0 +1,24 @@ +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to <http://unlicense.org/>. diff --git a/lib/debug/readme.md b/lib/debug/readme.md new file mode 100644 index 0000000..602496a --- /dev/null +++ b/lib/debug/readme.md @@ -0,0 +1,6 @@ +# Ivy Debug Theme + +[1]: https://github.com/dmulholl/ivy + +This [Ivy][1] theme is designed as a debugging tool, useful when building themes or plugins. +It displays all the page data available for use in template files. diff --git a/lib/debug/resources/debug.css b/lib/debug/resources/debug.css new file mode 100644 index 0000000..012363c --- /dev/null +++ b/lib/debug/resources/debug.css @@ -0,0 +1,109 @@ +html { + font-size: 100%; +} + +body { + margin: 0 auto; + padding: 50px; + font-family: "Georgia", serif; + font-size: 14px; + line-height: 1.5; + color: #333; + background-color: #f8f8f8; +} + +#wrap { + max-width: 800px; + background-color: #fff; + padding: 80px; + margin: 0 auto; + border: 1px solid #ccc; +} + +h1 { + margin: 0 0 40px; + padding: 0; + font-weight: normal; + line-height: 1.2; + padding: 16px 0; + font-size: 24px; + border-top: 1px solid #ccc; + border-bottom: 1px solid #ccc; +} + +h1 a { + float: right; + text-decoration: none; + padding-right: 20px; +} + +ul, ol { + margin: 36px 0px; + padding: 0 0 0 16px; +} + +ul ul, ol ol, ul ol, ol ul { + margin: 0 8px; +} + +li { + margin: 0; + padding: 0; +} + +pre { + font-size: 13px; + font-family: monospace; + color: #222; + background-color: #f8f8f8; + margin: 32px 0; + padding: 18px 24px; + border-top: 1px solid #ccc; + border-bottom: 1px solid #ccc; + overflow: auto; +} + +.button { + background-color: #eee; + cursor: pointer; + padding: 20px; + width: 100%; + border: none; + text-align: left; + outline: none; + font-size: 16px; + font-family: "Georgia", serif; + margin-top: 5px; +} + +.active, .button:hover { + background-color: #ccc; +} + +.menu { + padding: 0 20px; +} + +.panel { + padding: 0 20px; + background-color: white; + max-height: 0; + overflow: hidden; + transition: max-height 0.2s ease-out; +} + +.panel.last pre { + margin-bottom: 0; +} + +.button:after { + content: '\02795'; /* Unicode character for "plus" sign (+) */ + font-size: 10px; + color: red; + float: right; + margin-left: 5px; +} + +.active:after { + content: "\2796"; /* Unicode character for "minus" sign (-) */ +} diff --git a/lib/debug/resources/pygments.css b/lib/debug/resources/pygments.css new file mode 100644 index 0000000..3679d29 --- /dev/null +++ b/lib/debug/resources/pygments.css @@ -0,0 +1,73 @@ +/* + Syntax highlighting styles for Pygmentized code samples. +*/ + +pre .bp { color: #3465a4 } /* Name.Builtin.Pseudo */ +pre .c { color: #8f5902; font-style: italic } /* Comment */ +pre .c1 { color: #8f5902; font-style: italic } /* Comment.Single */ +pre .cm { color: #8f5902; font-style: italic } /* Comment.Multiline */ +pre .cp { color: #8f5902 } /* Comment.Preproc */ +pre .cs { color: #8f5902; font-style: italic } /* Comment.Special */ +pre .g { color: #222222 } /* Generic */ +pre .gd { color: #a40000 } /* Generic.Deleted */ +pre .ge { color: #222222; font-style: italic } /* Generic.Emph */ +pre .gr { color: #ef2929 } /* Generic.Error */ +pre .gh { color: #000080; font-weight: bold } /* Generic.Heading */ +pre .gi { color: #00A000 } /* Generic.Inserted */ +pre .go { color: #222222; font-style: italic } /* Generic.Output */ +pre .gp { color: #8f5902 } /* Generic.Prompt */ +pre .gs { color: #222222; font-weight: bold } /* Generic.Strong */ +pre .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ +pre .gt { color: #a40000; font-weight: bold } /* Generic.Traceback */ +pre .il { color: #000088 } /* Literal.Number.Integer.Long */ +pre .k { color: #204a87; font-weight: bold } /* Keyword */ +pre .kc { color: #204a87; font-weight: bold } /* Keyword.Constant */ +pre .kd { color: #204a87; font-weight: bold } /* Keyword.Declaration */ +pre .kn { color: #204a87; font-weight: bold } /* Keyword.Namespace */ +pre .kp { color: #204a87; font-weight: bold } /* Keyword.Pseudo */ +pre .kr { color: #204a87; font-weight: bold } /* Keyword.Reserved */ +pre .kt { color: #204a87; font-weight: bold } /* Keyword.Type */ +pre .l { color: #222222 } /* Literal */ +pre .ld { color: #222222 } /* Literal.Date */ +pre .m { color: #000088 } /* Literal.Number */ +pre .mf { color: #000088 } /* Literal.Number.Float */ +pre .mh { color: #000088 } /* Literal.Number.Hex */ +pre .mi { color: #000088 } /* Literal.Number.Integer */ +pre .mo { color: #000088 } /* Literal.Number.Oct */ +pre .n { color: #222222 } /* Name */ +pre .na { color: #8f5902 } /* Name.Attribute */ +pre .nb { color: #204a87 } /* Name.Builtin */ +pre .nc { color: #222222 } /* Name.Class */ +pre .no { color: #222222 } /* Name.Constant */ +pre .nd { color: #000088 } /* Name.Decorator */ +pre .ni { color: #ce5c00 } /* Name.Entity */ +pre .ne { color: #cc0000; font-weight: bold } /* Name.Exception */ +pre .nf { color: #222222 } /* Name.Function */ +pre .nl { color: #f57900 } /* Name.Label */ +pre .nn { color: #222222 } /* Name.Namespace */ +pre .nt { color: #204a87; font-weight: bold } /* Name.Tag */ +pre .nv { color: #222222 } /* Name.Variable */ +pre .nx { color: #222222 } /* Name.Other */ +pre .o { color: #000088 } /* Operator */ +pre .ow { color: #204a87; font-weight: bold } /* Operator.Word */ +pre .p { color: #222222 } /* Punctuation */ +pre .py { color: #222222 } /* Name.Property */ +pre .s { color: #880000 } /* Literal.String */ +pre .s1 { color: #880000 } /* Literal.String.Single */ +pre .s2 { color: #880000 } /* Literal.String.Double */ +pre .sb { color: #880000 } /* Literal.String.Backtick */ +pre .sc { color: #880000 } /* Literal.String.Char */ +pre .sd { color: #880000; font-style: italic } /* Literal.String.Doc */ +pre .se { color: #880000 } /* Literal.String.Escape */ +pre .sh { color: #880000 } /* Literal.String.Heredoc */ +pre .si { color: #880000 } /* Literal.String.Interpol */ +pre .sr { color: #880000 } /* Literal.String.Regex */ +pre .ss { color: #880000 } /* Literal.String.Symbol */ +pre .sx { color: #880000 } /* Literal.String.Other */ +pre .vc { color: #222222 } /* Name.Variable.Class */ +pre .vg { color: #222222 } /* Name.Variable.Global */ +pre .vi { color: #222222 } /* Name.Variable.Instance */ +pre .x { color: #222222 } /* Other */ + +pre .w { color: #f8f8f8; text-decoration: underline } /* Text.Whitespace */ +pre .err { color: #a40000; border: 1px solid #ef2929 } /* Error */ 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> |