#!/bin/bash
# Build documentation for the herolib-system package
# This script builds the Rust documentation and opens it in the browser

set -e

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"

echo "Building documentation for herolib-system..."
echo ""

# Build docs with all features enabled
cargo doc --no-deps --all-features --open

echo ""
echo "Documentation built successfully!"
echo "The documentation should open in your default browser."
echo ""
echo "If it didn't open automatically, you can find it at:"
echo "  file://$SCRIPT_DIR/../../target/doc/herolib_system/index.html"
