From 455dc792d38766156747a156e14b75d28c211525 Mon Sep 17 00:00:00 2001 From: Boris Muratov <8bee278@gmail.com> Date: Sun, 17 Oct 2021 15:06:38 +0300 Subject: Restructure bot contributing guide (#591) * Restructure bot contributing guide Restructures the bot guide to focus on getting users "through the door" first, and slowly adding additional information and options. The guide is built in terms of showing ways to run the bot and how to achieve it, rather than listing all of the information for each configuration and environment variable right away. That said, the attempt was to still present the reader with the full information they need, and to still be able to use as a quick reference for contributors who are already familiar with the project. As a style choice, this guide incorporates collapsible elements, which required some CSS and JS additions. This could be resolved with the bulma-collapsible extension, but it doesn't seem to function well inside django templates. The guide includes an optional config.yml to use with the test server template. This is a temporary measure until we get the bootstrapping application going. This guide additionally splits the bot account creation and obtaining Discord ID's guides and they didn't seem related. The original file is kept for now as it is used by other guides at the moment. --- pydis_site/static/js/content/page.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 pydis_site/static/js/content/page.js (limited to 'pydis_site/static/js') diff --git a/pydis_site/static/js/content/page.js b/pydis_site/static/js/content/page.js new file mode 100644 index 00000000..366a033c --- /dev/null +++ b/pydis_site/static/js/content/page.js @@ -0,0 +1,13 @@ +document.addEventListener("DOMContentLoaded", () => { + const headers = document.getElementsByClassName("collapsible"); + for (const header of headers) { + header.addEventListener("click", () => { + var content = header.nextElementSibling; + if (content.style.maxHeight){ + content.style.maxHeight = null; + } else { + content.style.maxHeight = content.scrollHeight + "px"; + } + }); + } +}); -- cgit v1.2.3