diff options
author | 2021-12-02 14:46:48 +0400 | |
---|---|---|
committer | 2021-12-02 15:31:51 +0400 | |
commit | 1370b89fb924ae889bc128de8b93578cc0101239 (patch) | |
tree | c29402f2925a576a9a6edccc7649cf445ee88c06 /docs/_static | |
parent | Port Regex Utilities From Python Bot (diff) |
Add Sphinx Docs
Adds a customized sphinx doc builder.
Diffstat (limited to 'docs/_static')
-rw-r--r-- | docs/_static/changelog.css | 11 | ||||
-rw-r--r-- | docs/_static/changelog.js | 37 | ||||
-rw-r--r-- | docs/_static/logo.css | 3 |
3 files changed, 51 insertions, 0 deletions
diff --git a/docs/_static/changelog.css b/docs/_static/changelog.css new file mode 100644 index 00000000..343792a1 --- /dev/null +++ b/docs/_static/changelog.css @@ -0,0 +1,11 @@ +[data-theme='dark'] #changelog .dark, +[data-theme='light'] #changelog .light, +[data-theme='auto'] #changelog .light { + display: inline; +} + +[data-theme='dark'] #changelog .light, +[data-theme='light'] #changelog .dark, +[data-theme='auto'] #changelog .dark { + display: none; +} diff --git a/docs/_static/changelog.js b/docs/_static/changelog.js new file mode 100644 index 00000000..f72d025c --- /dev/null +++ b/docs/_static/changelog.js @@ -0,0 +1,37 @@ +/** Update the changelog colors in dark mode */ + +const changelog = document.getElementById("changelog"); + +function updateEntryColor(entry) { + const line = entry.lastChild; + const lightColorSpan = line.childNodes.item(1); + const darkColorSpan = lightColorSpan.cloneNode(true); + + line.insertBefore(darkColorSpan, lightColorSpan); + + lightColorSpan.classList.add("light"); + darkColorSpan.classList.add("dark"); + + let color; + switch (darkColorSpan.textContent) { + case "Feature": + color = "#5BF38E"; + break; + case "Support": + color = "#55A5E7"; + break; + case "Bug": + color = "#E14F4F"; + break; + default: + color = null; + } + + darkColorSpan.style["color"] = color; +} + +if (changelog !== null) { + for (let collection of changelog.getElementsByClassName("simple")) { + Array.from(collection.children).forEach(updateEntryColor); + } +} diff --git a/docs/_static/logo.css b/docs/_static/logo.css new file mode 100644 index 00000000..a9c28e5c --- /dev/null +++ b/docs/_static/logo.css @@ -0,0 +1,3 @@ +.sidebar-logo { + border-radius: 50%; +} |