Skip to content

Commit 693cc8a

Browse files
committed
upgrade to docusaurus 3.4.0.
1 parent a0e2797 commit 693cc8a

File tree

8 files changed

+9172
-54
lines changed

8 files changed

+9172
-54
lines changed

docs/flutter-webrtc/first-app.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,3 @@ render the video renderer in the widget tree
7979
);
8080
}
8181
```
82-

docs/flutter-webrtc/get-stared.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ sidebar_position: 2
44

55
# Get Started
66

7-
Please refer to <https://flutter.dev/docs> to deploy the Flutter development environment.
7+
Please refer to [here](https://flutter.dev/docs) to deploy the Flutter development environment.
88

99
## Usage
1010

11-
Add `flutter_webrtc` as a [dependency in your pubspec.yaml file](https://flutter.io/using-packages/).
11+
Add `flutter_webrtc` as a `[dependency in your pubspec.yaml file](https://flutter.io/using-packages/)`.
1212

13-
You can find the latest version here [![pub package](https://img.shields.io/pub/v/flutter_webrtc.svg)](https://pub.dartlang.org/packages/flutter_webrtc)
13+
You can find the latest version here `[![pub package](https://img.shields.io/pub/v/flutter_webrtc.svg)](https://pub.dartlang.org/packages/flutter_webrtc)`
1414

1515
```yaml
1616
flutter_webrtc: ^x.y.z
@@ -22,4 +22,4 @@ or just use `flutter pub add flutter_webrtc` to add the dependency.
2222

2323
## Setup required permissions for audio and video
2424

25-
please view next page [Project Settings](./project-settings)
25+
please view next page `[Project Settings](./project-settings)`

docs/flutter-webrtc/loopback.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
sidebar_position: 4
3+
---
4+
5+
# LoopBack App
6+
7+
## Introduction
8+
9+
This is a simple example of how to use the `flutter-webrtc` package to create a loopback call
10+
11+
## How to use
12+
13+
Basic Flowchart:
14+
15+
```mermaid
16+
flowchart TD
17+
A[Create a new RTCPeerConnection] --> B[Create a new MediaStream]
18+
B --> C[Add the MediaStream to the RTCPeerConnection]
19+
C --> D[Create a new RTCDataChannel]
20+
D --> E[Send a message]
21+
E --> F[Receive a message]
22+
F --> D
23+
```

docusaurus.config.js renamed to docusaurus.config.ts

Lines changed: 53 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,63 @@
1-
const lightCodeTheme = require('prism-react-renderer/themes/github');
2-
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
1+
import {themes as prismThemes} from 'prism-react-renderer';
2+
import type {Config} from '@docusaurus/types';
3+
import type * as Preset from '@docusaurus/preset-classic';
4+
5+
const config: Config = {
6+
favicon: 'img/favicon.ico',
37

4-
/** @type {import('@docusaurus/types').DocusaurusConfig} */
5-
module.exports = {
68
title: 'Flutter WebRTC Community',
79
tagline: 'Make WebRTC/VoIP development easier.',
810
url: 'https://flutterwebrtc.com',
11+
12+
// Set the /<baseUrl>/ pathname under which your site is served
13+
// For GitHub pages deployment, it is often '/<projectName>/'
914
baseUrl: '/',
10-
onBrokenLinks: 'throw',
11-
onBrokenMarkdownLinks: 'warn',
12-
favicon: 'img/favicon.ico',
15+
16+
// GitHub pages deployment config.
17+
// If you aren't using GitHub pages, you don't need these.
1318
organizationName: 'flutter-webrtc', // Usually your GitHub org/user name.
1419
projectName: 'flutter-webrtc', // Usually your repo name.
20+
21+
onBrokenLinks: 'throw',
22+
onBrokenMarkdownLinks: 'warn',
23+
24+
// Even if you don't use internationalization, you can use this field to set
25+
// useful metadata like html lang. For example, if your site is Chinese, you
26+
// may want to replace "en" with "zh-Hans".
1527
i18n: {
1628
defaultLocale: 'en',
1729
locales: ['en', 'zh-cn'],
1830
},
31+
markdown: {
32+
mermaid: true,
33+
},
34+
themes: ['@docusaurus/theme-mermaid'],
35+
presets: [
36+
[
37+
'classic',
38+
{
39+
docs: {
40+
sidebarPath: require.resolve('./sidebars.js'),
41+
// Please change this to your repo.
42+
editUrl:
43+
'https://github.com/flutter-webrtc/docs/edit/main/',
44+
},
45+
blog: {
46+
showReadingTime: true,
47+
// Please change this to your repo.
48+
editUrl:
49+
'https://github.com/flutter-webrtc/docs/edit/main/',
50+
},
51+
theme: {
52+
customCss: require.resolve('./src/css/custom.css'),
53+
},
54+
} satisfies Preset.Options,
55+
],
56+
],
57+
1958
themeConfig: {
59+
// Replace with your project's social card
60+
src: 'img/flutter-webrtc.png',
2061
navbar: {
2162
title: 'Flutter WebRTC Community',
2263
logo: {
@@ -93,30 +134,10 @@ module.exports = {
93134
copyright: `Copyright © ${new Date().getFullYear()} Flutter-WebRTC Project.`,
94135
},
95136
prism: {
96-
theme: lightCodeTheme,
97-
darkTheme: darkCodeTheme,
137+
theme: prismThemes.github,
138+
darkTheme: prismThemes.dracula,
98139
},
99-
},
100-
presets: [
101-
[
102-
'@docusaurus/preset-classic',
103-
{
104-
docs: {
105-
sidebarPath: require.resolve('./sidebars.js'),
106-
// Please change this to your repo.
107-
editUrl:
108-
'https://github.com/flutter-webrtc/docs/edit/main/',
109-
},
110-
blog: {
111-
showReadingTime: true,
112-
// Please change this to your repo.
113-
editUrl:
114-
'https://github.com/flutter-webrtc/docs/edit/main/',
115-
},
116-
theme: {
117-
customCss: require.resolve('./src/css/custom.css'),
118-
},
119-
},
120-
],
121-
],
140+
} satisfies Preset.ThemeConfig,
122141
};
142+
143+
export default config;

package.json

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,24 @@
1111
"clear": "docusaurus clear",
1212
"serve": "docusaurus serve",
1313
"write-translations": "docusaurus write-translations",
14-
"write-heading-ids": "docusaurus write-heading-ids"
14+
"write-heading-ids": "docusaurus write-heading-ids",
15+
"typecheck": "tsc"
1516
},
1617
"dependencies": {
17-
"@docusaurus/core": "2.0.0-beta.4",
18-
"@docusaurus/preset-classic": "2.0.0-beta.4",
19-
"@mdx-js/react": "^1.6.21",
20-
"@svgr/webpack": "^5.5.0",
21-
"clsx": "^1.1.1",
22-
"file-loader": "^6.2.0",
23-
"prism-react-renderer": "^1.2.1",
24-
"react": "^17.0.1",
25-
"react-dom": "^17.0.1",
26-
"url-loader": "^4.1.1"
18+
"@docusaurus/core": "3.4.0",
19+
"@docusaurus/preset-classic": "3.4.0",
20+
"@docusaurus/theme-mermaid": "^3.4.0",
21+
"@mdx-js/react": "^3.0.0",
22+
"clsx": "^2.0.0",
23+
"prism-react-renderer": "^2.3.0",
24+
"react": "^18.0.0",
25+
"react-dom": "^18.0.0"
26+
},
27+
"devDependencies": {
28+
"@docusaurus/module-type-aliases": "3.4.0",
29+
"@docusaurus/tsconfig": "3.4.0",
30+
"@docusaurus/types": "3.4.0",
31+
"typescript": "~5.2.2"
2732
},
2833
"browserslist": {
2934
"production": [
@@ -32,9 +37,12 @@
3237
"not op_mini all"
3338
],
3439
"development": [
35-
"last 1 chrome version",
36-
"last 1 firefox version",
37-
"last 1 safari version"
40+
"last 3 chrome version",
41+
"last 3 firefox version",
42+
"last 5 safari version"
3843
]
44+
},
45+
"engines": {
46+
"node": ">=18.0"
3947
}
4048
}

sidebars.js renamed to sidebars.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import type {SidebarsConfig} from '@docusaurus/plugin-content-docs';
2+
13
/**
24
* Creating a sidebar enables you to:
35
- create an ordered group of docs
@@ -8,19 +10,22 @@
810
911
Create as many sidebars as you want.
1012
*/
11-
12-
module.exports = {
13+
const sidebars: SidebarsConfig = {
1314
// By default, Docusaurus generates a sidebar from the docs folder structure
1415
tutorialSidebar: [{type: 'autogenerated', dirName: '.'}],
1516

1617
// But you can create a sidebar manually
1718
/*
1819
tutorialSidebar: [
20+
'intro',
21+
'hello',
1922
{
2023
type: 'category',
2124
label: 'Tutorial',
22-
items: ['hello'],
25+
items: ['tutorial-basics/create-a-document'],
2326
},
2427
],
2528
*/
2629
};
30+
31+
export default sidebars;

tsconfig.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
// This file is not used in compilation. It is here just for a nice editor experience.
3+
"extends": "@docusaurus/tsconfig",
4+
"compilerOptions": {
5+
"baseUrl": "."
6+
}
7+
}

0 commit comments

Comments
 (0)