Skip to content

Commit 03e6893

Browse files
sfc-gh-jriekejriekecursoragent
authored
Add st.metric icon example app for 1.61.0 (#1507)
* Add st.metric icon example app for 1.61.0 Co-authored-by: Cursor <cursoragent@cursor.com> * Check example apps for elements with added params, not just new commands Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Johannes Rieke <johannes.rieke@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 49c4a0d commit 03e6893

2 files changed

Lines changed: 29 additions & 2 deletions

File tree

.cursor/skills/update-docs-for-release/SKILL.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,33 @@ Place images at `public/images/api/<name>.jpg`.
132132
133133
## 5. Example apps
134134
135-
For each new command, check `python/streamlit.json` under the `x.y.0` key for embedded `<Cloud name="...">` elements in the `examples` field. These are interactive apps that need to be deployed to Community Cloud.
135+
New demo apps can be added both for brand-new commands and for existing commands that gained a parameter (a new example is often added to demonstrate it). So check for newly added `<Cloud name="...">` embeds across all commands, not just new ones.
136136
137-
For each Cloud embed found:
137+
The reliable way to find them is to diff the embedded Cloud names between the previous and new version keys in `python/streamlit.json`. For example:
138+
139+
```bash
140+
cd python
141+
.venv-generate/bin/python -c "
142+
import json, re
143+
d = json.load(open('streamlit.json'))
144+
def cloud_names(ver):
145+
out = {}
146+
for k, v in d[ver].items():
147+
for field in ('example', 'examples'):
148+
for m in re.findall(r'<Cloud[^>]*name=\"([^\"]+)\"', v.get(field, '') or ''):
149+
out.setdefault(k, set()).add(m)
150+
return out
151+
prev, new = cloud_names('x.y-1.0'), cloud_names('x.y.0')
152+
for k, names in new.items():
153+
added = names - prev.get(k, set())
154+
if added:
155+
print(k, sorted(added))
156+
"
157+
```
158+
159+
Every embed printed is a new interactive app that needs to be deployed to Community Cloud.
160+
161+
For each new Cloud embed found:
138162

139163
1. Extract the `name` attribute (e.g. `doc-mermaid-chart`) — this is the required subdomain.
140164
2. Extract the code from the adjacent `<pre>` block (strip HTML tags and unescape HTML entities).
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import streamlit as st
2+
3+
st.metric("Temperature", "70 °F", "1.2 °F", icon=":material/thermostat:")

0 commit comments

Comments
 (0)