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
62 changes: 62 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Deploy Documentation to Pages

on:
push:
branches: [main]
paths:
- 'docs/**'

workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5

- name: Setup Node
uses: actions/setup-node@v5
with:
node-version: 22
cache: npm
cache-dependency-path: docs/package-lock.json

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Install dependencies
run: |
cd docs
npm ci

- name: Build with VitePress
run: |
cd docs
npm run build

- name: Upload artifact
uses: actions/upload-pages-artifact@v4
with:
path: docs/.vitepress/dist

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,13 @@ jobs:
RELEASE_VERSION=$(grep "project.rel.dev.onvoid.webrtc\\\:webrtc-java=" release.properties | cut -d'=' -f2)
echo "Extracted release version from release.properties: $RELEASE_VERSION"

# Update versions.js file
echo "Updating versions.js with release version: $RELEASE_VERSION and development version: ${{ github.event.inputs.developmentVersion }}"
sed -i "s/VERSION: '.*'/VERSION: '$RELEASE_VERSION'/g" docs/assets/versions.js
sed -i "s/VERSION_SNAPSHOT: '.*'/VERSION_SNAPSHOT: '${{ github.event.inputs.developmentVersion }}'/g" docs/assets/versions.js
# Update versions.ts file
echo "Updating versions.ts with release version: $RELEASE_VERSION and development version: ${{ github.event.inputs.developmentVersion }}"
sed -i "s/VERSION: '.*'/VERSION: '$RELEASE_VERSION'/g" docs/.vitepress/versions.ts
sed -i "s/VERSION_SNAPSHOT: '.*'/VERSION_SNAPSHOT: '${{ github.event.inputs.developmentVersion }}'/g" docs/.vitepress/versions.ts

# Add the updated file to the existing commit
git add docs/assets/versions.js
git add docs/.vitepress/versions.ts
git commit --amend --no-edit

