# Documentation Commands Module # Commands for generating, building, serving, and managing documentation # Set shell for commands set shell := ["bash", "-c"] # Generate project documentation (default) generate: @echo "๐Ÿ“š Generating documentation..." cargo doc --open # ============================================================================= # SITE INFORMATION COMMANDS # ============================================================================= # Generate comprehensive site information info-generate: @echo "๐Ÿ“š Generating Rustelo site information..." @echo "๐Ÿ“‹ Analyzing server routes, components, and pages..." SITE_INFO_PATH=${SITE_INFO_PATH:-site/info} cargo build --workspace @echo "โœ… Site information generated in ${SITE_INFO_PATH:-site/info}/" @echo "๐Ÿ“ Structure: server/, components/, pages/, automation/" # Validate generated route documentation info-validate: @echo "๐Ÿ” Validating site information..." @if [ -f "${SITE_INFO_PATH:-site/info}/server/data.toml" ]; then \ echo "โœ… Server routes documented"; \ else \ echo "โŒ Server routes missing"; \ fi @if [ -f "${SITE_INFO_PATH:-site/info}/components/data.toml" ]; then \ echo "โœ… Components documented"; \ else \ echo "โŒ Components documentation missing"; \ fi @if [ -f "${SITE_INFO_PATH:-site/info}/pages/data.toml" ]; then \ echo "โœ… Pages documented"; \ else \ echo "โŒ Pages documentation missing"; \ fi @if [ -f "${SITE_INFO_PATH:-site/info}/automation/document.md" ]; then \ echo "โœ… Automation guide available"; \ else \ echo "โŒ Automation guide missing"; \ fi # Show site information summary info-summary: @echo "๐Ÿ“Š Site Information Summary" @echo "========================" @if [ -f "${SITE_INFO_PATH:-site/info}/server/summary.md" ]; then \ echo "๐Ÿ“ก Server Routes:"; \ tail -1 "${SITE_INFO_PATH:-site/info}/server/summary.md" | grep "Total Routes" || echo " Summary available"; \ fi @if [ -f "${SITE_INFO_PATH:-site/info}/components/summary.md" ]; then \ echo "๐Ÿงฉ Components:"; \ tail -1 "${SITE_INFO_PATH:-site/info}/components/summary.md" | grep "Total Components" || echo " Summary available"; \ fi @if [ -f "${SITE_INFO_PATH:-site/info}/pages/summary.md" ]; then \ echo "๐Ÿ“„ Pages:"; \ tail -1 "${SITE_INFO_PATH:-site/info}/pages/summary.md" | grep "Total" || echo " Summary available"; \ fi @echo "๐Ÿ”ง Automation examples: ${SITE_INFO_PATH:-site/info}/automation/" # Clean generated site information info-clean: @echo "๐Ÿงน Cleaning generated site information..." @rm -rf "${SITE_INFO_PATH:-site/info}/" @echo "โœ… Site information cleaned" # Generate API clients from documentation (future) clients: @echo "๐Ÿ”Œ Generating API clients..." @echo "๐Ÿ“‹ This will generate TypeScript, Rust, and Python clients" @echo "๐Ÿšง Feature coming soon - will use ${SITE_INFO_PATH:-site/info}/server/data.toml" # Sync routes with Rustelo Manager (future) manager-sync: @echo "๐Ÿ”„ Syncing routes with Rustelo Manager..." @echo "๐Ÿ“ก This will update manager with latest route information" @echo "๐Ÿšง Feature coming soon - will use ${SITE_INFO_PATH:-site/info}/ data" # Validate generated documentation validate: @echo "๐Ÿ” Validating generated documentation..." @echo "๐Ÿ“‹ Checking links, references, and completeness" @if [ -d "${SITE_INFO_PATH:-site/info}" ]; then \ echo "โœ… Documentation directory exists"; \ find "${SITE_INFO_PATH:-site/info}" -name "*.md" -exec wc -l {} + | tail -1; \ else \ echo "โŒ Documentation not found - run 'just docs::info-generate' first"; \ fi # Clean and regenerate all documentation refresh: @echo "๐Ÿ”„ Refreshing all documentation..." @just info-clean @just ../dev::site-info @echo "โœ… Documentation refreshed" # ============================================================================= # CARGO DOCUMENTATION COMMANDS # ============================================================================= # Build cargo documentation with logo assets (Nushell version) cargo-nu: @echo "๐Ÿ“š Building cargo documentation with logo assets (Nushell)..." nu {{justfile_directory()}}/scripts/build/build-docs.nu # Build cargo documentation with logo assets (Bash fallback) cargo: @echo "๐Ÿ“š Building cargo documentation with logo assets (Bash)..." {{justfile_directory()}}/scripts/build/build-docs.sh # Serve documentation serve: @echo "๐Ÿ“š Serving documentation..." cargo doc --no-deps python3 -m http.server 8000 -d target/doc # ============================================================================= # MDBOOK DOCUMENTATION COMMANDS # ============================================================================= # Setup comprehensive documentation system setup: @echo "๐Ÿ“š Setting up documentation system..." {{justfile_directory()}}/scripts/setup-docs.sh --full # Start documentation development server dev: @echo "๐Ÿ“š Starting documentation development server..." {{justfile_directory()}}/scripts/docs-dev.sh # Build documentation with mdBook build: @echo "๐Ÿ“š Building documentation..." {{justfile_directory()}}/scripts/build/build-docs.sh # Build documentation and sync existing content build-sync: @echo "๐Ÿ“š Building documentation with content sync..." {{justfile_directory()}}/scripts/build/build-docs.sh --sync # Watch documentation for changes watch: @echo "๐Ÿ“š Watching documentation for changes..." {{justfile_directory()}}/scripts/build/build-docs.sh --watch # Serve mdBook documentation with auto-open book: @echo "๐Ÿ“š Serving mdBook documentation..." mdbook serve --open # Build mdBook for changes book-build: @echo "๐Ÿ“š Building mdBook for changes..." mdbook build # Watch mdBook for changes book-watch: @echo "๐Ÿ“š Watching mdBook for changes..." mdbook watch # Serve mdBook on specific port book-port PORT: @echo "๐Ÿ“š Serving mdBook on port {{PORT}}..." mdbook serve --port {{PORT}} --open # Check documentation for broken links check-links: @echo "๐Ÿ“š Checking documentation for broken links..." mdbook-linkcheck || echo "Note: Install mdbook-linkcheck for link checking" # ============================================================================= # DOCUMENTATION DEPLOYMENT COMMANDS # ============================================================================= # Deploy documentation to GitHub Pages deploy-github: @echo "๐Ÿ“š Deploying documentation to GitHub Pages..." {{justfile_directory()}}/scripts/deploy-docs.sh github-pages # Deploy documentation to Netlify deploy-netlify: @echo "๐Ÿ“š Deploying documentation to Netlify..." {{justfile_directory()}}/scripts/deploy-docs.sh netlify # Deploy documentation to Vercel deploy-vercel: @echo "๐Ÿ“š Deploying documentation to Vercel..." {{justfile_directory()}}/scripts/deploy-docs.sh vercel # Build documentation Docker image docker: @echo "๐Ÿ“š Building documentation Docker image..." {{justfile_directory()}}/scripts/deploy-docs.sh docker # Serve documentation locally with nginx serve-local: @echo "๐Ÿ“š Serving documentation locally..." {{justfile_directory()}}/scripts/deploy-docs.sh local # ============================================================================= # DOCUMENTATION UTILITIES # ============================================================================= # Generate dynamic documentation content (legacy) generate-legacy: @echo "๐Ÿ“š Generating dynamic documentation content..." {{justfile_directory()}}/scripts/generate-content.sh # Clean documentation build files (legacy) clean-legacy: @echo "๐Ÿ“š Cleaning documentation build files..." rm -rf book-output rm -rf _book @echo "Documentation build files cleaned" # Complete documentation workflow (build, check, serve) workflow: @echo "๐Ÿ“š Running complete documentation workflow..." just build-sync just check-links just serve-local