Skip to content

Commit 694df16

Browse files
committed
Adopt Furo documentation
1 parent 9248d73 commit 694df16

6 files changed

Lines changed: 96 additions & 108 deletions

File tree

.github/workflows/pages.yml

Lines changed: 28 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,8 @@ on:
99
permissions:
1010
contents: read
1111

12-
concurrency:
13-
group: pages
14-
cancel-in-progress: true
15-
1612
jobs:
17-
deploy:
13+
build:
1814
runs-on: ubuntu-latest
1915
steps:
2016
- uses: actions/checkout@v7
@@ -33,9 +29,9 @@ jobs:
3329
run: python -m pip install '.[docs,ase]'
3430
- name: Build documentation
3531
run: >-
36-
python -m sphinx -W -b html
32+
python -m sphinx -W --keep-going -b html
3733
-d _build/doctrees
38-
docs _site/PQViewer
34+
docs _site
3935
- name: Install frontend dependencies
4036
working-directory: frontend
4137
run: npm ci
@@ -44,38 +40,33 @@ jobs:
4440
env:
4541
VITE_STATIC_DEMO: "true"
4642
VITE_BASE_PATH: /PQViewer/viewer/
47-
PQVIEWER_OUT_DIR: ../_site/PQViewer/viewer
43+
PQVIEWER_OUT_DIR: ../_site/viewer
4844
run: npm run build
4945
- name: Pack the perovskite demo
5046
run: >-
5147
python scripts/build_static_demo.py
5248
examples/strontium-titanate.extxyz
53-
_site/PQViewer/viewer/demo
54-
- name: Configure deployment key
55-
env:
56-
DOCS_DEPLOY_KEY: ${{ secrets.DOCS_DEPLOY_KEY }}
57-
run: |
58-
if [ -z "$DOCS_DEPLOY_KEY" ]; then
59-
echo "::error::DOCS_DEPLOY_KEY is not configured"
60-
exit 1
61-
fi
62-
install -m 700 -d ~/.ssh
63-
printf '%s\n' "$DOCS_DEPLOY_KEY" > ~/.ssh/id_ed25519
64-
chmod 600 ~/.ssh/id_ed25519
65-
printf '%s\n' \
66-
"github.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl" \
67-
> ~/.ssh/known_hosts
68-
- name: Publish generated site
69-
run: |
70-
git clone --branch gh-pages --single-branch \
71-
git@github.com:MolarVerse/molarverse.github.io.git _pages
72-
rsync -a --delete _site/PQViewer/ _pages/PQViewer/
73-
touch _pages/.nojekyll
74-
git -C _pages config user.name "github-actions[bot]"
75-
git -C _pages config user.email \
76-
"41898282+github-actions[bot]@users.noreply.github.com"
77-
git -C _pages add -- .nojekyll PQViewer
78-
if ! git -C _pages diff --cached --quiet; then
79-
git -C _pages commit -m "Update PQViewer documentation"
80-
git -C _pages push origin gh-pages
81-
fi
49+
_site/viewer/demo
50+
- name: Prepare Pages
51+
run: touch _site/.nojekyll
52+
- name: Upload Pages artifact
53+
uses: actions/upload-pages-artifact@v5
54+
with:
55+
path: _site
56+
57+
deploy:
58+
needs: build
59+
runs-on: ubuntu-latest
60+
concurrency:
61+
group: pages
62+
cancel-in-progress: false
63+
permissions:
64+
pages: write
65+
id-token: write
66+
environment:
67+
name: github-pages
68+
url: ${{ steps.deployment.outputs.page_url }}
69+
steps:
70+
- name: Deploy to GitHub Pages
71+
id: deployment
72+
uses: actions/deploy-pages@v5

docs/_static/custom.css

