Skip to content

Publish pdoc reference to GitHub Pages, expose snake_case API only - #3

Merged
arrufat merged 1 commit into
mainfrom
docs-pages-snake-case
Sep 2, 2026
Merged

Publish pdoc reference to GitHub Pages, expose snake_case API only#3
arrufat merged 1 commit into
mainfrom
docs-pages-snake-case

Conversation

@arrufat

@arrufat arrufat commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Docs on GitHub Pages

  • New .github/workflows/docs.yml, modeled on zignal's documentation.yml minus the Zig half: on release: published (or workflow_dispatch with a browser tag, nightly included) it downloads the release's Linux binary, sets the package version from the tag like wheels.yml, runs scripts/build_docs.py (regenerates the methods, then pdoc) and deploys docs/ with actions/deploy-pages.
  • Pages is already enabled on the repo with the GitHub Actions source. Because the org serves lightpanda.io from Pages, the site lands at https://lightpanda.io/lightpanda-python/ (the github.io URL redirects there). README links it and documents the job under "Releasing".

Superseded after merge: commit 8198b03 on main removes docs.yml and the Pages site again. The reference is now published at https://lightpanda.io/docs/python/ by the docs repo, which regenerates it from the PyPI package (lightpanda-io/docs#92).

snake_case API only

Python users get one idiomatic spelling instead of two:

  • scripts/generate_methods.py no longer emits camelCase aliases and converts parameter names to snake_case (backend_node_id, max_depth, max_bytes, wait_until, full_page). It fails if two properties would collide after conversion.
  • Session.call maps snake_case kwargs back to the schema's property names, and still accepts the raw MCP tool and parameter names as the escape hatch (call("tree", maxDepth=1)).
  • The __getattr__ fallback resolves snake_case names only, so page.getUrl now raises AttributeError.
  • lightpanda/_methods.py regenerated; tests cover the mapping in both the sync and async facades.

Breaking for anyone using the camelCase names, but nothing in the repo did, the package is unpublished, and the README already states there is no backward-compatibility guarantee.

Add a docs workflow that regenerates the API reference from the released
browser binary with pdoc and deploys it to GitHub Pages on release (or by
hand for any browser tag). The site lands at lightpanda.io/lightpanda-python/
since the org serves lightpanda.io from Pages.

Drop the camelCase method aliases and convert tool parameters to
snake_case in the generated methods (wait_for_selector, backend_node_id,
max_depth, ...). Session.call maps snake_case kwargs back to the schema's
property names and still accepts the raw MCP tool and parameter names as
the escape hatch. Attribute lookup no longer resolves camelCase names.
@arrufat
arrufat merged commit 0687dc7 into main Sep 2, 2026
10 checks passed
@arrufat
arrufat deleted the docs-pages-snake-case branch September 2, 2026 14:24
@arrufat arrufat changed the title Publish pdoc reference to GitHub Pages, expose snake_case API only Expose a snake_case-only API, link the reference at lightpanda.io/docs/python Sep 2, 2026
@arrufat arrufat changed the title Expose a snake_case-only API, link the reference at lightpanda.io/docs/python Publish pdoc reference to GitHub Pages, expose snake_case API only Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant