Skip to content

Commit 8d04f3e

Browse files
author
Chaoming Wang
committed
feat: integrate brainx_sphinx_header extension for dynamic header inclusion
1 parent 49ac2b6 commit 8d04f3e

4 files changed

Lines changed: 11 additions & 177 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,3 +196,4 @@ cython_debug/
196196
/docs/_brand/
197197
/docs/_static/css/brainx-header.css
198198
/docs/_static/js/brainx-header.js
199+
/CLAUDE.md

docs/_brainx_header.py

Lines changed: 0 additions & 168 deletions
This file was deleted.

docs/conf.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
'sphinx_design',
6969
'sphinx_copybutton',
7070
'nbsphinx',
71+
'brainx_sphinx_header',
7172
]
7273
# Add any paths that contain custom static files (such as style sheets) here,
7374
# relative to this directory. They are copied after the builtin static files,
@@ -130,15 +131,15 @@
130131
# so a file named "default.css" will overwrite the builtin "default.css".
131132
html_static_path = ["_static"]
132133

133-
# Fetch the canonical BrainX header from brainx.chaobrain.com and emit it as
134-
# static assets. See docs/_brainx_header.py for env-var controls
135-
# (BRAINX_HEADER_LOCAL / BRAINX_HEADER_OFFLINE / BRAINX_HEADER_TTL).
136-
import _brainx_header
137-
_brainx_header.install(os.path.dirname(os.path.abspath(__file__)))
134+
# The BrainX brand header is provided by the `brainx_sphinx_header` extension
135+
# (added to `extensions` above). It fetches header.html/css from
136+
# https://brainx.chaobrain.com/shared-header, emits them under _static/, and
137+
# registers them automatically. Override defaults here if needed:
138+
# brainx_header_url = "https://brainx.chaobrain.com/shared-header"
139+
# brainx_header_ttl = 3600
140+
# brainx_header_offline = False
141+
# brainx_header_local = None
138142

139-
html_css_files = [
140-
'css/brainx-header.css',
141-
]
142143

143144
# jupyter_execute_notebooks = "off"
144145
nb_execution_mode = "off"
@@ -164,6 +165,5 @@
164165

165166
# Add Plotly JS once for your whole site (optional but recommended)
166167
html_js_files = [
167-
"js/brainx-header.js",
168168
"https://cdn.plot.ly/plotly-latest.min.js", # or pin a specific version
169169
]

docs/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ jupyter-sphinx>=0.5.3
1212
sphinx-design
1313
myst-parser[linkify]
1414
nbsphinx
15+
brainx-sphinx-header

0 commit comments

Comments
 (0)