这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
41 changes: 41 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Docs
on:
push:
branches: [main]
workflow_dispatch:
concurrency:
group: "docs"
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Setup DocFx
run: dotnet tool update -g docfx && dotnet tool restore
- name: Build Docs
run: ./BuildScripts~/build_docs.sh
- name: Configure Pages
uses: actions/configure-pages@v5
- name: Upload Generated Docs
uses: actions/upload-pages-artifact@v3
with:
path: Documentation~/_site
deploy:
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
21 changes: 21 additions & 0 deletions BuildScripts~/build_docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
DOCS_DIR=../Documentation~/
GITHUB_DIR=../.github/
README_PATH=../README.md

# Copy README and required images
mkdir -p $DOCS_DIR/resources && cp $GITHUB_DIR/*.png $DOCS_DIR/resources/
cp $README_PATH $DOCS_DIR/index.md

# Build docs
docfx $DOCS_DIR/docfx.json

# Patch image paths
find $DOCS_DIR/_site -name '*.html' -type f -exec sed -i.bak 's|=\"/.github/|=\"resources/|g' {} \;
find $DOCS_DIR/_site -name '*.bak' -type f -delete

# Cleanup
rm -rf $DOCS_DIR/api/*.yml
rm -rf $DOCS_DIR/api/.manifest
rm -rf $DOCS_DIR/resources
rm -rf $DOCS_DIR/index.md
6 changes: 6 additions & 0 deletions Documentation~/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
resources
index.md
api/*.yml
api/.manifest
/**/_site/
.cache
Empty file added Documentation~/api/.gitkeep
Empty file.
3 changes: 3 additions & 0 deletions Documentation~/custom/public/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#logo {
display: none;
}
42 changes: 42 additions & 0 deletions Documentation~/docfx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"metadata": [
{
"src": [
{
"files": ["Runtime/Scripts/**/*.cs"],
"src": "../"
}
],
"dest": "api",
"disableDefaultFilter": false,
"allowCompilationErrors": true
}
],
"build": {
"content": [
{
"files": "**/*.{md,yml}",
"src": "api",
"dest": "api"
},
{
"files": ["toc.yml", "*.md"]
}
],
"resource": [{ "files": ["resources/**"] }],
"output": "_site",
"template": ["default", "modern", "custom"],
"globalMetadata": {
"_appName": "LiveKit Unity SDK",
"_appTitle": "LiveKit Unity SDK",
"_appFooter": "LiveKit Client SDK for Unity",
"_lang": "en",
"_enableSearch": true,
"pdf": false
},
"xrefService": ["https://xref.docs.microsoft.com/query?uid={uid}"],
"sitemap": {
"baseUrl": "https://docs.livekit.io/reference/client-sdk-unity/"
}
}
}
4 changes: 4 additions & 0 deletions Documentation~/toc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- name: About
href: /
- name: API Reference
href: api/