Skip to content

Commit

Permalink
refactor-doc-structure (#353)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkeithX authored Feb 23, 2025
2 parents b2cd3c6 + 6d0ace1 commit 02f2182
Show file tree
Hide file tree
Showing 84 changed files with 1,011 additions and 1,753 deletions.
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ updates:
- package-ecosystem: 'npm'
directory: '/website'
schedule:
interval: 'weekly'
open-pull-requests-limit: 99
interval: 'daily'
open-pull-requests-limit: 0
labels:
- 'pr: dependencies'
reviewers:
Expand Down
17 changes: 12 additions & 5 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,37 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Python Debug",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
},
{
"type": "node-terminal",
"name": "START",
"name": "WEBSITE:START",
"request": "launch",
"command": "npm run start",
"command": "npm start",
"cwd": "${workspaceFolder}\\website"
},
{
"type": "node-terminal",
"name": "START:FAST",
"name": "WEBSITE:START:FAST",
"request": "launch",
"command": "npm run start:fast",
"cwd": "${workspaceFolder}\\website"
},
{
"type": "node-terminal",
"name": "SERVE:FAST",
"name": "WEBSITE:SERVE:FAST",
"request": "launch",
"command": "npm run serve:fast",
"cwd": "${workspaceFolder}\\website"
},
{
"type": "node-terminal",
"name": "Clear",
"name": "WEBSITE:CLEAR",
"request": "launch",
"command": "npm run clear",
"cwd": "${workspaceFolder}\\website"
Expand Down
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"yaml.schemas": {
"https://json.schemastore.org/github-issue-config.json": "/*"
}
}
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<div align="left">
<h1 align="left">
<a href="https://mkeithx.github.io">
<img src="./website/static/img/banner/social-banner.png" target="_blank" alt="The SpaceHub Project" width="1920">
<img src="./public/img/github-banner-new.png" target="_blank" alt="The SpaceHub Project">
</a>
<b>SpaceHub Project</b>
<!-- <b>Welcome</b>! -->
</h1>
</div>



