Spaces:
Runtime error
Runtime error
Commit
Β·
409895b
1
Parent(s):
a42ec60
Fixed spinner adn updated instructions
Browse files- README.md +3 -3
- assets/results1.jpg +0 -3
- assets/results1.png +0 -0
- assets/results2.jpg +0 -3
- assets/results2.png +0 -0
- assets/results3.jpg +0 -3
- assets/results3.png +0 -0
- frontend/.streamlit/config.toml +0 -1
- frontend/pages/Code.py +13 -14
- frontend/pages/Usage.py +12 -8
- frontend/π‘_Home.py +1 -3
README.md
CHANGED
@@ -46,13 +46,13 @@ $ streamlit run app.py # For running the Streamlit App
|
|
46 |
|
47 |
## Demo and Screenshots
|
48 |
##### Demo Screenshot 1
|
49 |
-
![Result
|
50 |
|
51 |
##### Demo Screenshot 2
|
52 |
-
![Result 2](assets/results2.
|
53 |
|
54 |
##### Demo Screenshot 3
|
55 |
-
![Result
|
56 |
|
57 |
## Tech Stack Used
|
58 |
![Python](https://img.shields.io/badge/python-3670A0?style=for-the-badge&logo=python&logoColor=ffdd54)
|
|
|
46 |
|
47 |
## Demo and Screenshots
|
48 |
##### Demo Screenshot 1
|
49 |
+
![Result 1](assets/results1.png)
|
50 |
|
51 |
##### Demo Screenshot 2
|
52 |
+
![Result 2](assets/results2.png)
|
53 |
|
54 |
##### Demo Screenshot 3
|
55 |
+
![Result 3](assets/results3.png)
|
56 |
|
57 |
## Tech Stack Used
|
58 |
![Python](https://img.shields.io/badge/python-3670A0?style=for-the-badge&logo=python&logoColor=ffdd54)
|
assets/results1.jpg
DELETED
Git LFS Details
|
assets/results1.png
ADDED
![]() |
assets/results2.jpg
DELETED
Git LFS Details
|
assets/results2.png
ADDED
![]() |
assets/results3.jpg
DELETED
Git LFS Details
|
assets/results3.png
ADDED
![]() |
frontend/.streamlit/config.toml
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
[theme]
|
2 |
-
|
3 |
primaryColor="#818cf8"
|
4 |
backgroundColor="#FFFFFF"
|
5 |
secondaryBackgroundColor="#F0F2F6"
|
|
|
1 |
[theme]
|
|
|
2 |
primaryColor="#818cf8"
|
3 |
backgroundColor="#FFFFFF"
|
4 |
secondaryBackgroundColor="#F0F2F6"
|
frontend/pages/Code.py
CHANGED
@@ -1,6 +1,5 @@
|
|
1 |
import json
|
2 |
import requests
|
3 |
-
from PIL import Image
|
4 |
|
5 |
import streamlit as st
|
6 |
from Login import auth_page
|
@@ -10,7 +9,6 @@ st.set_page_config(
|
|
10 |
page_icon="π¨βπ»",
|
11 |
layout="wide",
|
12 |
initial_sidebar_state="expanded",
|
13 |
-
menu_items={"About": "Built by @HemanthSai7 and @MayureshAgashe2107 with Streamlit"},
|
14 |
)
|
15 |
|
16 |
st.markdown("## :rainbow[Welcome to Techdocs: Where Code Meets Clarity!] π")
|
@@ -90,18 +88,19 @@ def code_page():
|
|
90 |
comment_placeholder = st.empty()
|
91 |
|
92 |
if st.button("π€ Generate Documentation"):
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
|
|
105 |
|
106 |
st.sidebar.divider()
|
107 |
st.sidebar.info(
|
|
|
1 |
import json
|
2 |
import requests
|
|
|
3 |
|
4 |
import streamlit as st
|
5 |
from Login import auth_page
|
|
|
9 |
page_icon="π¨βπ»",
|
10 |
layout="wide",
|
11 |
initial_sidebar_state="expanded",
|
|
|
12 |
)
|
13 |
|
14 |
st.markdown("## :rainbow[Welcome to Techdocs: Where Code Meets Clarity!] π")
|
|
|
88 |
comment_placeholder = st.empty()
|
89 |
|
90 |
if st.button("π€ Generate Documentation"):
|
91 |
+
with st.spinner("Generating Documentation..."):
|
92 |
+
if code_input:
|
93 |
+
headers['Authorization'] = f"Bearer {st.session_state.access_token}"
|
94 |
+
response = query_post(base_url + '/api/inference', headers=headers,
|
95 |
+
data=json.dumps({'code_block':code_input, 'api_key':API_KEY}))
|
96 |
+
docstr = response.json()["docstr"]
|
97 |
+
comment_placeholder.subheader("Generated Documentation:")
|
98 |
+
comment_placeholder.markdown(f"<pre><code>{docstr}</code></pre>", unsafe_allow_html=True)
|
99 |
+
# Scroll to the comment section
|
100 |
+
comment_placeholder.empty()
|
101 |
+
comment_placeholder.markdown(f"<pre><code>{docstr}</code></pre>", unsafe_allow_html=True)
|
102 |
+
else:
|
103 |
+
st.warning("Please enter some code.")
|
104 |
|
105 |
st.sidebar.divider()
|
106 |
st.sidebar.info(
|
frontend/pages/Usage.py
CHANGED
@@ -50,17 +50,21 @@ def usage():
|
|
50 |
|
51 |
st.markdown("### π :rainbow[Using Techdocs via the CLI]")
|
52 |
st.info("Please use the CLI to generate the documentation for your project. The Streamlit app is just a preview to give the user an idea of the project.")
|
53 |
-
st.warning("
|
54 |
|
55 |
with st.expander("βοΈ Installation and setup",expanded=True):
|
56 |
-
st.
|
57 |
-
st.
|
58 |
-
st.
|
59 |
st.code("CD <YOUR-PROJECT-DIRECTORY>","bash")
|
60 |
-
|
61 |
-
|
62 |
-
st.
|
63 |
-
st.
|
|
|
|
|
|
|
|
|
64 |
|
65 |
st.sidebar.divider()
|
66 |
st.sidebar.info(
|
|
|
50 |
|
51 |
st.markdown("### π :rainbow[Using Techdocs via the CLI]")
|
52 |
st.info("Please use the CLI to generate the documentation for your project. The Streamlit app is just a preview to give the user an idea of the project.")
|
53 |
+
st.warning("To start using the CLI, please generate an API Key from the Streamlit app. You can also generate the API Key from the CLI.")
|
54 |
|
55 |
with st.expander("βοΈ Installation and setup",expanded=True):
|
56 |
+
st.write("1. Create a virtual environment. We recommend using conda but you can python's venv as well:"); st.code("conda create -n techdocs python=3.11","python")
|
57 |
+
st.write("2. Install Techdocs via pip:"); st.code("pip install techdocs","python")
|
58 |
+
st.write("3. CD into your project directory.")
|
59 |
st.code("CD <YOUR-PROJECT-DIRECTORY>","bash")
|
60 |
+
|
61 |
+
with st.expander("π CLI and Working", expanded=True):
|
62 |
+
st.write("1. Once the installation is complete, type **techdocs** in the terminal. You should be able to see info about our CLI.")
|
63 |
+
st.write("2. You can login into our Techdocs app using the CLI or create an account if you don't have one. To signup, type the following command in the terminal:")
|
64 |
+
st.code("techdocs signup -u <username> -p <password> -e <email>", "bash")
|
65 |
+
st.write("3. Generate an API Key from the Code page and paste it in the command below.")
|
66 |
+
st.code("techdocs generate -k <API_KEY> -u <USERNAME> -p <PASSWORD> -d <ROOT-DIRECTORY-OF-THE-PROJECT>","bash")
|
67 |
+
st.write("4. Wait for the documentation to be generated. You can view the status of the documentation generation in the CLI.")
|
68 |
|
69 |
st.sidebar.divider()
|
70 |
st.sidebar.info(
|
frontend/π‘_Home.py
CHANGED
@@ -1,7 +1,5 @@
|
|
1 |
import streamlit as st
|
2 |
from Login import auth_page
|
3 |
-
from PIL import Image
|
4 |
-
import textwrap
|
5 |
|
6 |
import base64
|
7 |
|
@@ -9,7 +7,7 @@ st.set_page_config(
|
|
9 |
page_title="Techdocs",
|
10 |
layout="wide",
|
11 |
page_icon="π‘",
|
12 |
-
initial_sidebar_state="expanded"
|
13 |
)
|
14 |
|
15 |
@st.cache_data
|
|
|
1 |
import streamlit as st
|
2 |
from Login import auth_page
|
|
|
|
|
3 |
|
4 |
import base64
|
5 |
|
|
|
7 |
page_title="Techdocs",
|
8 |
layout="wide",
|
9 |
page_icon="π‘",
|
10 |
+
initial_sidebar_state="expanded"
|
11 |
)
|
12 |
|
13 |
@st.cache_data
|