Skip to content

Commit 4235496

Browse files
author
Randy Zwitch
authored
Add README (#2)
* Add image
1 parent 5754f29 commit 4235496

File tree

3 files changed

+39
-1
lines changed

3 files changed

+39
-1
lines changed

README.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,33 @@
1-
# streamlit-embedcode
1+
# streamlit-embedcode
2+
3+
streamlit-embedcode is the easiest way to embed code snippets into your Streamlit app! This component supports the following code sharing services:
4+
5+
- [GitHub gist](https://gist.github.com/)
6+
- [Gitlab snippets](https://gitlab.com/explore/snippets)
7+
- [Pastebin](https://pastebin.com/)
8+
- [CodePen](https://codepen.io/)
9+
- [Ideone](https://ideone.com/)
10+
- [TagMyCode](https://tagmycode.com/)
11+
12+
## Installation
13+
14+
streamlit-embedcode is distributed via PyPI:
15+
16+
```python
17+
pip install streamlit-embedcode
18+
```
19+
20+
## Examples
21+
22+
Using streamlit-embedcode is as simple as importing the code service you want to use:
23+
24+
```python
25+
import streamlit as st
26+
from streamlit_embedcode import github_gist
27+
28+
github_gist("https://gist.github.com/randyzwitch/be8c5e9fb5b8e7b046afebcac12e5087/")
29+
```
30+
31+
Optionally, you can provide arguments for `height`, `width` and `scrolling` to control the behavior of the iframe the content is displayed in.
32+
33+
![github_streamlit_embed](https://github.com/randyzwitch/streamlit-embedcode/blob/master/_static/gh_gist_example.png)

_static/gh_gist_example.png

92.1 KB
Loading

streamlit_embedcode/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,3 +209,9 @@ def tagmycode_snippet(link, height=600, width=950, scrolling=True):
209209
width=width,
210210
scrolling=scrolling,
211211
)
212+
213+
214+
github_gist(
215+
"https://gist.github.com/randyzwitch/be8c5e9fb5b8e7b046afebcac12e5087/", height=800
216+
)
217+

0 commit comments

Comments
 (0)