Skip to content

Register the plone-client-python httpexample builder when plone.restapi provides it - #2126

Open
ericof wants to merge 1 commit into
6.0from
issue-2125
Open

ericof wants to merge 1 commit into
6.0from
issue-2125

Conversation

@ericof

@ericof ericof commented Nov 23, 2026

Copy link
Copy Markdown
Member

plone/plone.restapi#2098 adds a plone-client tab to every request example in the plone.restapi documentation. The tab comes from a custom sphinxcontrib-httpexample builder, plone-client-python, that plone.restapi registers in its own docs/source/conf.py. This repository builds the same pages with docs/conf.py, which does not know that builder, and sphinxcontrib-httpexample rejects a builder name that is not registered. Once the submodules/plone.restapi pointer moves past that change, every page with an http:example directive would fail to build here.

This registers the builder in docs/conf.py, but only when the submodule provides it. The module that implements the builder, docs/source/plone_client_python.py, does not exist in plone.restapi until plone/plone.restapi#2098 is merged, so an unconditional import would break today's build. With the guard, this change is safe to merge now, does nothing at the current submodule pointer, and takes effect with the submodule update that brings the builder in.

Checked from clean builds in both directions. At the current pointer, make html succeeds with the same 18 warnings as a build of origin/6.0, and no plone-client tab is produced. With plone/plone.restapi#2098's head checked out, make html succeeds and the endpoint pages carry the plone-client tab. Without the registration, the same build aborts with a docutils error when it meets the unregistered builder name.

plone/plone.restapi#2064 (the @plone/client tab) will need the same registration for its builder.

Closes #2125

…pi provides it

plone/plone.restapi#2098 adds a plone-client-python builder for
sphinxcontrib-httpexample. Its module lives in the plone.restapi
submodule and arrives with a submodule update, so the registration is
guarded: docs/conf.py registers the builder only when
docs/plone.restapi/docs/source/plone_client_python.py exists. Until
then the build is unchanged.

Refs #2125
@stevepiercy

Copy link
Copy Markdown
Member

I'm not sure this is needed. Please review collective/sphinxcontrib-httpexample#153 first.

@ericof

ericof commented Nov 24, 2026

Copy link
Copy Markdown
Member Author

@stevepiercy thanks for taking a look! I read collective/sphinxcontrib-httpexample#153, and I believe this is still needed. I left the longer explanation in plone/plone.restapi#2098; the short version for this repository:

  • That PR lets a directive pass arguments to a custom builder, but it does not add any builder to the package. Each project still registers its own in conf.py.
  • Add plone-client examples to all request examples plone.restapi#2098 registers its plone-client-python builder in plone.restapi's docs/source/conf.py. This repository builds the same pages with its own docs/conf.py, so it needs the same registration, or every http:example that names the builder fails here once the submodule is updated.

The registration is guarded, so it does nothing until the submodule brings the builder in, and it can wait for plone/plone.restapi#2098 if you prefer to merge them in that order.

One nice side effect of collective/sphinxcontrib-httpexample#153: an unregistered builder name will be reported as a readable directive error instead of the docutils KeyError we get today.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

Register the plone-client-python httpexample builder from plone.restapi

2 participants