This repo contains the configurations and source code powering the **SpaceHub Project** docs [website](https://mkeithx.github.io).

## Overview
Expand Down
72 changes: 72 additions & 0 deletions examples/python-starters/09-weather-forecast/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import os
import sys
import requests
from dotenv import load_dotenv
load_dotenv()
import datetime

api_key = os.getenv('OPENWEATHER_API_KEY')

def get_weather(city):
url = f'http://api.openweathermap.org/data/2.5/weather?q={city}&appid={api_key}&units=metric'

response = requests.get(url)
if response.status_code == 200:
data = response.json()
weather = {
'city': data['name'],
'description': data['weather'][0]['description'],
'temperature_min': data['main']['temp_min'],
'temperature_max': data['main']['temp_max'],
'humidity': data['main']['humidity'],
'wind_speed': data['wind']['speed'],
}
return weather
else:
return None

def get_city():


city = input('Enter city name: ')
weather = get_weather(city)


if weather:
print(f"Current weather in {weather['city']}:")
print(f"Description: {weather['description']}")
print(f"Temperature [min]: {weather['temperature_min']} °C")
print(f"Temperature [max]: {weather['temperature_max']} °C")
print(f"Humidity: {weather['humidity']}%")
print(f"Wind speed: {weather['wind_speed']} m/s")
else:
print(f"Could not retrieve weather information for {city}")

def main():
os.system('cls' if os.name == 'nt' else 'clear')
# today = datetime.date.today()
date = datetime.datetime.now()
today = "{:%m/%d/%Y %H:%M:%S}".format(date)

app_name = 'Weather Forecast'
border_length = max(len(app_name), len(today)) + 9
print("+" + "-" * (border_length - 2) + "+")
print(f" {app_name}")
print(f"{today}")
print("+" + "-" * (border_length - 2) + "+")
get_city()


while True:
response = input('\nCheck another city? (Y/N): ')
if response == 'y' or response == 'Y':
main()
elif response == 'n' or response == 'N':
print('\nThank you and have a great day.\n')
sys.exit()
else:
print('\nError: Please select y or n.\n')
continue

if __name__ == '__main__':
main()
55 changes: 55 additions & 0 deletions examples/python-starters/10-roman-numerals-converter/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import os
import sys


def dec_to_roman(dec):
roman_numerals = [
(1000, 'M'),
(900, 'CM'),
(500, 'D'),
(400, 'CD'),
(100, 'C'),
(90, 'XC'),
(50, 'L'),
(40, 'XL'),
(10, 'X'),
(9, 'IX'),
(5, 'V'),
(4, 'IV'),
(1, 'I')
]

roman = ""
for value, numeral in roman_numerals:
while dec >= value:
roman += numeral
dec -= value

return roman

def main():
os.system('cls' if os.name == 'nt' else 'clear')
app_name = 'Decimal to Roman Numerals'
border_length = len(app_name) + 4
print("+" + "-" * (border_length - 2) + "+")
print(f" {app_name} ")
print("+" + "-" * (border_length - 2) + "+")
print()

decimal_num = int(input("Enter number in decimal: "))
roman_number = dec_to_roman(decimal_num)
print(f"Decimal number {decimal_num} is {roman_number} in numerals.")

while True:
response = input('\nDo you want to continue? (Y/N) ')
if response.lower() == 'y':
main()
elif response.lower() == 'n':
print('\nThank you and have a great day.\n')
sys.exit()
else:
print('\nError: Please select Y or N.\n')


if __name__ == '__main__':
main()
31 changes: 15 additions & 16 deletions examples/python-starters/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,36 +20,35 @@ A step by step guide that will tell you how to get the development environment u

1. **Clone repository**

```bash
git clone https://github.com/mkeithX/mkeithx.github.io/tree/main/examples/python-starters.git
```
```bash
git clone https://github.com/mkeithX/mkeithx.github.io/tree/main/examples/python-starters.git
```
2. **Go to your project directory**

```bash
cd python-starters
```
```bash
cd python-starters
```

3. **Setup Virtual Environment**


```bash
py -m venv .venv
```
```bash
py -m venv .venv
```

4. **Activate Virtual Environment**

```bash
.venv\scripts\activate.ps1
```
```bash
.venv\scripts\activate.ps1
```

5. **Install dependencies**

```py
py -m pip install --upgrade -r requirements.txt
```
```py
py -m pip install --upgrade -r requirements.txt
```



## Additional Documentation and Acknowledgments

Read the [docs](https://mkeithx.github.io/docs/repo/python-starters) to learn more.
8 changes: 1 addition & 7 deletions examples/python-starters/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
openai
python-dotenv
qrcode
requests
yt-dlp
Flask
python-dotenv
-r requirements/development.txt
4 changes: 4 additions & 0 deletions examples/python-starters/requirements/development.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
python-dotenv
qrcode
requests
yt-dlp
90 changes: 90 additions & 0 deletions examples/readme-templates/advanced-formatting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Advanced formatting

## Alerts/Admonitions

> [!NOTE]
> Highlights information that users should take into account, even when skimming.
> [!TIP]
> Optional information to help a user be more successful.
> [!IMPORTANT]
> Crucial information necessary for users to succeed.
> [!WARNING]
> Critical content demanding immediate user attention due to potential risks.
> [!CAUTION]
> Negative potential consequences of an action.
## Code Blocks

```sh
py -c 'import this'
```

```sh
git add --all
git commit -m "initial commit"
```

```sh
git add --all && git commit -m "initial commit"
```

## Collapsed Section

### Default

<details>
<summary>Click to Expand</summary>

The quick brown fox jumps over the lazy dog.

_The quick brown fox jumps over the lazy dog._

1. Step one

Do this

2. Step two

Not That

3. Final

```sh
py -m pip install --upgrade pip
```

Thank you!

</details>

### Open

<details open>
<summary>Click to collapse</summary>

The quick brown fox jumps over the lazy dog.

_The quick brown fox jumps over the lazy dog._

1. Step one

Do this

2. Step two

Not That

3. Final

```sh
py -m pip install --upgrade pip
```
</details>

## Want more?

Check out this [website](https://mkeithx.github.io/).
Loading

0 comments on commit 02f2182

Please sign in to comment.