Skip to content

Commit 0296f41

Browse files
authored
Documentation updates given ability to render with quartodoc (#591)
1 parent 877b1b6 commit 0296f41

24 files changed

+383
-274
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414

1515
### Other changes
1616

17+
* Documentation updates. (#591)
1718
* Removed Python 3.7 support. (#590)
1819

1920

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import shiny.experimental as x
2+
from shiny import App, Inputs, Outputs, Session, render, ui
3+
4+
app_ui = ui.page_fluid(
5+
x.ui.input_text_area("caption", "Caption:", "Data summary", autoresize=True),
6+
ui.output_text_verbatim("value"),
7+
)
8+
9+
10+
def server(input: Inputs, output: Outputs, session: Session):
11+
@output
12+
@render.text
13+
def value():
14+
return input.caption()
15+
16+
17+
app = App(app_ui, server)

shiny/experimental/ui/_accordion.py

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ class AccordionPanel:
3636
----------
3737
*args
3838
Contents to the accordion panel body. Or tag attributes that are supplied to the
39-
returned `Tag` object.
39+
returned :class:`~htmltools.Tag` object.
4040
data_value
4141
A character string that uniquely identifies this panel.
4242
icon
43-
A `Tag` which is positioned just before the `title`.
43+
A :class:`~htmltools.Tag` which is positioned just before the `title`.
4444
title
4545
A title to appear in the :func:`~shiny.experimental.ui.accordion_panel`'s header.
4646
id
@@ -90,12 +90,14 @@ def __init__(
9090

9191
def resolve(self) -> Tag:
9292
"""
93-
Resolve the `AccordionPanel` into a `Tag`.
93+
Resolve the :class:`~shiny.experimental.ui.AccordionPanel` into a
94+
:class:`~htmltools.Tag`.
9495
9596
Returns
9697
-------
9798
:
98-
A `Tag` object representing the `AccordionPanel`.
99+
A :class:`~htmltools.Tag` object representing the
100+
:class:`~shiny.experimental.ui.AccordionPanel`.
99101
"""
100102
btn_attrs = {}
101103
if self._is_open:
@@ -150,7 +152,8 @@ def resolve(self) -> Tag:
150152

151153
def tagify(self) -> Tag:
152154
"""
153-
Resolve the `AccordionPanel` into a `Tag`.
155+
Resolve the :class:`~shiny.experimental.ui.AccordionPanel` into a
156+
:class:`~htmltools.Tag`.
154157
155158
Returns
156159
-------
@@ -177,9 +180,9 @@ def accordion(
177180
Parameters
178181
----------
179182
*args
180-
`~shiny.experimental.ui.AccordionPanel` objects returned from
183+
:class:`~shiny.experimental.ui.AccordionPanel` objects returned from
181184
:func:`~shiny.experimental.ui.accordion_panel`. Or tag attributes that are
182-
supplied to the returned `Tag` object.
185+
supplied to the returned :class:`~htmltools.Tag` object.
183186
id
184187
If provided, you can use `input.id()` in your server logic to determine which of
185188
the :func:`~shiny.experimental.ui.accordion_panel`s are currently active. The
@@ -300,12 +303,12 @@ def accordion_panel(
300303
A title to appear in the :func:`~shiny.experimental.ui.accordion_panel`'s header.
301304
*args
302305
Contents to the accordion panel body. Or tag attributes that are supplied to the
303-
returned `Tag` object.
306+
returned :class:`~htmltools.Tag` object.
304307
value
305308
A character string that uniquely identifies this panel. If `MISSING`, the
306309
`title` will be used.
307310
icon
308-
A `Tag` which is positioned just before the `title`.
311+
A :class:`~htmltools.Tag` which is positioned just before the `title`.
309312
**kwargs
310313
Tag attributes to the `accordion-body` div Tag.
311314
@@ -393,8 +396,8 @@ def accordion_panel_set(
393396
"""
394397
Dynamically set accordions panel state
395398
396-
Dynamically (i.e., programmatically) update/modify :func:~`shiny.experimental.ui.accordion`s in a Shiny app.
397-
These functions require an `id` to be provided to the :func:~`shiny.experimental.ui.accordion` and must also be
399+
Dynamically (i.e., programmatically) update/modify :func:`~shiny.experimental.ui.accordion`s in a Shiny app.
400+
These functions require an `id` to be provided to the :func:`~shiny.experimental.ui.accordion` and must also be
398401
called within an active Shiny session.
399402
400403
Parameters
@@ -469,7 +472,7 @@ def accordion_panel_close(
469472
session: Optional[Session] = None,
470473
) -> None:
471474
"""
472-
Close a set of [accordion_panel()]s.
475+
Close a set of accordion panels in an :func:`~shiny.experimental.ui.accordion`.
473476
474477
Parameters
475478
----------
@@ -620,7 +623,7 @@ def update_accordion_panel(
620623
"""
621624
Dynamically update accordions panel contents
622625
623-
Dynamically (i.e., programmatically) update/modify `accordion_panels()`s in a Shiny app.
626+
Dynamically (i.e., programmatically) update/modify :func:`~shiny.experimental.ui.accordion` panels in a Shiny app.
624627
These functions require an `id` to be provided to the :func:`~shiny.experimental.ui.accordion` and must also be
625628
called within an active Shiny session.
626629

shiny/experimental/ui/_card.py

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ def card(
5858
Parameters
5959
----------
6060
*args
61-
Unnamed arguments can be any valid child of an [htmltools tag][htmltools::tags]
62-
(which includes card items such as :func:`~shiny.experimental.ui.card_body`.
63-
Named arguments become HTML attributes on the returned Tag.
61+
Unnamed arguments can be any valid child of an :class:`~htmltools.Tag` (which
62+
includes card items such as :func:`~shiny.experimental.ui.card_body`. Named
63+
arguments become HTML attributes on the returned Tag.
6464
full_screen
6565
If `True`, an icon will appear when hovering over the card body. Clicking the
6666
icon expands the card to fit viewport size.
@@ -157,16 +157,17 @@ def _full_screen_toggle_icon() -> HTML:
157157

158158
class CardItem:
159159
"""
160-
A wrapper around a `Tag` object that represents a card item (e.g.,
161-
:func:`~shiny.experimental.ui.card_body`, :func:`~shiny.experimental.ui.card_header`, etc.).
160+
A wrapper around a :class:`~htmltools.Tag` object that represents a card item (e.g.,
161+
:func:`~shiny.experimental.ui.card_body`,
162+
:func:`~shiny.experimental.ui.card_header`, etc.).
162163
163164
This class is used to allow for consecutive non-card items to be bundled into a
164165
single `card_body` within :func:`~shiny.experimental.ui.card`.
165166
166167
Parameters
167168
----------
168169
item
169-
A `Tag` object that represents a card item (e.g.,
170+
A :class:`~htmltools.Tag` object that represents a card item (e.g.,
170171
:func:`~shiny.experimental.ui.card_body`, :func:`~shiny.experimental.ui.card_header`, etc.).
171172
172173
See Also
@@ -233,7 +234,7 @@ def card_body(
233234
----------
234235
*args
235236
Contents to the card's body. Or tag attributes that are supplied to the
236-
resolved `Tag` object.
237+
resolved :class:`~htmltools.Tag` object.
237238
fillable
238239
Whether or not the card item should be a fillable (i.e. flexbox) container.
239240
min_height,max_height,max_height_full_screen
@@ -417,9 +418,10 @@ def __call__(
417418
----------
418419
*args
419420
Contents to the tag method. Or tag attributes that are supplied to the
420-
resolved `Tag` object.
421+
resolved :class:`~htmltools.Tag` object.
421422
_add_ws
422-
Whether or not to add whitespace to the returned `Tag` object.
423+
Whether or not to add whitespace to the returned :class:`~htmltools.Tag`
424+
object.
423425
**kwargs
424426
Additional HTML attributes for the returned Tag.
425427
@@ -447,9 +449,9 @@ def card_title(
447449
----------
448450
*args
449451
Contents to the card's title. Or tag attributes that are supplied to the
450-
resolved `Tag` object.
452+
resolved :class:`~htmltools.Tag` object.
451453
container
452-
Method for the returned Tag object. Defaults to :func:`~shiny.ui.h5`.
454+
Method for the returned Tag object. Defaults to :func:`shiny.ui.tags.h5`.
453455
**kwargs
454456
Additional HTML attributes for the returned Tag.
455457
@@ -487,9 +489,9 @@ def card_header(
487489
----------
488490
*args
489491
Contents to the header container. Or tag attributes that are supplied to the
490-
resolved `Tag` object.
492+
resolved :class:`~htmltools.Tag` object.
491493
container
492-
Method for the returned Tag object. Defaults to :func:`~shiny.ui.div`.
494+
Method for the returned Tag object. Defaults to :func:`~shiny.ui.tags.div`.
493495
**kwargs
494496
Additional HTML attributes for the returned Tag.
495497
@@ -528,7 +530,7 @@ def card_footer(
528530
----------
529531
*args
530532
Contents to the footer container. Or tag attributes that are supplied to the
531-
resolved `Tag` object.
533+
resolved :class:`~htmltools.Tag` object.
532534
**kwargs
533535
Additional HTML attributes for the returned Tag.
534536
@@ -567,7 +569,8 @@ def __call__(self, *args: Tag) -> Tagifiable:
567569
Returns
568570
-------
569571
:
570-
A tagifiable object, such as a :class:`~htmltools.Tag` or :class:`~shiny.experimental.ui.CardItem` object.
572+
A tagifiable object, such as a :class:`~htmltools.Tag` or
573+
:class:`~shiny.experimental.ui.CardItem` object.
571574
"""
572575
...
573576

@@ -602,7 +605,8 @@ def card_image(
602605
`**kwargs:TagAttrValue` (e.g. `{"src": "HOSTED_PATH_TO_IMAGE"}` or
603606
`src="HOSTED_PATH_TO_IMAGE"`).
604607
*args
605-
Dictionary of tag attributes that are supplied to the resolved `Tag` object.
608+
Dictionary of tag attributes that are supplied to the resolved
609+
:class:`~htmltools.Tag` object.
606610
href
607611
An optional URL to link to.
608612
border_radius

0 commit comments

Comments
 (0)