diff --git a/frontend/src/components/application_spaces/GradioInitializeGuide.vue b/frontend/src/components/application_spaces/GradioInitializeGuide.vue index f799cad1d..5600f3ca9 100644 --- a/frontend/src/components/application_spaces/GradioInitializeGuide.vue +++ b/frontend/src/components/application_spaces/GradioInitializeGuide.vue @@ -88,7 +88,7 @@ } const httpsCloneCodeMarkdown = computed(() => { - const httpsCloneCode = ` git clone ${props.httpCloneUrl}` + const httpsCloneCode = `git clone ${props.httpCloneUrl}` return getMarkdownCode(httpsCloneCode, 'bash') }) @@ -98,29 +98,44 @@ }) const sshCloneCodeMarkdown = computed(() => { - const sshCloneCode = ` git clone ${props.sshCloneUrl}` + const sshCloneCode = `git clone ${props.sshCloneUrl}` return getMarkdownCode(sshCloneCode, 'bash') }) - const appPyCode = `import gradio as gr - -def greet(name): - return "Hello " + name + "!!" - -iface = gr.Interface(fn=greet, inputs="text", outputs="text") -iface.launch()` + const appPyCode = [ + 'import gradio as gr', + '', + 'def greet(name):', + ' return "Hello " + name + "!!"', + '', + 'iface = gr.Interface(fn=greet, inputs="text", outputs="text")', + 'iface.launch()' + ].join('\n') const appPyCodeMarkdown = computed(() => { - return getMarkdownCode(appPyCode, 'python', true) + return [ + '', + '```python', + appPyCode, + '```', + '' + ].join('\n') }) - const pushCode = `git add app.py - git commit -m "Add application file" - git push` + const pushCode = [ + 'git add app.py', + 'git commit -m "Add application file"', + 'git push' + ].join('\n') const pushCodeMarkdown = computed(() => { - return getMarkdownCode(pushCode, 'bash', true) + - '{data-clipboard-text="git add app.py && git commit -m \'Add application file\' && git push"}' + return [ + '', + '```bash', + pushCode, + '```', + '' + ].join('\n') }) const toggleActiveTab = (event) => { diff --git a/frontend/src/components/application_spaces/StreamlitInitializeGuide.vue b/frontend/src/components/application_spaces/StreamlitInitializeGuide.vue index 68d2d37c4..5417a5395 100644 --- a/frontend/src/components/application_spaces/StreamlitInitializeGuide.vue +++ b/frontend/src/components/application_spaces/StreamlitInitializeGuide.vue @@ -94,7 +94,7 @@ } const httpsCloneCodeMarkdown = computed(() => { - const httpsCloneCode = ` git clone ${props.httpCloneUrl}` + const httpsCloneCode = `git clone ${props.httpCloneUrl}` return getMarkdownCode(httpsCloneCode, 'bash') }) @@ -104,26 +104,41 @@ }) const sshCloneCodeMarkdown = computed(() => { - const sshCloneCode = ` git clone ${props.sshCloneUrl}` + const sshCloneCode = `git clone ${props.sshCloneUrl}` return getMarkdownCode(sshCloneCode, 'bash') }) - const appPyCode = `import streamlit as st - -x = st.slider('Select a value') -st.write(x, 'squared is', x * x)` + const appPyCode = [ + 'import streamlit as st', + '', + 'x = st.slider(\'Select a value\')', + 'st.write(x, \'squared is\', x * x)' + ].join('\n') const appPyCodeMarkdown = computed(() => { - return getMarkdownCode(appPyCode, 'python', true) + return [ + '', + '```python', + appPyCode, + '```', + '' + ].join('\n') }) - const pushCode = `git add app.py - git commit -m "Add application file" - git push` + const pushCode = [ + 'git add app.py', + 'git commit -m "Add application file"', + 'git push' + ].join('\n') const pushCodeMarkdown = computed(() => { - return getMarkdownCode(pushCode, 'bash', true) + - '{data-clipboard-text="git add app.py && git commit -m \'Add application file\' && git push"}' + return [ + '', + '```bash', + pushCode, + '```', + '' + ].join('\n') }) const toggleActiveTab = (event) => {