Skip to content
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ help:
@echo " woke - Check inclusive language with woke"
@echo ""
@echo " Documentation Aggregation:"
@echo " aggregate-local - Aggregate from local repos using relative paths (../gardenlinux ../builder ../python-gardenlinux-lib)"
@echo " test-aggregate-local - Test aggregation with local repos (recommended first)"
@echo " aggregate - Fetch and aggregate docs from all source repos"
@echo " aggregate-dry - Test aggregation without modifying docs/"
Expand Down Expand Up @@ -71,6 +72,10 @@ test-aggregate-local: install
@echo "Testing aggregation with local repositories..."
./scripts/test-local.sh --dry-run

aggregate-local: install
@echo "Aggregating from local repositories (relative paths)..."
CONFIG_FILE=scripts/repos-config.local.json ./scripts/aggregate-docs.sh

aggregate: install
@echo "Aggregating documentation from source repositories..."
./scripts/aggregate-docs.sh
Expand Down
2 changes: 1 addition & 1 deletion scripts/aggregate-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
DOCS_DIR="$PROJECT_ROOT/docs"
TEMP_DIR=$(mktemp -d)
CONFIG_FILE="$SCRIPT_DIR/repos-config.json"
CONFIG_FILE="${CONFIG_FILE:-$SCRIPT_DIR/repos-config.json}"

echo "=============================================================="
echo " Garden Linux Documentation Aggregation"
Expand Down
8 changes: 8 additions & 0 deletions scripts/fetch-repo-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

set -e

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_URL="$1"
BRANCH="${2:-main}"
DOCS_PATH="${3:-docs}"
Expand All @@ -18,6 +19,13 @@ if [ -z "$REPO_URL" ] || [ -z "$OUTPUT_DIR" ]; then
exit 1
fi

# Convert relative file:// URLs to absolute paths
if [[ "$REPO_URL" == file://../* ]]; then
RELATIVE_PATH="${REPO_URL#file://}"
ABSOLUTE_PATH="$(cd "$SCRIPT_DIR/.." && cd "$RELATIVE_PATH" && pwd)"
REPO_URL="file://$ABSOLUTE_PATH"
fi

echo "Fetching docs from: $REPO_URL"
echo " Branch: $BRANCH"
echo " Docs path: $DOCS_PATH"
Expand Down
7 changes: 4 additions & 3 deletions scripts/repos-config.local.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
"repos": [
{
"name": "gardenlinux",
"url": "file:///home/$USER/*/gardenlinux/gardenlinux",
"url": "file://../gardenlinux",
"docs_path": "docs",
"root_files": ["CONTRIBUTING.md", "SECURITY.md"],
"target_path": "projects/gardenlinux",
"branch": "docs-ng",
"structure": {
Expand All @@ -18,15 +19,15 @@
},
{
"name": "builder",
"url": "file:///home/$USER/*/gardenlinux/builder",
"url": "file://../builder",
"docs_path": "docs",
"target_path": "projects/builder",
"branch": "main",
"structure": "flat"
},
{
"name": "python-gardenlinux-lib",
"url": "file:///home/$USER/*/gardenlinux/python-gardenlinux-lib",
"url": "file://../python-gardenlinux-lib",
"docs_path": "docs",
"target_path": "projects/python-gardenlinux-lib",
"branch": "main",
Expand Down
Loading