HemanthSai7 commited on
Commit
409895b
Β·
1 Parent(s): a42ec60

Fixed spinner adn updated instructions

Browse files
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 3](assets/results3.jpg)
50
 
51
  ##### Demo Screenshot 2
52
- ![Result 2](assets/results2.jpg)
53
 
54
  ##### Demo Screenshot 3
55
- ![Result 1](assets/results1.jpg)
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

  • SHA256: 9d5b6fbbaaf3ba9eb6dc9dd37e23d3b9329b412a9856ca0ff0e0d9bd4ae98dba
  • Pointer size: 131 Bytes
  • Size of remote file: 114 kB
assets/results1.png ADDED
assets/results2.jpg DELETED

Git LFS Details

  • SHA256: c1497fd6f3c9f9bd0bd59606ee29326bf26ae60f93073b10ea2c5329f1fdf50f
  • Pointer size: 130 Bytes
  • Size of remote file: 91.4 kB
assets/results2.png ADDED
assets/results3.jpg DELETED

Git LFS Details

  • SHA256: 50b078bfaead6b2d7c53ce981303b41f0f7f115e7b2868239b6d6045bc16d861
  • Pointer size: 130 Bytes
  • Size of remote file: 82.8 kB
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
- if code_input:
94
- headers['Authorization'] = f"Bearer {st.session_state.access_token}"
95
- response = query_post(base_url + '/api/inference', headers=headers,
96
- data=json.dumps({'code_block':code_input, 'api_key':API_KEY}))
97
- docstr = response.json()["docstr"]
98
- comment_placeholder.subheader("Generated Documentation:")
99
- comment_placeholder.markdown(f"<pre><code>{docstr}</code></pre>", unsafe_allow_html=True)
100
- # Scroll to the comment section
101
- comment_placeholder.empty()
102
- comment_placeholder.markdown(f"<pre><code>{docstr}</code></pre>", unsafe_allow_html=True)
103
- else:
104
- st.warning("Please enter some code.")
 
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("The API Key can only be generated from the Techdocs Streamlit app. To start using the CLI, please generate an API Key from the Streamlit app.")
54
 
55
  with st.expander("βš™οΈ Installation and setup",expanded=True):
56
- st.text("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.text("2. Install Techdocs via pip:"); st.code("pip install techdocs","python")
58
- st.text("3. CD into your project directory.")
59
  st.code("CD <YOUR-PROJECT-DIRECTORY>","bash")
60
- st.text("4. Login into our Techdocs Streamlit app or signup if you don't have an account.")
61
- st.text("5. Generate an API Key from the Code page and paste it in the command below.")
62
- st.code("techdocs -k <API_KEY> -u <USERNAME> -p <PASSWORD> -d <ROOT-DIRECTORY-OF-THE -PROJECT>","bash")
63
- st.text("6. Wait for the documentation to be generated. You can view the status of the documentation generation in the CLI.")
 
 
 
 
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