Skip to content

Commit

Permalink
Add get_option, set_option (#1082)
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-dmatthews authored Jun 4, 2024
1 parent 35426ae commit b43ea9c
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 0 deletions.
22 changes: 22 additions & 0 deletions content/develop/api-reference/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2346,6 +2346,28 @@ your-project/
└── your_app.py
```

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

<h4>Get config option</h4>

Retrieve a single configuration option.

```python
st.get_option("theme.primaryColor")
```

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

<h4>Set config option</h4>

Set a single configuration option. (This is very limited.)

```python
st.set_option("deprecation.showPyplotGlobalUse", False)
```

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

Expand Down
22 changes: 22 additions & 0 deletions content/develop/api-reference/configuration/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,28 @@ your-project/
└── your_app.py
```

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

<h4>Get config option</h4>

Retrieve a single configuration option.

```python
st.get_option("theme.primaryColor")
```

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

<h4>Set config option</h4>

Set a single configuration option. (This is very limited.)

```python
st.set_option("deprecation.showPyplotGlobalUse", False)
```

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

Expand Down
7 changes: 7 additions & 0 deletions content/develop/api-reference/configuration/get_option.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: st.get_option
slug: /develop/api-reference/configuration/st.get_option
description: st.get_option retrieves a single configuration option.
---

<Autofunction function="streamlit.get_option" />
7 changes: 7 additions & 0 deletions content/develop/api-reference/configuration/set_option.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: st.set_option
slug: /develop/api-reference/configuration/st.set_option
description: st.set_option updates a single configuration option.
---

<Autofunction function="streamlit.set_option" />
6 changes: 6 additions & 0 deletions content/menu.md
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,12 @@ site_menu:
- category: Develop / API reference / Configuration / config.toml
url: /develop/api-reference/configuration/config.toml
isVersioned: true
- category: Develop / API reference / Configuration / st.get_option
url: /develop/api-reference/configuration/st.get_option
isVersioned: true
- category: Develop / API reference / Configuration / st.set_option
url: /develop/api-reference/configuration/st.set_option
isVersioned: true
- category: Develop / API reference / Configuration / st.set_page_config
url: /develop/api-reference/configuration/st.set_page_config
isVersioned: true
Expand Down

0 comments on commit b43ea9c

Please sign in to comment.