git push
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[![Maven Central](https://img.shields.io/maven-central/v/dev.onvoid.webrtc/webrtc-java?label=Maven%20Central&logo=apache-maven)](https://search.maven.org/artifact/dev.onvoid.webrtc/webrtc-java)

<p align="center">
<img alt="webrtc-java" width="100px" src="https://jrtc.dev/assets/images/logo.png" />
<img alt="webrtc-java" width="100px" src="https://jrtc.dev/logo.png" />
<h2 align="center">Connecting the Java world through WebRTC</h2>
</p>

Expand All @@ -25,10 +25,10 @@ The library provides a comprehensive set of Java classes that map to the WebRTC

For more detailed information, check out the documentation:

- [Quickstart](https://jrtc.dev/#/quickstart) - Get up and running quickly with webrtc-java
- [Guides](https://jrtc.dev/#/guide/overview) - Comprehensive documentation on using the library
- [Examples](https://jrtc.dev/#/examples) - Sample code demonstrating various features
- [Build Notes](https://jrtc.dev/#/build) - Instructions for building the library from source
- [Quickstart](https://jrtc.dev/guide/get-started) - Get up and running quickly with webrtc-java
- [Guides](https://jrtc.dev/guide/) - Comprehensive documentation on using the library
- [Examples](https://jrtc.dev/guide/examples) - Sample code demonstrating various features
- [Build Notes](https://jrtc.dev/guide/build) - Instructions for building the library from source

## License

Expand Down
4 changes: 4 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.vitepress/cache
.vitepress/dist

node_modules
Empty file removed docs/.nojekyll
Empty file.
49 changes: 49 additions & 0 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { defineConfig } from 'vitepress'
import { footer } from "./footer";
import { head } from "./head";
import { navbar } from "./nav";
import { sidebar } from "./sidebar";
import { PROJECT_VARS } from './versions'

export default defineConfig({
title: "webrtc-java",
description: "Java native interface for WebRTC",
cleanUrls: true,

head: head,

themeConfig: {
logo: {
light: '/logo.png',
dark: '/logo.png',
alt: 'logo'
},

externalLinkIcon: true,

nav: navbar,
sidebar: sidebar,
footer: footer,
socialLinks: [
{ icon: 'github', link: 'https://github.com/devopvoid/webrtc-java' },
],
search: {
provider: 'local',
},
},

markdown: {
config: (md) => {
md.use(variableInterpolationPlugin)
},
},
})

function variableInterpolationPlugin(md) {
md.core.ruler.after('normalize', 'variable-interpolation', (state) => {
Object.entries(PROJECT_VARS).forEach(([key, value]) => {
const regex = new RegExp(`{{\\s*${key}\\s*}}`, 'g')
state.src = state.src.replace(regex, value)
})
})
}
6 changes: 6 additions & 0 deletions docs/.vitepress/footer.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { DefaultTheme } from "vitepress";

export const footer: DefaultTheme.Footer = {
message: 'Released under the <a href="https://www.apache.org/licenses/LICENSE-2.0" target="_blank">Apache-2.0 License</a>.',
copyright: 'Copyright © 2019-present <a href="https://github.com/devopvoid" target="_blank">Alex Andres</a>',
}
27 changes: 27 additions & 0 deletions docs/.vitepress/head.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { HeadConfig } from "vitepress/types/shared";

const isProd = process.env.NODE_ENV === 'production';

const head: HeadConfig[] = [
['link', { rel: "icon", type: "image/png", sizes: "96x96", href: "/favicon-96x96.png" }],
['link', { rel: "icon", type: "image/svg+xml", href: "/favicon.svg" }],
['link', { rel: "shortcut icon", href: "/favicon.ico" }],
['link', { rel: "apple-touch-icon", sizes: "180x180", href: "/apple-touch-icon.png" }],
['link', { rel: "manifest", href: "/site.webmanifest" }],
['meta', { name: "apple-mobile-web-app-title", content: "JRTC" }],
]

if (isProd) {
head.push([
'script',
{
async: '',
src: 'https://eu.umami.is/script.js',
'data-website-id': '126654a9-5f07-4b57-ad7e-023eda3980ff',
'data-domains': 'jrtc.dev',
'data-do-not-track': 'true'
},
])
}

export { head }
30 changes: 30 additions & 0 deletions docs/.vitepress/nav.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { DefaultTheme } from "vitepress";
import { PROJECT_VARS } from './versions'

export const navbar: DefaultTheme.NavItem[] = [
{
text: 'Guide',
link: '/guide/',
},
{
text: 'Examples',
link: '/guide/examples',
},
{
text: 'Tools',
link: '/tools',
},
{
text: PROJECT_VARS.VERSION,
items: [
{
text: 'Changelog',
link: 'https://github.com/devopvoid/webrtc-java/blob/main/CHANGELOG.md'
},
{
text: 'Build Notes',
link: '/guide/build'
}
]
}
]
102 changes: 102 additions & 0 deletions docs/.vitepress/sidebar.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
import { DefaultTheme } from "vitepress";

export const sidebar: DefaultTheme.Sidebar = {
'/guide/': { base: '/guide/', items: sidebarGuide() },
'/tools/': { base: '/tools/', items: sidebarTools() },
}

function sidebarGuide(): DefaultTheme.SidebarItem[] {
return [
{
text: 'Introduction',
collapsed: false,
items: [
{ text: 'What is webrtc-java?', link: '/introduction' },
{ text: 'Getting Started', link: '/get-started' },
],
},
{
text: 'Media Basics',
collapsed: false,
items: [
{ text: 'Media Devices', link: '/media/media-devices' },
{ text: 'Media Constraints', link: '/media/constraints' },
{ text: 'Media Directionality', link: '/media/directionality' },
],
},
{
text: 'Audio',
collapsed: false,
items: [
{ text: 'Audio Devices', link: '/audio/audio-devices' },
{ text: 'Audio Processing', link: '/audio/audio-processing' },
{ text: 'Custom Audio Source', link: '/audio/custom-audio-source' },
{ text: 'Headless Audio', link: '/audio/headless-audio' },
{ text: 'DTMF Sender', link: '/audio/dtmf-sender' },
],
},
{
text: 'Video',
collapsed: false,
items: [
{ text: 'Camera Video', link: '/video/camera-capture' },
{ text: 'Desktop Video', link: '/video/desktop-capture' },
{ text: 'Custom Video Source', link: '/video/custom-video-source' },
],
},
{
text: 'Data Communication',
collapsed: false,
items: [
{ text: 'Data Channels', link: '/data/data-channels' },
],
},
{
text: 'Networking and ICE',
collapsed: false,
items: [
{ text: 'Port Allocator Configuration', link: '/networking/port-allocator-config' },
],
},
{
text: 'Monitoring and Debugging',
collapsed: false,
items: [
{ text: 'RTC Stats', link: '/monitoring/rtc-stats' },
{ text: 'Logging', link: '/monitoring/logging' },
],
},
]
}

function sidebarTools(): DefaultTheme.SidebarItem[] {
return [
{
text: 'Audio',
collapsed: false,
items: [
{ text: 'Audio Converter', link: '/audio/audio-converter' },
{ text: 'Audio Recorder', link: '/audio/audio-recorder' },
{ text: 'Audio Player', link: '/audio/audio-player' },
{ text: 'Voice Activity Detector', link: '/audio/voice-activity-detector' },
],
},
{
text: 'Video',
collapsed: false,
items: [
{ text: 'Video Buffer Converter', link: '/video/video-buffer-converter' },
{ text: 'Video Capture', link: '/video/video-capturer' },
],
},
{
text: 'Desktop',
collapsed: false,
items: [
{ text: 'Screen Capturer', link: '/desktop/screen-capturer' },
{ text: 'Window Capturer ', link: '/desktop/window-capturer' },
{ text: 'Power Management', link: '/desktop/power-management' },
],
},
]
}
17 changes: 17 additions & 0 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// https://vitepress.dev/guide/custom-theme
import { h } from 'vue'
import type { Theme } from 'vitepress'
import DefaultTheme from 'vitepress/theme'
import './style.css'

export default {
extends: DefaultTheme,
Layout: () => {
return h(DefaultTheme.Layout, null, {
// https://vitepress.dev/guide/extending-default-theme#layout-slots
})
},
enhanceApp({ app, router, siteData }) {
// ...
}
} satisfies Theme
Loading