Skip to content

Add a logo to the docs, drawn by a script - #145

Merged
nstarman merged 2 commits into
mainfrom
docs/logo
Oct 4, 2026
Merged

nstarman merged 2 commits into
mainfrom
docs/logo

Conversation

@nstarman

@nstarman nstarman commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

The docs had no logo or favicon; conf.py set neither. This gives them the cosmology-api organisation's mark, from its avatar: a hexagon holding three linked cubes, near-white (#f3f3f3) on slate (#303841). The cubes are drawn larger than on the avatar, so they stay legible at favicon size.

docs/_static/make_logo.py writes it:

uv run docs/_static/make_logo.py                     # docs/_static/favicon.svg
uv run docs/_static/make_logo.py --size 2048 big.png # a PNG, at any size
  • SVG by default: 1.2 KB and sharp at any size. The script writes the SVG text directly, so the default needs no dependencies.
  • Geometry: every shape is a pointy-topped hexagon about one centre. The outer hexagon's size, the links' hexagon (which holds a cube on every other corner) and the cubes' size and line widths are constants at the top of the script.
  • PNG on request: rendered with resvg-py, declared in the script's PEP 723 header, so uv run fetches it.
  • Docs: conf.py sets html_logo and html_favicon to _static/favicon.svg. html_static_path already includes _static.

Checked:

  • The pre-commit hooks pass on the changed files; mypy excludes docs/.
  • A local sphinx-build with the docs extra builds without warnings and puts the SVG in both the favicon link and the sidebar logo.
  • Re-running the script reproduces the file, and it stays readable at 32 px.

🤖 Generated with Claude Code

The docs had no logo or favicon. They now have the cosmology-api
organisation's mark, from its avatar: a hexagon holding three linked cubes,
near-white on slate, with the cubes drawn larger so they stay legible as a
favicon. docs/_static/make_logo.py writes it as an SVG (1.2 KB), which
conf.py uses as the logo and favicon; a PNG at any size on request:

    uv run docs/_static/make_logo.py --size 2048 big.png

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 4, 2026 02:52
@nstarman nstarman added this to the v0.2 milestone Oct 4, 2026
@github-actions github-actions Bot added the Docs label Oct 4, 2026
@codecov

codecov Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (ed9fcdc) to head (896ffbf).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #145   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           14        14           
  Lines          314       314           
=========================================
  Hits           314       314           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

It is a self-contained, low-risk docs-only change whose output I verified reproduces exactly, with valid API usage and only one optional, non-blocking operational note.

Review effort: Balanced
Findings: 1 Low severity

Open (1)
What changed in this PR

This PR gives the Sphinx documentation a logo and favicon, which were previously unset in conf.py. It adds a small, dependency-light Python script that draws the cosmology-api organisation's mark (a hexagon with three linked cubes, near-white on slate) and writes it as a compact SVG by default, with an optional PNG path rendered via resvg-py (declared in a PEP 723 inline-metadata header). The committed favicon.svg is the script's output and is wired into both the sidebar logo and the favicon.

Changes:

  • Add docs/_static/make_logo.py, a self-contained generator that emits the logo as SVG (stdlib only) or PNG (--size, via resvg-py).
  • Commit the generated docs/_static/favicon.svg (verified to be reproduced byte-for-byte by the script).
  • Set html_logo and html_favicon in docs/conf.py to _static/favicon.svg.
File Description
docs/​_static/​make_logo.py New PEP 723 script that computes hexagon geometry and writes the logo as SVG (default) or PNG; verified to regenerate the committed SVG exactly.
docs/​_static/​favicon.svg The committed logo/favicon asset produced by the script.
docs/​conf.py Points html_logo and html_favicon at the new asset, reusing the existing html_static_path.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread docs/_static/make_logo.py
html_static_path copies everything in docs/_static/, so make_logo.py was
published as _static/make_logo.py. exclude_patterns also filters that copy;
the pattern needs the **/ prefix, since Sphinx matches a top-level file as
./make_logo.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nstarman
nstarman merged commit e5aff5b into main Oct 4, 2026
17 checks passed
@nstarman
nstarman deleted the docs/logo branch October 4, 2026 03:03
nstarman added a commit to nstarman/nstarman.github.io that referenced this pull request Oct 4, 2026
Its logo, mirrored from cosmology-api/cosmology.api's docs/_static/favicon.svg
(cosmology-api/cosmology.api#145) by scripts/sync-software-figures.mjs: drawn 512 px wide and
saved as WebP at quality 85.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants