Skip to content

Conversation

@davidbrochart
Copy link
Collaborator

@davidbrochart davidbrochart commented Dec 19, 2025

@trungleduc The test in this PR shows how to use the PageConfig. You can register a (async) hook that will be called with the page config, and this hook can change the config.

@davidbrochart davidbrochart marked this pull request as draft December 19, 2025 13:53
@davidbrochart davidbrochart marked this pull request as ready for review December 19, 2025 14:43
@trungleduc
Copy link
Contributor

Can you give me an example of how I can replace this PageConfig module?

@davidbrochart
Copy link
Collaborator Author

You will have to get the page config from your module, and register your hook:

class MyModule(Module):
    async def prepare(self):
        page_config = await self.get(PageConfig)

        async def my_hook(config):
            config["foo"] = "bar"

        page_config.register(my_hook)

@trungleduc
Copy link
Contributor

great! thank you verymuch

@davidbrochart davidbrochart merged commit 79dce9f into jupyter-server:main Dec 19, 2025
42 of 49 checks passed
@davidbrochart davidbrochart deleted the page-config branch December 19, 2025 15:31
@trungleduc
Copy link
Contributor

@davidbrochart will i have access to the request object in the page config hook?

@davidbrochart
Copy link
Collaborator Author

You should.

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.

2 participants