Skip to content

dropdown versioned docs #58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 6 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
public
./public
./public/*
# ignore the public folder at the root directory
/public/
# ignore for macs
.DS_Store
# for debugging locally
/output.txt/
/err.txt/
71 changes: 71 additions & 0 deletions all-versions-smoo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#!/bin/bash

# Set the base directory for versions
versions_dir="./v-saved/all-saved"

latest_v="v0.6.4"

echo "hi0"

# delete /main/ in v-saved setup for now.
main_version_dir="$versions_dir/main"
rm -rf $main_version_dir

echo "hi1"

# setup to run all of `smoo.sh`es for each sub-directory:
# -- for each folder in v, run smoo.sh and pass in the proper
# versioning info 'vX.Y.Z' s.t. they go to the right public
# folder

# Navigate to the version directory
# cd "$versions_dir"

# Loop through each version subdirectory and execute smoo.sh
# Retrieve list of directories and store in an array
directories=($(find "$versions_dir" -maxdepth 1 -mindepth 1 -type d -exec basename {} \;))

# Echo directories to check what's captured
echo "Directories in $versions_dir:"
printf "%s\n" "${directories[@]}"

# Example of processing each directory
for dir in "${directories[@]}"; do
version=${dir%/} # Strip trailing slash to get the version name

echo "Processing version $version..."

# Change to the version directory
# cd "$version"

echo "pwd:" $(pwd)
echo "smoo.sh is:" "$versions_dir/$version/smoo.sh"

# Check if smoo.sh exists and is executable
if [[ -x "$versions_dir/$version/smoo.sh" ]]; then
# Execute smoo.sh with the version as a parameter
$versions_dir/$version/smoo.sh
else
echo "Error: smoo.sh is not executable or found"
fi

# Go back to the version directory
# cd ..
done

# Return to the original directory
# cd ..

# run /main/ in v-saved setup now.
rm -rf $main_version_dir
mkdir $main_version_dir
echo "removed and recreated: $main_version_dir"
# copy everything except the folders .github, public, and v-saved
# to the /main/ section in v-saved/all
rsync -av --exclude='err.txt' --exclude='output.txt' --exclude='.github/' --exclude='.git' --exclude='public/' --exclude='v-saved/' ./ $main_version_dir
echo "copied current main documentation to: $main_version_dir"

# cd "$main_version_dir"
echo "pwd:" $(pwd)
./$main_version_dir/smoo.sh "main"
# cd -
Empty file added err.txt
Empty file.
Loading