Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improves the Fast Template docstrings #3570

Merged
merged 3 commits into from
May 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion panel/template/fast/grid/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,23 @@

class FastGridTemplate(FastGridBaseTemplate):
"""
The FastGridTemplate is build on top of Fast.design and the React Grid Layout.
The `FastGridTemplate` is a grid based Template with a header, sidebar and main area. It is
based on the fast.design style and works well in both default (light) and dark mode.

Reference: https://panel.holoviz.org/reference/templates/FastGridTemplate.html

Example:

>>> template = pn.template.FastGridTemplate(
... site="Panel", title="FastGridTemplate", accent="#A01346",
... sidebar=[pn.pane.Markdown("## Settings"), some_slider],
... ).servable()
>>> template.main[0:6,:]=some_python_object

Some *accent* colors that work well are #A01346 (Fast), #00A170 (Mint), #DAA520 (Golden Rod),
#2F4F4F (Dark Slate Grey), #F08080 (Light Coral) and #4099da (Summer Sky).

Please note the `FastListTemplate` cannot display in a notebook output cell.
"""

_css = FastGridBaseTemplate._css + [
Expand Down
29 changes: 28 additions & 1 deletion panel/template/fast/list/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,34 @@

class FastListTemplate(FastBaseTemplate):
"""
The FastListTemplate is build on top of Fast.design.
The `FastListTemplate` is a list based Template with a header, sidebar and main area. It is
based on the fast.design style and works well in both default (light) and dark mode.

Reference: https://panel.holoviz.org/reference/templates/FastListTemplate.html

Example:

>>> pn.template.FastListTemplate(
... site="Panel", title="FastListTemplate", accent="#A01346",
... sidebar=[pn.pane.Markdown("## Settings"), some_slider],
... main=[some_python_object]
... ).servable()

Some *accent* colors that work well are #A01346 (Fast), #00A170 (Mint), #DAA520 (Golden Rod),
#2F4F4F (Dark Slate Grey), #F08080 (Light Coral) and #4099da (Summer Sky).

You can also use the `FastListTemplate` as shown below

>>> pn.extension(..., template="fast")
>>> pn.state.template.param.update(site="Panel", title="FastListTemplate", accent="#A01346")
>>> pn.pane.Markdown("## Settings").servable(target="sidebar")
>>> some_slider = pn.widgets.IntSlider(...).servable(target="sidebar")
>>> ...
>>> pn.panel(some_python_object).servable(target="main")

This api is great for more exploratory use cases.

Please note the `FastListTemplate` cannot display in a notebook output cell.
"""

_css = FastBaseTemplate._css + [
Expand Down