Skip to content

Commit

Permalink
Release 1.36.0 (#1099)
Browse files Browse the repository at this point in the history
* Update generate.py

* Add MPA v2 (#1090)

* Add MPA overview, st.Page, st.navigation

* Autofunction: let docstring override @Property

* Update streamlit.json

* Add and separate deep links in _redirects

* MPAv2 - API and overview review edits

* Update streamlit.json

* Typo

* Revert "Autofunction: let docstring override @Property"

This reverts commit 0be651c.

* Update components and charts (#1093)

* Move component examples into docstrings

* Update streamlit.json

* Update streamlit.json

* Update streamlit.json

* Add release notes

* Update cheat sheet

* Switch embedded apps to new version

* Add API cards

* Update What's new tiles

* Update existing content and remove st.cache

* Remove duplicate example

* Review edits

* Update existing embedded apps (#1086)

* Change st.html example

* Use "aap run" instead of "script run"

* Multipage guides and tutorial (#1097)

* Frame out addition multipage guide pages

* Add widget page to menu

* Typo

* Explain navigation menu sections

* Fix broken comment

* Add link to existing tutorial

* Add dynamic navigation tutorial

* Update pages directory guide

* Move page navigation to overview

* Update multipage category page

* review comments

* Use command instead of function

* Remove use of plain-English "method" to avoid confusion

* Update multipage tutorial category page

* Typos

* Typos

* Correct page path

* Simplify role declaration in MPA v2 tutorial
  • Loading branch information
sfc-gh-dmatthews authored Jun 21, 2024
1 parent e000eca commit e503e1c
Show file tree
Hide file tree
Showing 52 changed files with 11,032 additions and 1,037 deletions.
44 changes: 40 additions & 4 deletions content/develop/api-reference/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1845,14 +1845,38 @@ rain(emoji="🎈", font_size=54,

<TileContainer>

<RefCard href="/develop/api-reference/navigation/st.switch_page">
<RefCard href="/develop/api-reference/navigation/st.navigation">

<h4>Switch page</h4>
<Image pure alt="screenshot" src="/images/api/navigation.jpg" />

Programmatically navigates to a specified page.
<h4>Navigation</h4>

Configure the available pages in a multipage app.

```python
st.switch_page("pages/my_page.py")
st.navigation({
"Your account" : [log_out, settings],
"Reports" : [overview, usage],
"Tools" : [search]
})
```

</RefCard>

<RefCard href="/develop/api-reference/navigation/st.page">

<Image pure alt="screenshot" src="/images/api/page.jpg" />

<h4>Page</h4>

Define a page in a multipage app.

```python
home = st.Page(
"home.py",
title="Home",
icon=":material/home:"
)
```

</RefCard>
Expand All @@ -1872,6 +1896,18 @@ st.page_link("pages/profile.py", label="My profile")

</RefCard>

<RefCard href="/develop/api-reference/navigation/st.switch_page">

<h4>Switch page</h4>

Programmatically navigates to a specified page.

```python
st.switch_page("pages/my_page.py")
```

</RefCard>

</TileContainer>

### Execution flow
Expand Down
17 changes: 0 additions & 17 deletions content/develop/api-reference/caching-and-state/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,23 +84,6 @@ st.query_params.clear()

<TileContainer>

<RefCard href="/develop/api-reference/caching-and-state/st.cache" deprecated={true}>

> This command was deprecated in version 1.18.0. Use `st.cache_data` or `st.cache_resource` instead.
<h4>Caching</h4>

Function decorator to memoize function executions.

```python
@st.cache(ttl=3600)
def run_long_computation(arg1, arg2):
# Do stuff here
return computation_output
```

</RefCard>

<RefCard href="/develop/api-reference/caching-and-state/st.experimental_memo" deprecated={true}>

> This command was deprecated in version 1.18.0. Use `st.cache_data` instead.
Expand Down
36 changes: 0 additions & 36 deletions content/develop/api-reference/caching-and-state/cache.md

This file was deleted.

2 changes: 1 addition & 1 deletion content/develop/api-reference/command-line/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ streamlit run <entrypoint file> [-- config options] [script args]

### Arguments

`<entrypoint file>`: The path to your entrypoint file for your Streamlit app. Your entrypoint file is your app's homepage.
`<entrypoint file>`: The path to your entrypoint file for your Streamlit app. In a multipage app with `st.navigation`, your entrypoint file acts as a router between your pages. Otherwise, your entrypoint file is your app's homepage.

### Options

Expand Down
47 changes: 0 additions & 47 deletions content/develop/api-reference/custom-components/html.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,50 +4,3 @@ slug: /develop/api-reference/custom-components/st.components.v1.html
---

<Autofunction function="streamlit.components.v1.html" />

#### Example

```python
import streamlit as st
import streamlit.components.v1 as components

# bootstrap 4 collapse example
components.html(
"""
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<div id="accordion">
<div class="card">
<div class="card-header" id="headingOne">
<h5 class="mb-0">
<button class="btn btn-link" data-toggle="collapse" data-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
Collapsible Group Item #1
</button>
</h5>
</div>
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
<div class="card-body">
Collapsible Group Item #1 content
</div>
</div>
</div>
<div class="card">
<div class="card-header" id="headingTwo">
<h5 class="mb-0">
<button class="btn btn-link collapsed" data-toggle="collapse" data-target="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
Collapsible Group Item #2
</button>
</h5>
</div>
<div id="collapseTwo" class="collapse" aria-labelledby="headingTwo" data-parent="#accordion">
<div class="card-body">
Collapsible Group Item #2 content
</div>
</div>
</div>
</div>
""",
height=600,
)
```
10 changes: 0 additions & 10 deletions content/develop/api-reference/custom-components/iframe.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,3 @@ slug: /develop/api-reference/custom-components/st.components.v1.iframe
---

<Autofunction function="streamlit.components.v1.iframe" />

#### Example

```python
import streamlit as st
import streamlit.components.v1 as components

# embed streamlit docs in a streamlit app
components.iframe("https://example.com", height=500)
```
36 changes: 36 additions & 0 deletions content/develop/api-reference/navigation/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,42 @@ slug: /develop/api-reference/navigation

<TileContainer>

<RefCard href="/develop/api-reference/navigation/st.navigation">

<Image pure alt="screenshot" src="/images/api/navigation.jpg" />

<h4>Navigation</h4>

Configure the available pages in a multipage app.

```python
st.navigation({
"Your account" : [log_out, settings],
"Reports" : [overview, usage],
"Tools" : [search]
})
```

</RefCard>

<RefCard href="/develop/api-reference/navigation/st.page">

<Image pure alt="screenshot" src="/images/api/page.jpg" />

<h4>Page</h4>

Define a page in a multipage app.

```python
home = st.Page(
"home.py",
title="Home",
icon=":material/home:"
)
```

</RefCard>

<RefCard href="/develop/api-reference/widgets/st.page_link">

<Image pure alt="screenshot" src="/images/api/page_link.jpg" />
Expand Down
7 changes: 7 additions & 0 deletions content/develop/api-reference/navigation/navigation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: st.navigation
slug: /develop/api-reference/navigation/st.navigation
description: st.navigation declares the set of available pages to select in a multipage app
---

<Autofunction function="streamlit.navigation" />
11 changes: 11 additions & 0 deletions content/develop/api-reference/navigation/page.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: st.Page
slug: /develop/api-reference/navigation/st.page
description: st.Page initializes a StreamlitPage object for multipage apps
---

<Autofunction function="streamlit.Page" />

<Autofunction function="StreamlitPage" />

<Autofunction function="StreamlitPage.run" />
3 changes: 3 additions & 0 deletions content/develop/concepts/architecture/fragments.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ Streamlit ignores fragment return values during fragment reruns, so defining ret

- Elements drawn in the main body of your fragment are cleared and redrawn in place during a fragment rerun. Repeated fragment reruns will not cause additional elements to appear.
- Elements drawn to containers outside the main body of fragment will not be cleared with each fragment rerun. Instead, Streamlit will draw them additively and these elements will accumulate until the next full-script rerun.
- A fragment can't draw widgets in containers outside of the main body of the fragment. Widgets can only go in the main body of a fragment.

To prevent elements from accumulating in outside containers, use [`st.empty`](/develop/api-reference/layout/st.empty) containers. For a related tutorial, see [Create a fragment across multiple containers](/develop/tutorials/execution-flow/create-a-multiple-container-fragment).

Expand Down Expand Up @@ -145,3 +146,5 @@ Caching saves you from unnecessarily running a piece of your app while the rest
- Fragments can't detect a change in input values. It is best to use Session State for dynamic input and output for fragment functions.
- Calling fragments within fragments is unsupported.
- Using caching and fragments on the same function is unsupported.
- Using fragments within callback functions is unsupported.
- Fragments can't render widgets in externally-created containers; widgets can only be in the main body of a fragment.
Loading

0 comments on commit e503e1c

Please sign in to comment.