Lines changed: 22 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,27 @@
1-
:root {
2-
--pst-color-primary: #1f718f;
3-
--pst-color-secondary: #12313a;
4-
--pst-color-link: #176c8c;
5-
--pst-color-link-hover: #0d4e66;
6-
--pst-font-family-base-system: Inter, ui-sans-serif, -apple-system,
7-
BlinkMacSystemFont, "Segoe UI", sans-serif;
8-
--pst-font-family-monospace-system: "SFMono-Regular", Consolas,
9-
"Liberation Mono", monospace;
10-
}
1+
/* PQViewer-specific additions to Furo. */
112

12-
html[data-theme="dark"] {
13-
--pst-color-primary: #65bddb;
14-
--pst-color-secondary: #94ccd9;
15-
--pst-color-link: #65bddb;
16-
--pst-color-link-hover: #9ed9eb;
17-
--pst-color-background: #0d171b;
18-
--pst-color-on-background: #e7eff0;
19-
--pst-color-surface: #142228;
3+
.sd-card {
4+
box-shadow: none;
5+
transition: transform 0.15s ease, box-shadow 0.15s ease;
206
}
217

22-
.bd-page-width {
23-
max-width: 88rem;
8+
.sd-card:hover {
9+
transform: translateY(-2px);
10+
box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
2411
}
2512

26-
.navbar-brand img {
27-
width: 2rem;
28-
height: 2rem;
13+
.content p code.literal,
14+
.content li code.literal {
15+
background: var(--color-code-background);
16+
border-radius: 0.2em;
2917
}
3018

31-
.navbar-brand.logo .title {
32-
font-weight: 700;
33-
letter-spacing: -0.02em;
19+
.sidebar-logo {
20+
width: 4rem;
3421
}
3522

36-
.bd-article h1,
37-
.bd-article h2,
38-
.bd-article h3 {
23+
.sidebar-brand-text {
24+
font-weight: 700;
3925
letter-spacing: -0.02em;
4026
}
4127

@@ -45,16 +31,16 @@ html[data-theme="dark"] {
4531

4632
.pq-workspace img {
4733
width: 100%;
48-
border: 1px solid var(--pst-color-border);
34+
border: 1px solid var(--color-foreground-border);
4935
border-radius: 0.35rem;
5036
}
5137

5238
.pq-demo-shell {
5339
margin: 1.5rem 0 2rem;
5440
overflow: hidden;
55-
border: 1px solid var(--pst-color-border);
41+
border: 1px solid var(--color-background-border);
5642
border-radius: 0.55rem;
57-
background: var(--pst-color-surface);
43+
background: var(--color-background-secondary);
5844
}
5945

6046
.pq-demo-heading {
@@ -63,7 +49,7 @@ html[data-theme="dark"] {
6349
align-items: center;
6450
justify-content: space-between;
6551
padding: 0.75rem 0.9rem;
66-
border-bottom: 1px solid var(--pst-color-border);
52+
border-bottom: 1px solid var(--color-background-border);
6753
}
6854

6955
.pq-demo-heading div {
@@ -72,7 +58,7 @@ html[data-theme="dark"] {
7258
}
7359

7460
.pq-demo-heading span {
75-
color: var(--pst-color-text-muted);
61+
color: var(--color-foreground-secondary);
7662
font-size: 0.86rem;
7763
}
7864

@@ -90,27 +76,13 @@ html[data-theme="dark"] {
9076
background: #f6f8f8;
9177
}
9278

93-
.sd-card {
94-
box-shadow: none;
95-
}
96-
9779
.sd-card-img-top {
9880
aspect-ratio: 4 / 3;
99-
border-bottom: 1px solid var(--pst-color-border);
100-
background: var(--pst-color-surface);
81+
border-bottom: 1px solid var(--color-background-border);
82+
background: var(--color-background-secondary);
10183
object-fit: cover;
10284
}
10385

104-
.sd-card:hover {
105-
border-color: var(--pst-color-primary);
106-
}
107-
108-
@media screen and (max-width: 67.99em) {
109-
.bd-main .bd-content .bd-article-container {
110-
max-width: 100%;
111-
}
112-
}
113-
11486
@media screen and (max-width: 40em) {
11587
.pq-demo-heading {
11688
align-items: flex-start;

docs/conf.py

Lines changed: 40 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,21 @@
44

55
extensions = [
66
"myst_parser",
7+
"sphinx_copybutton",
78
"sphinx_design",
89
]
910

11+
copybutton_prompt_text = r">>> |\.\.\. |\$ "
12+
copybutton_prompt_is_regexp = True
13+
1014
source_suffix = {
1115
".md": "markdown",
1216
}
1317
root_doc = "index"
1418
exclude_patterns = [
1519
"_build",
20+
"Thumbs.db",
21+
".DS_Store",
1622
]
1723

1824
myst_enable_extensions = [
@@ -22,30 +28,46 @@
2228
]
2329
myst_heading_anchors = 3
2430

25-
html_theme = "pydata_sphinx_theme"
26-
html_title = "PQViewer documentation"
31+
html_theme = "furo"
32+
html_title = "PQViewer"
2733
html_logo = "assets/brand/pq-logo.png"
2834
html_favicon = "assets/brand/pq-logo.png"
2935
html_static_path = ["_static"]
3036
html_css_files = ["custom.css"]
31-
html_context = {
32-
"default_mode": "auto",
33-
}
3437

3538
html_theme_options = {
36-
"logo": {
37-
"text": "PQViewer",
39+
"sidebar_hide_name": False,
40+
"light_css_variables": {
41+
"color-brand-primary": "#1f718f",
42+
"color-brand-content": "#176c8c",
3843
},
39-
"github_url": "https://github.com/MolarVerse/PQViewer",
40-
"navbar_align": "left",
41-
"navigation_with_keys": True,
42-
"show_nav_level": 1,
43-
"show_toc_level": 2,
44-
"secondary_sidebar_items": ["page-toc"],
45-
"footer_start": ["copyright"],
46-
"footer_end": ["sphinx-version"],
44+
"dark_css_variables": {
45+
"color-brand-primary": "#65bddb",
46+
"color-brand-content": "#65bddb",
47+
},
48+
"source_repository": "https://github.com/MolarVerse/PQViewer/",
49+
"source_branch": "main",
50+
"source_directory": "docs/",
51+
"footer_icons": [
52+
{
53+
"name": "GitHub",
54+
"url": "https://github.com/MolarVerse/PQViewer",
55+
"html": (
56+
'<svg stroke="currentColor" fill="currentColor" stroke-width="0" '
57+
'viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8 0C3.58 0 0 '
58+
'3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01'
59+
'-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13'
60+
'-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 '
61+
'2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31'
62+
'-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 '
63+
'1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 '
64+
'1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 '
65+
'3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55'
66+
'.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"></path></svg>'
67+
),
68+
"class": "",
69+
},
70+
],
4771
}
4872

49-
html_sidebars = {
50-
"**": ["sidebar-nav-bs.html"],
51-
}
73+
html_baseurl = "https://molarverse.github.io/PQViewer/"

docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ examples.
204204
```{toctree}
205205
:hidden:
206206
:maxdepth: 2
207+
:caption: Contents
207208
208209
getting-started
209210
web-demo

docs/web-demo.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,6 @@ features. The local server binds to `127.0.0.1` by default.
3333

3434
## Deployment
3535

36-
The Pages workflow builds this documentation and the fixed-dataset viewer, then
37-
publishes the generated files under `/PQViewer/` on the MolarVerse Pages site.
36+
The Pages workflow builds this documentation and the fixed-dataset viewer as
37+
one artifact. Pushes to `main` publish it through the repository's GitHub Pages
38+
environment.

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,10 @@ jupyter = [
3434
"ipython>=8,<10",
3535
]
3636
docs = [
37+
"furo>=2024.8.6,<2027",
3738
"myst-parser>=4,<5",
38-
"pydata-sphinx-theme>=0.16,<1",
3939
"sphinx>=8,<9",
40+
"sphinx-copybutton>=0.5,<1",
4041
"sphinx-design>=0.6,<1",
4142
]
4243
dev = [

0 commit comments

Comments
 (0)