Skip to content

Commit 0c7f7b1

Browse files
committed
docs: add Sphinx documentation site with Prerau Lab branding
1 parent 6b27cd5 commit 0c7f7b1

18 files changed

Lines changed: 332 additions & 0 deletions

.github/workflows/docs.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Build docs
2+
3+
on:
4+
push:
5+
branches: [master, main]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v5
18+
with:
19+
submodules: recursive
20+
- uses: actions/setup-python@v6
21+
with:
22+
python-version: "3.11"
23+
cache: pip
24+
cache-dependency-path: docs/requirements.txt
25+
- name: Install dependencies
26+
run: pip install -r docs/requirements.txt
27+
- name: Build Sphinx
28+
run: sphinx-build -b html --keep-going docs docs/_build/html
29+
- name: Upload artifact
30+
uses: actions/upload-pages-artifact@v4
31+
with:
32+
path: docs/_build/html
33+
34+
deploy:
35+
needs: build
36+
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
37+
runs-on: ubuntu-latest
38+
environment:
39+
name: github-pages
40+
url: ${{ steps.deployment.outputs.page_url }}
41+
steps:
42+
- name: Deploy to GitHub Pages
43+
id: deployment
44+
uses: actions/deploy-pages@v5

docs/_static/prerau.css

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
/* Prerau Lab branding overlay on top of default Furo.
2+
Keeps Furo's default typography; adds a PRERAU LAB eyebrow above the
3+
project name and a sleepEEG.org link below (see templates/sidebar/brand.html).
4+
*/
5+
6+
.prerau-brand-wrapper {
7+
padding: 1.2rem 0 0.6rem 0;
8+
}
9+
10+
/* "PRERAU LAB" eyebrow */
11+
.prerau-lab-eyebrow {
12+
font-weight: 500;
13+
font-size: 1.35rem;
14+
text-transform: uppercase;
15+
letter-spacing: 0.075em;
16+
color: var(--color-foreground-primary);
17+
line-height: 1.25;
18+
margin-bottom: 0.3rem;
19+
}
20+
21+
/* Project name (Furo's default, but tightened under the eyebrow) */
22+
.sidebar-brand {
23+
text-decoration: none;
24+
padding: 0;
25+
}
26+
27+
.sidebar-brand-text {
28+
color: var(--color-foreground-secondary);
29+
font-weight: 400;
30+
font-size: 1.0rem;
31+
letter-spacing: 0;
32+
}
33+
34+
/* sleepEEG.org link — between the eyebrow and the project name */
35+
.prerau-lab-site-link {
36+
display: block;
37+
margin-bottom: 0.55rem;
38+
font-size: 0.82rem;
39+
color: var(--color-foreground-muted);
40+
text-decoration: none;
41+
transition: color 0.15s ease;
42+
}
43+
44+
.prerau-lab-site-link:hover {
45+
color: var(--color-brand-primary);
46+
}
47+
48+
/* Dark-mode tweaks */
49+
body[data-theme="dark"] .prerau-lab-eyebrow {
50+
color: var(--color-foreground-primary);
51+
}
52+
53+
/* Always-expanded sidebar toctree groups ------------------------------- */
54+
/* Furo collapses `.toctree-l*.has-children` children via a hidden
55+
checkbox + label. Override to show every child list by default and
56+
hide the disclosure toggle. */
57+
58+
.sidebar-tree input.toctree-checkbox ~ ul {
59+
display: revert !important;
60+
}
61+
62+
.sidebar-tree input.toctree-checkbox,
63+
.sidebar-tree .toctree-l1.has-children > label,
64+
.sidebar-tree .toctree-l2.has-children > label,
65+
.sidebar-tree .toctree-l3.has-children > label {
66+
display: none !important;
67+
}
68+
69+
/* Tighten spacing for the now-always-visible deep children */
70+
.sidebar-tree li.toctree-l2 {
71+
margin-top: 0.15rem;
72+
margin-bottom: 0.15rem;
73+
}

docs/_templates/sidebar/brand.html

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{# Furo sidebar brand override: Prerau Lab eyebrow above the project name,
2+
sleepEEG.org link below. #}
3+
<div class="prerau-brand-wrapper">
4+
<div class="prerau-lab-eyebrow">Prerau Lab</div>
5+
<a class="prerau-lab-site-link" href="https://sleepeeg.org" target="_blank" rel="noopener">sleepEEG.org</a>
6+
<a class="sidebar-brand" href="{{ pathto(master_doc) }}">
7+
{%- block brand_content %}
8+
{%- if theme_light_logo and theme_dark_logo %}
9+
<img class="sidebar-logo only-light" src="{{ pathto('_static/' + theme_light_logo, 1) }}" alt="Light Logo"/>
10+
<img class="sidebar-logo only-dark" src="{{ pathto('_static/' + theme_dark_logo, 1) }}" alt="Dark Logo"/>
11+
{%- elif logo_url %}
12+
<img class="sidebar-logo" src="{{ logo_url }}" alt="Logo"/>
13+
{%- endif %}
14+
{%- if not theme_sidebar_hide_name %}
15+
<span class="sidebar-brand-text">{{ docstitle if docstitle else project }}</span>
16+
{%- endif %}
17+
{%- endblock brand_content %}
18+
</a>
19+
</div>

docs/api.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
API Reference
2+
=============
3+
4+
.. toctree::
5+
:maxdepth: 1
6+
7+
api/example1_script
8+
api/example4_script
9+
api/build_design_mx
10+
api/CardinalSpline
11+
api/figdesign
12+
api/hypnoplot_old
13+
api/ks_plot
14+
api/plot_DesignMx_Resp
15+
api/plot_hist_mod_curve
16+
api/save_output_tbl
17+
api/scaleline

docs/api/CardinalSpline.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
CardinalSpline
2+
==============
3+
4+
.. mat:currentmodule:: .
5+
6+
.. mat:autofunction:: CardinalSpline

docs/api/build_design_mx.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
build_design_mx
2+
===============
3+
4+
.. mat:currentmodule:: .
5+
6+
.. mat:autofunction:: build_design_mx

docs/api/example1_script.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
example1_script
2+
===============
3+
4+
.. mat:currentmodule:: .
5+
6+
.. mat:autofunction:: example1_script

docs/api/example4_script.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
example4_script
2+
===============
3+
4+
.. mat:currentmodule:: .
5+
6+
.. mat:autofunction:: example4_script

docs/api/figdesign.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
figdesign
2+
=========
3+
4+
.. mat:currentmodule:: .
5+
6+
.. mat:autofunction:: figdesign

docs/api/hypnoplot_old.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
hypnoplot_old
2+
=============
3+
4+
.. mat:currentmodule:: .
5+
6+
.. mat:autofunction:: hypnoplot_old

0 commit comments

Comments
 (0)