forked from ejseqera/showcase
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add requirements.txt and script to preview
- Loading branch information
Showing
2 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
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 @@ | ||
markdown~=3.5 | ||
mkdocs~=1.5.3 | ||
mkdocs-material~=9.5.6 | ||
mkdocs-material-extensions>=1.0 | ||
pygments~=2.16 | ||
pymdown-extensions~=10.2 |
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,35 @@ | ||
#!/bin/bash | ||
# Run this script to install dependencies and preview the docs | ||
|
||
# Check if Python and pip are installed | ||
if ! command -v python3 &> /dev/null || ! command -v pip &> /dev/null | ||
then | ||
echo "Python3 and pip are required, but not found. Please install them." | ||
exit 1 | ||
fi | ||
|
||
# Function to check if a Python package is installed | ||
is_installed() { | ||
pip list | grep "$1" &> /dev/null | ||
} | ||
|
||
# Check and install requirements | ||
while IFS= read -r package; do | ||
# Skip lines that are empty or start with '#' | ||
if [[ -z "$package" || "$package" == \#* ]]; then | ||
continue | ||
fi | ||
|
||
# Extract package name (ignoring version) | ||
package_name=$(echo "$package" | awk -F'[=><!~]' '{print $1}') | ||
if is_installed "$package_name"; then | ||
echo "$package_name is already installed." | ||
else | ||
echo "Installing $package..." | ||
pip install "$package" | ||
fi | ||
done < docs/requirements.txt | ||
|
||
# Start the mkdocs local server | ||
echo "Starting mkdocs server..." | ||
mkdocs serve |