forked from langfuse/langfuse-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_reference_docs.sh
More file actions
executable file
路36 lines (30 loc) 路 1.25 KB
/
Copy pathbuild_reference_docs.sh
File metadata and controls
executable file
路36 lines (30 loc) 路 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env bash
# Builds the API reference published at https://python.reference.langfuse.com.
#
# Use this instead of calling pdoc directly: it applies the template overrides
# in pdoc-templates/ and ships the 404 page, both of which the hosted site
# needs. Set PDOC_CANONICAL_BASE_URL to build for a different origin.
set -euo pipefail
OUT_DIR="${1:-docs}"
# Resolve a relative output path against the caller's working directory before
# cd'ing to the repo root, so `build_reference_docs.sh out` from elsewhere does
# not silently write to <repo>/out.
case "$OUT_DIR" in
/*) ;;
*) OUT_DIR="$PWD/$OUT_DIR" ;;
esac
cd "$(dirname "$0")/.."
uv run --group docs pdoc \
-o "$OUT_DIR" \
--docformat google \
--logo "https://langfuse.com/langfuse_logo.svg" \
--logo-link "https://langfuse.com" \
--template-directory pdoc-templates \
--edit-url "langfuse=https://github.com/langfuse/langfuse-python/blob/main/langfuse/" \
--no-show-source \
langfuse
# Cloudflare Pages serves the closest index.html with a 200 for any unmatched
# path unless the output contains a 404.html, which turns every stale or
# mistyped URL into an indexable duplicate of the landing page.
cp pdoc-templates/404.html "$OUT_DIR/404.html"
echo "Reference docs written to $OUT_DIR/"