streamlit / docs

Source code for the Streamlit Python library documentation
https://docs.streamlit.io
Apache License 2.0
119 stars 474 forks source link

Update Cloud component and output directive to use React components in streamlit.json #1062

Closed sfc-gh-dmatthews closed 5 months ago

sfc-gh-dmatthews commented 5 months ago

📚 Context

This is a variation/alternative to #1059

🧠 Description of Changes

This implements the same underlying correction as #1059. However, instead of pushing the raw text of the output directive into streamlit.json, this instead pushes the React code <Cloud ... /> into the "example" sections of streamlit.json. Within <Table>, the component is parsed and rendered with a slightly more human-friendly regex expression to pick out each embedded app.

This makes an easier template to follow if we desire other directives to produce React components (as would be particularly nice for SiS exceptions and version-preserving links in the future).

This PR updates all existing embedded apps in docstrings to <Cloud ... /> so older versions are styled consistently. The remainder of the older docstrings are preserved so no source links are broken and no newer information has bled into older versions.

Contribution License Agreement By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.

sfc-gh-tteixeira commented 5 months ago

FYI I updated stoutput.py in your PR with some comments and linting. PTAL!

sfc-gh-dmatthews commented 5 months ago

I'll generate 1.35.0 docstrings real quick to test, then merge it. TYSM!