Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
50932d6
Additional doc comments on critical sections
alan-george-lk May 27, 2026
7c472d9
Build helpers, better stage
alan-george-lk May 27, 2026
9db39d4
Separate validate stage
alan-george-lk May 27, 2026
8a5e19e
Try proper version
alan-george-lk May 28, 2026
bf6c66c
Potential fix for pull request finding 'CodeQL / Workflow does not co…
alan-george-lk May 28, 2026
348faca
Potential fix for pull request finding 'CodeQL / Workflow does not co…
alan-george-lk May 28, 2026
53ac382
Additional cleanup
alan-george-lk May 28, 2026
0c52560
Merge branch 'feature/more_docs' of github.com:livekit/client-sdk-cpp…
alan-george-lk May 28, 2026
8f57e21
Fix output
alan-george-lk May 28, 2026
a06848b
Fix render
alan-george-lk May 28, 2026
a4c41e0
Catch certain documentation issues
alan-george-lk May 28, 2026
94170f6
Remove the g
alan-george-lk May 28, 2026
a568952
Drop 'g' from version
alan-george-lk May 28, 2026
4fdd11f
Document remaining classes via auto javadoc
alan-george-lk May 28, 2026
79b6965
Workflow label
alan-george-lk May 28, 2026
0d448f7
Merge branch 'main' into feature/more_docs
alan-george-lk May 28, 2026
9c31165
Move to doxygen folder
alan-george-lk May 28, 2026
810915b
Merge branch 'feature/more_docs' of github.com:livekit/client-sdk-cpp…
alan-george-lk May 28, 2026
8c7df73
Use @brief on our changes
alan-george-lk May 28, 2026
c5d60f1
Always upload docs
alan-george-lk May 28, 2026
1801289
Get back html folder to avoid breaking publish stage
alan-george-lk May 28, 2026
3f98e2e
Cleanup AI
alan-george-lk May 28, 2026
31b7aaf
Docs version
alan-george-lk May 28, 2026
caa8ffd
Cleanup AI comments
alan-george-lk May 28, 2026
327733e
Additional cleanup
alan-george-lk May 28, 2026
d32e95c
PR feedback
alan-george-lk May 28, 2026
ce0c351
Additional cleanup
alan-george-lk May 28, 2026
5dcb25d
Embed README into doc reference
alan-george-lk May 28, 2026
44e74b9
Agents MD update, cleanup rendered docs, misc changes
alan-george-lk May 28, 2026
6d7a3e3
Hopefully fix generate docs
alan-george-lk May 28, 2026
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
177 changes: 177 additions & 0 deletions .github/workflows/generate-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
name: Generate docs
permissions:
contents: read

# Generates Doxygen docs and uploads them as a workflow artifact.

# This workflow is used to validate documentation before merge, for example catching
# things like broken @ref tags, missing @param tags, etc.

