Skip to content

Commit e7c9009

Browse files
committed
docs: update versioning in examples and add dynamic version handling
1 parent 5ee0b8a commit e7c9009

3 files changed

Lines changed: 28 additions & 11 deletions

File tree

docs/assets/versions.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
window.PROJECT_VARS = {
2+
VERSION: '0.12.0',
3+
VERSION_SNAPSHOT: '0.13.0-SNAPSHOT'
4+
};

docs/index.html

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
</head>
1313
<body>
1414
<div id="app"></div>
15+
<script src="assets/versions.js"></script>
1516
<script>
1617
window.$docsify = {
1718
name: 'webrtc-java',
@@ -23,7 +24,7 @@
2324
auto2top: true,
2425
autoHeader: false,
2526
subMaxLevel: 2,
26-
homepage: 'https://raw.githubusercontent.com/devopvoid/webrtc-java/master/README.md',
27+
homepage: 'https://raw.githubusercontent.com/devopvoid/webrtc-java/examples/README.md',
2728
alias: {
2829
'.*?/changelog': 'https://raw.githubusercontent.com/devopvoid/webrtc-java/master/CHANGELOG',
2930
},
@@ -38,7 +39,19 @@
3839
buttonText: 'Copy',
3940
errorText: 'Error',
4041
successText: 'Copied'
41-
}
42+
},
43+
plugins: [
44+
function(hook, vm) {
45+
hook.beforeEach(function(content) {
46+
let result = content;
47+
for (const [key, value] of Object.entries(window.PROJECT_VARS)) {
48+
const regex = new RegExp(`\\{\\{${key}\\}\\}`, 'g');
49+
result = result.replace(regex, value);
50+
}
51+
return result;
52+
});
53+
}
54+
]
4255
}
4356
</script>
4457
<script src="//cdn.jsdelivr.net/npm/docsify@4"></script>

docs/quickstart.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Add the following dependency to your `pom.xml`:
4242
<dependency>
4343
<groupId>dev.onvoid.webrtc</groupId>
4444
<artifactId>webrtc-java</artifactId>
45-
<version>0.12.0</version>
45+
<version>{{VERSION}}</version>
4646
</dependency>
4747
```
4848

@@ -54,7 +54,7 @@ If you want to use the latest development version, you can use a SNAPSHOT releas
5454
<dependency>
5555
<groupId>dev.onvoid.webrtc</groupId>
5656
<artifactId>webrtc-java</artifactId>
57-
<version>0.13.0-SNAPSHOT</version>
57+
<version>{{VERSION_SNAPSHOT}}</version>
5858
</dependency>
5959
```
6060

@@ -81,18 +81,18 @@ To use SNAPSHOT versions, you need to add the following repository configuration
8181
Add the following to your `build.gradle`:
8282

8383
```gradle
84-
implementation "dev.onvoid.webrtc:webrtc-java:0.12.0"
84+
implementation "dev.onvoid.webrtc:webrtc-java:{{VERSION}}"
8585
```
8686

8787
For specific platforms, add the appropriate classifier:
8888

8989
```gradle
90-
implementation group: "dev.onvoid.webrtc", name: "webrtc-java", version: "0.12.0", classifier: "windows-x86_64"
91-
implementation group: "dev.onvoid.webrtc", name: "webrtc-java", version: "0.12.0", classifier: "macos-x86_64"
92-
implementation group: "dev.onvoid.webrtc", name: "webrtc-java", version: "0.12.0", classifier: "macos-aarch64"
93-
implementation group: "dev.onvoid.webrtc", name: "webrtc-java", version: "0.12.0", classifier: "linux-x86_64"
94-
implementation group: "dev.onvoid.webrtc", name: "webrtc-java", version: "0.12.0", classifier: "linux-aarch64"
95-
implementation group: "dev.onvoid.webrtc", name: "webrtc-java", version: "0.12.0", classifier: "linux-aarch32"
90+
implementation group: "dev.onvoid.webrtc", name: "webrtc-java", version: "{{VERSION}}", classifier: "windows-x86_64"
91+
implementation group: "dev.onvoid.webrtc", name: "webrtc-java", version: "{{VERSION}}", classifier: "macos-x86_64"
92+
implementation group: "dev.onvoid.webrtc", name: "webrtc-java", version: "{{VERSION}}", classifier: "macos-aarch64"
93+
implementation group: "dev.onvoid.webrtc", name: "webrtc-java", version: "{{VERSION}}", classifier: "linux-x86_64"
94+
implementation group: "dev.onvoid.webrtc", name: "webrtc-java", version: "{{VERSION}}", classifier: "linux-aarch64"
95+
implementation group: "dev.onvoid.webrtc", name: "webrtc-java", version: "{{VERSION}}", classifier: "linux-aarch32"
9696
```
9797

9898
## Basic Setup

0 commit comments

Comments
 (0)