Skip to content

Commit 8cf3f31

Browse files
committed
Export session.ClientData; add to quartodoc
1 parent ec74610 commit 8cf3f31

File tree

4 files changed

+19
-5
lines changed

4 files changed

+19
-5
lines changed

docs/_quartodoc-core.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,19 +233,21 @@ quartodoc:
233233
path: Session
234234
summary:
235235
name: "Session"
236-
desc: ""
236+
desc: "Tools for managing user sessions and accessing session-related information."
237237
flatten: true
238238
contents:
239239
- session.get_current_session
240240
- session.require_active_session
241241
- session.session_context
242242
- reactive.get_current_context
243+
- session.ClientData
243244
- session.Session.send_custom_message
244245
- session.Session.send_input_message
245246
- session.Session.on_flush
246247
- session.Session.on_flushed
247248
- session.Session.on_ended
248249
- session.Session.dynamic_route
250+
- session.Session.close
249251
- input_handler.input_handlers
250252
- kind: page
251253
path: Renderer

docs/_quartodoc-express.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,14 @@ quartodoc:
168168
- express.ui.panel_conditional
169169
- express.ui.insert_ui
170170
- express.ui.remove_ui
171+
- title: User Session
172+
desc: Tools for managing user sessions and accessing session-related information.
173+
contents:
174+
- session.Session
175+
- title: Client Data
176+
desc: Access (client-side) information about the user session (e.g., URL, output info, etc).
177+
contents:
178+
- session.ClientData
171179
- title: UI as HTML
172180
desc: Tools for creating HTML/CSS/JS
173181
contents:

shiny/session/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Tools for working within a (user) session context.
33
"""
44

5-
from ._session import Session, Inputs, Outputs
5+
from ._session import ClientData, Inputs, Outputs, Session
66
from ._utils import ( # noqa: F401
77
get_current_session,
88
session_context as session_context,
@@ -13,6 +13,7 @@
1313
"Session",
1414
"Inputs",
1515
"Outputs",
16+
"ClientData",
1617
"get_current_session",
1718
"require_active_session",
1819
)

shiny/session/_session.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import annotations
22

3-
__all__ = ("Session", "Inputs", "Outputs")
3+
__all__ = ("Session", "Inputs", "Outputs", "ClientData")
44

55
import asyncio
66
import contextlib
@@ -1361,11 +1361,14 @@ def __dir__(self):
13611361
@add_example()
13621362
class ClientData:
13631363
"""
1364-
Reactively read client data from the browser.
1364+
Access (client-side) information from the browser.
13651365
1366-
This class provides access to client data values, such as the URL components, the
1366+
Provides access to client-side information, such as the URL components, the
13671367
pixel ratio of the device, and the properties of outputs.
13681368
1369+
Each method in this class reads a reactive input value, which means that the
1370+
method will error if called outside of a reactive context.
1371+
13691372
Raises
13701373
------
13711374
RuntimeError

0 commit comments

Comments
 (0)