Skip to content

Commit 1e7dd72

Browse files
committed
Test Deploy
1 parent 2d6df1b commit 1e7dd72

4 files changed

Lines changed: 33 additions & 4 deletions

File tree

.github/workflows/docs-publish.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Deploy Docs to Pages
33

44
on:
55
push:
6-
branches: ["main"]
6+
branches: ["main", "add-docs"]
77
workflow_dispatch:
88

99
permissions:
@@ -15,7 +15,6 @@ concurrency:
1515

1616
jobs:
1717
build:
18-
name: Build docs
1918
runs-on: ubuntu-latest
2019
steps:
2120
- uses: actions/checkout@v6
@@ -29,7 +28,6 @@ jobs:
2928
path: ./site
3029

3130
deploy:
32-
name: Deploy docs to GitHub Pages
3331
needs: build
3432
runs-on: ubuntu-latest
3533
permissions:

docs/demo.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<gradio-app src="https://istupakov-onnx-asr.hf.space" info="true" eager="false"></gradio-app>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
function getMkDocsTheme() {
2+
const scheme = document.body.getAttribute("data-md-color-scheme");
3+
return scheme === "slate" ? "dark" : "light";
4+
}
5+
6+
function syncGradioTheme() {
7+
const theme = getMkDocsTheme();
8+
document
9+
.querySelectorAll("gradio-app")
10+
.forEach(app => app.className = theme);
11+
}
12+
13+
document.addEventListener("DOMContentLoaded", () => {
14+
syncGradioTheme();
15+
16+
const observer = new MutationObserver(() => {
17+
syncGradioTheme();
18+
});
19+
20+
observer.observe(document.body, {
21+
attributes: true,
22+
attributeFilter: ["data-md-color-scheme"]
23+
});
24+
});

mkdocs.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,15 @@ watch:
4848
- README.md
4949

5050
nav:
51-
- Introduction: index.md
51+
- Readme: index.md
52+
- Demo: demo.md
5253
- Reference: reference.md
5354

55+
extra_javascript:
56+
- path: https://gradio.s3-us-west-2.amazonaws.com/6.3.0/gradio.js
57+
type: module
58+
- javascripts/gradio-theme-sync.js
59+
5460
markdown_extensions:
5561
- admonition
5662
- attr_list

0 commit comments

Comments
 (0)