Something went wrong. Try again.
Dynamic Consistency Boundaries (DCB) Event Sourcing in Gleam !!! factos.hexdocs.pm
eventsourcing dcb dynamic-consistency-boundaries gleam
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364#!/usr/bin/env shset -eu
root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)site="$root/build/site"
rm -rf "$site"mkdir -p "$site"
build_package() { package_path=$1 package_name=$2 destination=$3
echo ":: building ${package_name} documentation" (cd "$root/$package_path" && gleam docs build)
mkdir -p "$site/$destination" cp -R \ "$root/$package_path/build/dev/docs/$package_name/." \ "$site/$destination/"
# README links target repository Markdown. Point documentation-page links at # the generated HTML files while preserving README navigation in the source. index="$site/$destination/index.html" rewritten_index="${index}.tmp" sed -E 's|href="docs/([^"]+)\.md"|href="\1.html"|g' \ "$index" > "$rewritten_index" mv "$rewritten_index" "$index"}
build_package . factos factosbuild_package backends/factos_pog factos_pog factos_pogbuild_package backends/factos_sqlight factos_sqlight factos_sqlightbuild_package backends/factos_cf factos_cf factos_cf
cat > "$site/index.html" <<'HTML'<!doctype html><html lang="en"><head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Factos documentation</title> <style> body { font: 18px/1.5 system-ui, sans-serif; max-width: 44rem; margin: 4rem auto; padding: 0 1rem; } a { color: #5b3cc4; } li { margin: .5rem 0; } </style></head><body> <h1>Factos documentation</h1> <p>Context-first event sourcing for Gleam.</p> <ul> <li><a href="factos/">factos</a> — core model and simulator</li> <li><a href="factos_pog/">factos_pog</a> — PostgreSQL</li> <li><a href="factos_sqlight/">factos_sqlight</a> — SQLite</li> <li><a href="factos_cf/">factos_cf</a> — Cloudflare D1</li> </ul></body></html>HTML
printf 'Documentation site built at %s\n' "$site"