Skip to content

Commit

Permalink
Added copy button. Put output into code block. Added nunjucks link in…
Browse files Browse the repository at this point in the history
… footer. Removed html from install.cfg.
  • Loading branch information
WyvernIXTL committed Jun 14, 2024
1 parent c2f7275 commit 441f04f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
6 changes: 0 additions & 6 deletions install.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ properties:

{% if mybool %}
{% if mychoice == "flying" %}
<small><pre>
00000
00000
00 00000
Expand Down Expand Up @@ -70,10 +69,8 @@ properties:
0000000 000 00


</pre>
{% elif mychoice == "landed" %}
{% raw %}
<small><pre>
█████████████████████████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓███████████████████
████▓██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█████████▓█▓▓▓
▓▓▓▓▓▓▓▓▓▒▓▒▒▒▓▓▓▓▒▓▓▒▓▓▓▓▓▓▒▒▒▓▒▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
Expand Down Expand Up @@ -102,12 +99,10 @@ properties:
▓▓▓▓▓▓▓▓▓▒▓▓▓▓▓▓▓▒▓▒▒▒▒▒▒▒▒░▒▒▒▒░░▒░░░▒▒▒░▒▒▒▒░░░▒░▒▒░▒░▒░░░▒░▒▒▒▒▒▒▒▒▒▓▒▓▓▓▓▓▓▓▓▓
▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▓▓▒░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓▒▓▓▓▓▓▓▓▓▓▓▓▓▓
▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▓▒▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░▒▒░▒▒▒░░▒▒░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓
</pre>

{% endraw %}
{% elif mychoice == "distant" %}
{% raw %}
<small><pre>



Expand Down Expand Up @@ -140,7 +135,6 @@ properties:
∞∞∞∞∞∞∞∞∞∞∞∞∞√√√√√√√√√√√√√√ ππ
∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞√√√√√√√√√√√√√√√∞√√√√√√√√π√√π
∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞√∞∞√∞√√√∞∞√ππππ
</pre>
{% endraw %}
{% endif %}
{% endif %}
25 changes: 18 additions & 7 deletions src/web_installation_instruction/template/index.html.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,26 @@
</form>

<h4>Instructions</h4>
<p id="output"></p>
<div>
<pre>
<Code id="output"></Code>
</pre>
</div>
<button class="secondary" onclick="copy_to_clipboard()" style="width: 100%;">Copy</button>

</main>
<footer class="container">
<small>
<p>
This website is generated using
This website was generated using
<a href="https://github.com/instructions-d-installation/web-installation-instruction" class="secondary">web-installation-instruction</a>,
which is under
<a href="https://github.com/instructions-d-installation/web-installation-instruction/blob/main/LICENSE" class="secondary">Apache-2.0</a>,
and utilizes
<a href="https://picocss.com/" class="secondary">Pico CSS</a>, licensed under
<a href="https://github.com/picocss/pico/blob/main/LICENSE.md" class="secondary">MIT</a>.
<a href="https://github.com/picocss/pico/blob/main/LICENSE.md" class="secondary">MIT</a>, and
<a href="https://mozilla.github.io/nunjucks/" class="secondary">Nunjucks</a>, licensed under
<a href="https://github.com/mozilla/nunjucks/blob/master/LICENSE" class="secondary">BSD-2-Clause</a>.
</p>
</small>
</footer>
Expand All @@ -95,6 +102,8 @@
let default_input = structuredClone(input);
let output;
function render() {
for (const key of input.keys()) {
let val;
Expand All @@ -105,12 +114,14 @@
} else {
val = document.getElementById(key).value || default_input.get(key);
}
console.log(key)
console.log(input.get("mybool"))
input.set(key, val);
}
let render = template.render(Object.fromEntries(input.entries()));
document.getElementById("output").innerHTML = render;
output = template.render(Object.fromEntries(input.entries()));
document.getElementById("output").innerHTML = output;
}
function copy_to_clipboard() {
navigator.clipboard.writeText(output);
}
render()
Expand Down

0 comments on commit 441f04f

Please sign in to comment.