Skip to content

Commit b4b3f20

Browse files
authored
Merge pull request #2 from livekit/docs-gen-with-docc
Documentation generation with DocC and hosting
2 parents fe71945 + b199c85 commit b4b3f20

File tree

6 files changed

+52
-3
lines changed

6 files changed

+52
-3
lines changed

.github/workflows/publish-docs.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Generate docs and deploy to GitHub Pages
2+
on:
3+
# Runs on pushes targeting the default branch
4+
push:
5+
branches: ["main"]
6+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
7+
permissions:
8+
contents: read
9+
pages: write
10+
id-token: write
11+
# Allow one concurrent deployment
12+
concurrency:
13+
group: "pages"
14+
cancel-in-progress: true
15+
16+
jobs:
17+
# Single deploy job since we're just deploying
18+
deploy:
19+
environment:
20+
# Must be set to this for deploying to GitHub Pages
21+
name: github-pages
22+
url: ${{ steps.deployment.outputs.page_url }}
23+
runs-on: macos-12
24+
steps:
25+
- name: Checkout 🛎️
26+
uses: actions/checkout@v3
27+
- name: Build DocC
28+
run: |
29+
xcodebuild docbuild -scheme LiveKitComponents \
30+
-derivedDataPath /tmp/docbuild \
31+
-destination 'generic/platform=iOS';
32+
$(xcrun --find docc) process-archive \
33+
transform-for-static-hosting /tmp/docbuild/Build/Products/Debug-iphoneos/LiveKitComponents.doccarchive \
34+
--hosting-base-path /components-swift \
35+
--output-path docs;
36+
- name: Upload artifact
37+
uses: actions/upload-pages-artifact@v1
38+
with:
39+
# Upload only docs directory
40+
path: "docs"
41+
- name: Deploy to GitHub Pages
42+
id: deployment
43+
uses: actions/deploy-pages@v1

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,7 @@ Documentation
1010
# DocC
1111
/build_docs/
1212
*.doccarchive
13+
!/docs/**
1314
# Local WebRTC
1415
WebRTC.xcframework
16+
.temp

Package.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ let package = Package(
1919
dependencies: [
2020
// Dependencies declare other packages that this package depends on.
2121
// .package(url: /* package url */, from: "1.0.0"),
22-
.package(name: "LiveKit", url: "https://github.com/livekit/client-sdk-swift.git", .exact("1.0.13"))
22+
.package(name: "LiveKit", url: "https://github.com/livekit/client-sdk-swift.git", .exact("1.0.13")),
23+
.package(url: "https://github.com/apple/swift-docc-plugin.git", from: "1.3.0"),
2324
],
2425
targets: [
2526
// Targets are the basic building blocks of a package. A target can define a module or a test suite.

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@
1010

1111
<!--BEGIN_DESCRIPTION-->Use this SDK to add real-time video, audio and data features to your Swift app. By connecting to a self- or cloud-hosted <a href="https://livekit.io/">LiveKit</a> server, you can quickly build applications like interactive live streaming or video calls with just a few lines of code.<!--END_DESCRIPTION-->
1212

13+
## [Docs](https://livekit.github.io/components-swift/documentation/livekitcomponents/)
14+
1315
<!--BEGIN_REPO_NAV-->
16+
1417
<br/><table>
18+
1519
<thead><tr><th colspan="2">LiveKit Ecosystem</th></tr></thead>
1620
<tbody>
1721
<tr><td>Client SDKs</td><td><a href="https://github.com/livekit/components-js">Components</a> · <a href="https://github.com/livekit/client-sdk-js">JavaScript</a> · <a href="https://github.com/livekit/client-sdk-swift">iOS/macOS</a> · <a href="https://github.com/livekit/client-sdk-android">Android</a> · <a href="https://github.com/livekit/client-sdk-flutter">Flutter</a> · <a href="https://github.com/livekit/client-sdk-react-native">React Native</a> · <a href="https://github.com/livekit/client-sdk-rust">Rust</a> · <a href="https://github.com/livekit/client-sdk-python">Python</a> · <a href="https://github.com/livekit/client-sdk-unity-web">Unity (web)</a> · <a href="https://github.com/livekit/client-sdk-unity">Unity (beta)</a></td></tr><tr></tr>
@@ -21,4 +25,3 @@
2125
</tbody>
2226
</table>
2327
<!--END_REPO_NAV-->
24-

Sources/LiveKitComponents/Buttons/CameraToggleButton.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import SwiftUI
1818
import LiveKit
1919

20+
/// The Camera Toggle Button is a button that toggles the camera on and off.
2021
public struct CameraToggleButton<Label: View, PublishedLabel: View>: View {
2122

2223
@EnvironmentObject var room: Room

Tests/LiveKitComponentsTests/LiveKitComponentsTests.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@ final class LiveKitComponentsTests: XCTestCase {
66
// This is an example of a functional test case.
77
// Use XCTAssert and related functions to verify your tests produce the correct
88
// results.
9-
XCTAssertEqual(LiveKitComponents().text, "Hello, World!")
109
}
1110
}

0 commit comments

Comments
 (0)