diff options
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/gen_bots.py | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/scripts/gen_bots.py b/scripts/gen_bots.py index 392251f..3e6b633 100644 --- a/scripts/gen_bots.py +++ b/scripts/gen_bots.py @@ -25,20 +25,36 @@ html { color: black; background-color: white; } body { font-family: "Kawkab Mono"; font-size: 16px; line-height: 1.4; margin: 0; padding: 4rem 0; min-height: 100%; overflow-wrap: break-word; } main, header, footer { max-width: 800px; margin-inline: auto; padding: 0 2rem; } h1, header, footer { text-align: center; } -main { text-align: left; } +main { text-align: justify; } p, h2, h3, h4 { margin: 1em 0 0 0; } table { margin: auto; border-collapse: collapse; } th, td { border: 1px solid; padding: 0.3em 0.8em; } pre { background: rgba(128,128,128,0.08); padding: 1em; overflow-x: auto; margin: 1em 0; } code { font-size: 85%; } +hr { border: none; border-top: thin solid; margin: 1.25rem 0; } header { margin-bottom: 1em; } footer { margin-top: 3em; } -a { color: inherit; } @media (max-width: 600px) { body { font-size: 0.9em; } h1 { font-size: 1.8em; } } @media (max-width: 400px) { body { font-size: 0.8em; } h1 { font-size: 1.6em; } } @media (prefers-color-scheme: dark) { html { filter: invert(1); } img { filter: invert(1); } }""" -FOOTER = "" +FOOTER = """\ +<footer> +<hr> +<a href="https://twt.gumx.cc">twt</a> / +<a href="https://git.gumx.cc">git</a> / +<a href="https://mail.gumx.cc">mail</a> / +<a href="https://list.gumx.cc">list</a> / +<a href="https://irc.gumx.cc">irc</a> / +<a href="https://files.gumx.cc">files</a> / +<a href="https://vpn.gumx.cc">vpn</a> / +<a href="https://pgp.gumx.cc">pgp</a> / +<a href="https://demo.gumx.cc">demo</a> / +<a href="https://wk.fo">wk.fo</a> +<br> +<a href="https://git.gumx.cc/irc-bots">source</a> / +<a href="https://gumx.cc/license">license</a> +</footer>""" def page(title, header_html, content_html): @@ -47,7 +63,7 @@ def page(title, header_html, content_html): <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width,initial-scale=1"> -<link rel="icon" type="image/svg+xml" href="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1IDUiPjxyZWN0IHg9IjEiIHk9IjAiIHdpZHRoPSIxIiBoZWlnaHQ9IjEiLz48cmVjdCB4PSIyIiB5PSIxIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIi8+PHJlY3QgeD0iMCIgeT0iMiIgd2lkdGg9IjEiIGhlaWdodD0iMSIvPjxyZWN0IHg9IjEiIHk9IjIiIHdpZHRoPSIxIiBoZWlnaHQ9IjEiLz48cmVjdCB4PSIyIiB5PSIyIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIi8+PC9zdmc+"> +<link rel="icon" type="image/svg+xml" href="/favicon.svg"> <title>{title}</title> <style> {STYLE} @@ -171,8 +187,8 @@ def build(src_dir, out_dir): md = f.read() content = md_to_html(md) html = page( - f"{name} — irc.gumx.cc", - f'<h1><a href="https://irc.gumx.cc">irc.gumx.cc</a> / bots / {name}</h1>', + f"irc.gumx.cc / bots / {name}", + f'<nav><strong><a href="https://gumx.cc">gumx</a></strong> / <a href="https://irc.gumx.cc">irc</a> / <a href="/bots">bots</a> / {name}</nav>', content, ) bot_dir = os.path.join(out_dir, name) @@ -186,7 +202,7 @@ def build(src_dir, out_dir): for name, desc in BOTS if os.path.exists(os.path.join(src_dir, "docs", f"{name}.md")) ) - index_content = f"""<h2>bots</h2> + index_content = f"""<h1>bots</h1> <table> <tr><th>bot</th><th>purpose</th></tr> {rows} @@ -194,8 +210,8 @@ def build(src_dir, out_dir): <p>All bots run <a href="https://sopel.chat/">Sopel</a>. Source: <a href="https://git.gumx.cc/irc-bots">git.gumx.cc/irc-bots</a>.</p>""" index_html = page( - "irc bots — irc.gumx.cc", - '<h1><a href="https://irc.gumx.cc">irc.gumx.cc</a> / bots</h1>', + "irc.gumx.cc / bots", + '<nav><strong><a href="https://gumx.cc">gumx</a></strong> / <a href="https://irc.gumx.cc">irc</a> / bots</nav>', index_content, ) with open(os.path.join(out_dir, "index.html"), "w") as f: |
