Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,23 +9,20 @@ language = st.selectbox("Pick a Programming Language:",
|
|
| 9 |
# Function to render markdown content with unsafe HTML based on the selected language
|
| 10 |
def render_language_content(selected_language):
|
| 11 |
if selected_language == "C":
|
| 12 |
-
|
| 13 |
-
|
| 14 |
elif selected_language == "C++":
|
| 15 |
-
|
| 16 |
-
|
| 17 |
elif selected_language == "C#":
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
elif selected_language == "JavaScript":
|
| 21 |
-
st.markdown("<h3 style='color:red;'>You selected JavaScript.</h3><p>Add your custom HTML here.</p>",
|
| 22 |
-
unsafe_allow_html=True)
|
| 23 |
elif selected_language == "Python":
|
| 24 |
website_url = "https://www.jdoodle.com/ia/1eQe"
|
| 25 |
st.components.v1.html(f"""<iframe src="{website_url}" width="100%" height="700px" frameborder="0"></iframe>""",height=700,)
|
| 26 |
elif selected_language == "HTML/CSS/JS":
|
| 27 |
-
|
| 28 |
-
|
| 29 |
|
| 30 |
# Call the function to render the selected content
|
| 31 |
render_language_content(language)
|
|
|
|
| 9 |
# Function to render markdown content with unsafe HTML based on the selected language
|
| 10 |
def render_language_content(selected_language):
|
| 11 |
if selected_language == "C":
|
| 12 |
+
website_url = "https://www.jdoodle.com/ia/1eQh"
|
| 13 |
+
st.components.v1.html(f"""<iframe src="{website_url}" width="100%" height="700px" frameborder="0"></iframe>""",height=700,)
|
| 14 |
elif selected_language == "C++":
|
| 15 |
+
website_url = "https://www.jdoodle.com/ia/1eQj"
|
| 16 |
+
st.components.v1.html(f"""<iframe src="{website_url}" width="100%" height="700px" frameborder="0"></iframe>""",height=700,)
|
| 17 |
elif selected_language == "C#":
|
| 18 |
+
website_url = "https://www.jdoodle.com/ia/1eQk"
|
| 19 |
+
st.components.v1.html(f"""<iframe src="{website_url}" width="100%" height="700px" frameborder="0"></iframe>""",height=700,)
|
|
|
|
|
|
|
|
|
|
| 20 |
elif selected_language == "Python":
|
| 21 |
website_url = "https://www.jdoodle.com/ia/1eQe"
|
| 22 |
st.components.v1.html(f"""<iframe src="{website_url}" width="100%" height="700px" frameborder="0"></iframe>""",height=700,)
|
| 23 |
elif selected_language == "HTML/CSS/JS":
|
| 24 |
+
website_url = "https://www.jdoodle.com/ih/1eQl"
|
| 25 |
+
st.components.v1.html(f"""<iframe src="{website_url}" width="100%" height="1000px" frameborder="0"></iframe>""",height=1000,)
|
| 26 |
|
| 27 |
# Call the function to render the selected content
|
| 28 |
render_language_content(language)
|