-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Code restructuring for frontend module * Code restructuring for frontend module
- Loading branch information
1 parent
b2236e3
commit bd3ff20
Showing
16 changed files
with
182 additions
and
253 deletions.
There are no files selected for viewing
File renamed without changes.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from .authors import authors | ||
from .logout import logout | ||
from .login import login | ||
from .user_greetings import user_greetings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import json | ||
import streamlit as st | ||
|
||
def authors(): | ||
# {"Github → " "["username"]" "("url")" for username,url in author_details["socials"].items() } | ||
# with open("frontend/contend/authors.json","r") as f: | ||
# author_details = json.load(f) | ||
st.sidebar.divider() | ||
st.sidebar.info( | ||
""" | ||
Follow us on: | ||
Github → [@mayureshagashe2105](https://github.com/MayureshAgashe2105)\n | ||
Github → [@HemanthSai7](https://github.com/HemanthSai7) | ||
""" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import streamlit as st | ||
|
||
def logout(): | ||
del st.session_state["access_token"] | ||
del st.session_state["refresh_token"] | ||
del st.session_state["username"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import streamlit as st | ||
from .logout import logout | ||
|
||
def user_greetings(): | ||
with st.sidebar.expander("🧑Account Details",expanded=True): | ||
if 'username' not in st.session_state: | ||
st.warning("Please Login or Signup to continue") | ||
else: | ||
st.info(f"Welcome, {st.session_state.username}! 😄") | ||
if st.button("Logout 👋"): | ||
logout() | ||
st.rerun() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
1. Python version requirement: | ||
```bash | ||
$ python >= 3.10 | ||
``` | ||
2. Install Techdocs via pip: | ||
```bash | ||
$ pip install techdocs | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
1. Navigate into your project directory. | ||
|
||
```bash | ||
$ cd <YOUR-PROJECT-DIRECTORY> | ||
``` | ||
|
||
2. Once the installation is complete, type `techdocs` in the terminal. You should be able to see info about our CLI. | ||
|
||
```bash | ||
$ techdocs | ||
``` | ||
|
||
3. If you are a `new user`, `signup` for a new account using the command below **OR** Head on to [Techdocs](https://techdocs.streamlit.app) and signup for a new account. | ||
|
||
```bash | ||
$ techdocs signup -u <username> -p <password> -e <email> | ||
``` | ||
|
||
4. If you already have your `API KEY`, you can skip step 5. | ||
|
||
5. Generate your `API key` using the command below **OR** Head on to [Techdocs](https://techdocs.streamlit.app/demo) and generate your `API KEY`. | ||
|
||
```bash | ||
$ techdocs apikey -u <username> -p <password> | ||
``` | ||
|
||
6. Once you have your `API key`, you can generate the documentation using the command below. | ||
|
||
```bash | ||
$ techdocs generate -k <API_KEY> -u <USERNAME> -p <PASSWORD> -d <ROOT-DIRECTORY-OF-THE-PROJECT> | ||
``` | ||
|
||
6. Wait for the `documentation` to be generated. Your `.py` files will be parsed and the documentation will be generated in the files itself. The tool will log the progress in the terminal and the file will be updated once all the functions are parsed. |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import json | ||
import streamlit as st | ||
|
||
from typing import Callable | ||
|
||
from components import authors, user_greetings, login | ||
|
||
def mainlayout(func: Callable): | ||
with open("layouts/st_page_layouts.json", "r",encoding='utf-8') as f: | ||
st_page_layouts = json.load(f) | ||
st.set_page_config(**st_page_layouts[f"{func.__name__}" if func.__name__ in st_page_layouts.keys() else "home"]) | ||
st.markdown("## :rainbow[Welcome to Techdocs: Where Code Meets Clarity!]🚀") | ||
|
||
user_greetings() | ||
|
||
if 'access_token' not in st.session_state: | ||
st.session_state.runpage = login | ||
else: | ||
st.session_state.runpage = func | ||
|
||
def load_page(): | ||
return st.session_state.runpage() | ||
load_page() | ||
authors() | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"home": { | ||
"page_title": "Techdocs", | ||
"layout": "wide", | ||
"page_icon": "🏡", | ||
"initial_sidebar_state": "expanded" | ||
}, | ||
"demo": { | ||
"page_title": "demo", | ||
"layout": "wide", | ||
"page_icon": "💻", | ||
"initial_sidebar_state": "expanded" | ||
}, | ||
"instructions": { | ||
"page_title": "Instructions", | ||
"layout": "wide", | ||
"page_icon": "📝", | ||
"initial_sidebar_state": "expanded" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import streamlit as st | ||
from PIL import Image | ||
|
||
from layouts.mainlayout import mainlayout | ||
|
||
@mainlayout | ||
def instructions(): | ||
with open("content/installation.md", "r",encoding='utf-8') as f: | ||
instructions = f.read() | ||
|
||
with open("content/working.md", "r",encoding='utf-8') as f: | ||
working = f.read() | ||
|
||
|
||
st.markdown("### 📝 :rainbow[Using Techdocs via the CLI]") | ||
st.info("Please use the CLI to generate the documentation for your project. The Streamlit app is just a demo to give the user an idea of the project.") | ||
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.") | ||
|
||
with st.expander("⚙️ Installation and setup"): | ||
st.markdown(instructions) | ||
|
||
with st.expander("🚀 CLI and Working", expanded=True): | ||
st.markdown(working) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.