Skip to content

Commit

Permalink
feat: add requirements.txt and script to preview
Browse files Browse the repository at this point in the history
  • Loading branch information
ejseqera committed Feb 1, 2024
1 parent e9f3405 commit d0a25d3
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
6 changes: 6 additions & 0 deletions demo/docs/requirements.txt
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
35 changes: 35 additions & 0 deletions demo/preview_docs.sh
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

0 comments on commit d0a25d3

Please sign in to comment.