# The artifact is attached to the workflow run so reviewers can download a preview,
# but also to verify the documentation artifact is valid for subsequent release runs
# that will publish them to the LiveKit docs web page: https://docs.livekit.io/reference/client-sdk-cpp/
on:
pull_request:
branches: ["main"]
paths:
- include/**
- src/**
- docs/**
- scripts/generate-docs.sh
- .github/workflows/generate-docs.yml
- .github/workflows/publish-docs.yml
workflow_call:
inputs:
version:
description: 'Documentation version (e.g. v0.1.0)'
required: false
type: string
upload_artifact:
description: 'Upload the generated docs folder as a workflow artifact'
required: false
type: boolean
default: true
artifact_name:
description: 'Name to use for the uploaded docs artifact'
required: false
type: string
default: livekit-cpp-docs
artifact_retention_days:
description: 'Retention (days) for the uploaded docs artifact'
required: false
type: number
default: 7
outputs:
project_number:
description: 'Doxygen PROJECT_NUMBER used for the build (e.g., v1.2.3)'
value: ${{ jobs.validate.outputs.project_number }}
artifact_name:
description: 'Name of the uploaded docs artifact (empty if upload was skipped via upload_artifact: false)'
value: ${{ jobs.validate.outputs.artifact_name }}

jobs:
validate:
name: Generate and verify docs
runs-on: ubuntu-latest
outputs:
project_number: ${{ steps.build_docs.outputs.project_number }}
artifact_name: ${{ steps.artifact_meta.outputs.name }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
# fetch-depth: 0 is required so `git describe --tags` in
# scripts/generate-docs.sh resolves the right version from the git history.
fetch-depth: 0

# Doxygen is available on ubuntu-latest, but we install explicitly for stability
- name: Install Doxygen
run: |
sudo apt-get update
sudo apt-get install -y doxygen graphviz

- name: Generate docs (Doxygen)
id: build_docs
shell: bash
env:
INPUT_VERSION: ${{ inputs.version || '' }}
run: |
set -euo pipefail

args=()
if [[ -n "$INPUT_VERSION" ]]; then
args+=(--version "$INPUT_VERSION")
elif [[ "${{ github.ref_type }}" == "tag" ]]; then
args+=(--version "${{ github.ref_name }}")
fi

./scripts/generate-docs.sh "${args[@]}"

- name: Print docs version
shell: bash
run: |
set -euo pipefail

PROJECT_NUMBER="${{ steps.build_docs.outputs.project_number }}"

if [[ -z "$PROJECT_NUMBER" ]]; then
echo "ERROR: build_docs step did not emit a project_number output."
exit 1
fi

echo "Docs version: ${PROJECT_NUMBER}"

{
echo "Docs version: \`${PROJECT_NUMBER}\`"
echo ""
echo "> Note: On a non-tag/release run, the version will resolve to:"
echo " \`<closest tag>-<commits since tag>-<commit sha>\`"
} >>"$GITHUB_STEP_SUMMARY"

- name: Verify docs were generated
shell: bash
run: |
set -euo pipefail
if [[ ! -f docs/doxygen/html/index.html ]]; then
echo "ERROR: Expected docs at docs/doxygen/html/index.html but file not found."
exit 1
fi

# `inputs.*` is only populated on `workflow_call`. On a direct
# `pull_request` trigger every `inputs.*` lookup is the empty string, so
# we OR-fold to the documented defaults to keep PR runs behaving the same
# as the workflow_call default of `upload_artifact: true`.
- name: Resolve artifact metadata
id: artifact_meta
if: inputs.upload_artifact || github.event_name == 'pull_request'
shell: bash
env:
INPUT_NAME: ${{ inputs.artifact_name || 'livekit-cpp-docs' }}
INPUT_RETENTION: ${{ inputs.artifact_retention_days || '7' }}
run: |
set -euo pipefail
if [[ -z "$INPUT_NAME" ]]; then
echo "ERROR: artifact name resolved to empty."
exit 1
fi
echo "name=${INPUT_NAME}" >>"$GITHUB_OUTPUT"
echo "retention=${INPUT_RETENTION}" >>"$GITHUB_OUTPUT"

- name: Upload docs artifact
if: steps.artifact_meta.outputs.name != ''
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ${{ steps.artifact_meta.outputs.name }}
path: docs/doxygen/html/
retention-days: ${{ steps.artifact_meta.outputs.retention }}
if-no-files-found: error

# Simple check to make sure the documentation artifact is valid.
- name: Re-download artifact (publish workflow pre-validation)
if: steps.artifact_meta.outputs.name != ''
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: ${{ steps.artifact_meta.outputs.name }}
path: html

- name: Inspect downloaded artifact
if: steps.artifact_meta.outputs.name != ''
shell: bash
run: |
set -euo pipefail

NAME="${{ steps.artifact_meta.outputs.name }}"
ROOT="html"

echo "Artifact '${NAME}' extracted into '${ROOT}/'. Top-level contents:"
# `sed -n '1,Np'` reads the whole pipe before truncating its output,
# so the producer (ls) never hits SIGPIPE under `pipefail`.
ls -la "$ROOT" | sed -n '1,40p'

TOTAL=$(find "$ROOT" -type f | wc -l | tr -d ' ')
echo "Total files: ${TOTAL}"

if [[ ! -f "${ROOT}/index.html" ]]; then
echo "ERROR: ${ROOT}/index.html is missing -- artifact layout regressed."
echo " publish-docs.yml expects html/index.html."
exit 1
fi
4 changes: 4 additions & 0 deletions .github/workflows/make-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,8 @@ jobs:
permissions:
contents: write
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
outputs:
version: ${{ steps.version.outputs.version }}

steps:
- name: Checkout
Expand Down Expand Up @@ -434,4 +436,6 @@ jobs:
name: Publish Documentation
needs: release
uses: ./.github/workflows/publish-docs.yml
with:
version: ${{ needs.release.outputs.version }}
secrets: inherit
54 changes: 38 additions & 16 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,43 @@ name: Publish docs

on:
workflow_dispatch:
inputs:
version:
description: 'Documentation version (e.g. v0.1.0)'
required: false
type: string
workflow_call:
inputs:
version:
description: 'Documentation version (e.g. v0.1.0)'
required: false
type: string

permissions:
contents: read
actions: read

jobs:
docs:
validate:
name: Validate (build docs)
uses: ./.github/workflows/generate-docs.yml
with:
version: ${{ inputs.version || github.event.inputs.version || '' }}
upload_artifact: true
# Suffix with run_id so concurrent publish runs cannot collide on the
# artifact namespace within the same repository.
artifact_name: livekit-cpp-docs-${{ github.run_id }}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

run_id==commit hash? if not we should consider using commit hash

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, this is the integer incrementing count (see actions tab). Just needs to be unique such that if for some reason two releases are pushing docs (say we back-patched an old tag in addition to a new one simultaneously), they wouldn't conflict.

This is just the temporary artifact name between the generate and publish stages in the actions space, not in S3 or anywhere permanent. Open to SHA if you prefer

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

up to you, sha might be easier to track if we need to. not sure if thats a real use case or not


publish:
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
name: Publish (S3 + CloudFront)
needs: validate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
# Note: submodules and LFS not needed for docs generation
# Doxygen only reads from include/, docs/, README.md, and examples/

# Doxygen is available on ubuntu-latest, but we install explicitly for stability
- name: Install Doxygen
run: |
sudo apt-get update
sudo apt-get install -y doxygen graphviz

- name: Build Docs (Doxygen)
run: |
doxygen docs/Doxyfile
- name: Download docs artifact
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: ${{ needs.validate.outputs.artifact_name }}
path: html

- name: S3 Upload
run: |
Expand All @@ -30,8 +48,12 @@ jobs:
exit 1
fi

# Upload to rolling latest (no versioned docs, always overwrite)
aws s3 cp "$DOCS_DIR"/ s3://livekit-docs/client-sdk-cpp --recursive
VERSIONED_PREFIX="s3://livekit-docs/client-sdk-cpp/${{ needs.validate.outputs.project_number }}"
LATEST_PREFIX="s3://livekit-docs/client-sdk-cpp"

# Upload immutable versioned docs, then refresh rolling latest.
aws s3 cp "$DOCS_DIR"/ "$VERSIONED_PREFIX" --recursive
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i always hated wrestling aws creds, glad we have it for this!

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it == Info Tech team lol

aws s3 cp "$DOCS_DIR"/ "$LATEST_PREFIX" --recursive
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ vcpkg_installed/
include/livekit/build.h
received_green.avif
docs/*.bak
docs/html/
docs/latex/
# Doxygen
docs/doxygen/html/
docs/doxygen/latex/
.vs/
.vscode/
.cursor/
Expand Down
25 changes: 15 additions & 10 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ Be sure to update the directory layout in this file if the directory layout chan
| `cmake/` | Build helpers (`protobuf.cmake`, `spdlog.cmake`, `LiveKitConfig.cmake.in`) |
| `docker/` | Dockerfile for CI and SDK distribution images |
| `scripts/` | Developer / CI helper scripts (e.g. `clang-tidy.sh`) |
| `docs/` | Documentation root. `docs/` holds hand-written long-form Markdown intended to also read well on GitHub. |
| `docs/doxygen/` | Doxygen tool config, theme assets, and Doxygen-only content (`Doxyfile`, `index.md` mainpage, `customization/*.css`, `customization/header.html`, `customization/favicon.ico`). Files here use Doxygen-only syntax (`@ref`, `@brief`, …) and are not intended for human reading on their own. |
| `.github/workflows/` | GitHub Actions CI workflows |

### Key Types
Expand Down Expand Up @@ -238,7 +240,7 @@ with the same library loaded elsewhere in the host process.
### Public API Documentation (Doxygen)

The public API (`include/livekit/*.h`) is what consumers read first and is also
published as a Doxygen site (`docs/Doxyfile`, `.github/workflows/publish-docs.yml`).
published as a Doxygen site (`docs/doxygen/Doxyfile`, `.github/workflows/publish-docs.yml`).
Every doc comment in `include/livekit/` must use the rules below, and PRs that
add or modify public symbols are gated on these rules during review.

Expand All @@ -259,12 +261,13 @@ add or modify public symbols are gated on these rules during review.

#### Required tags

- Document class/structs succinctly using `@brief Description.`
- Document functions/methods/namespaces succinctly using `@brief Description.`
- Document parameters using `@param name Description.`
- Document non-void return values using `@return Description.`
- Document thrown exceptions using `@throws ExceptionType When/why it's
thrown.` Operations that can fail without throwing should return
`Result<T, E>` (see Error Handling above) and the variants should be
documented in the doc block.
- Document thrown exceptions using `@throws ExceptionType When/why it's thrown.`
Operations that can fail without throwing should return `Result<T, E>`
(see Error Handling above) and the variants should be documented in the doc block.
- Free-text "Parameters:", "Returns:", "Throws:" sections in legacy comments
must be converted to the corresponding `@param` / `@return` / `@throws`
tags when the comment is touched.
Expand All @@ -290,15 +293,17 @@ render a deprecation callout (see "Deprecating a public API" above).

#### Verifying locally

Run Doxygen from the repository root to regenerate the HTML docs:
Run the docs build script from the repository root:

```bash
doxygen docs/Doxyfile
./scripts/generate-docs.sh
```

The output lands in `docs/html/`. Doxygen warnings about "is not documented"
indicate undocumented public symbols — adding documentation to them is
encouraged but not strictly required by these rules.
The output lands in `docs/doxygen/html/index.html`. The Doxyfile sets
`WARN_IF_UNDOCUMENTED = NO` (the 400+ "X is not documented" warnings for
internal symbols are too noisy to enforce) and `WARN_AS_ERROR = FAIL_ON_WARNINGS`,
so any other warning (broken `@ref`, unknown `@command`, unsupported HTML tag,
malformed table, missing `@param` on a documented function, …) fails the build.

### Integer Types

Expand Down
Loading
Loading