Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NEW: Add headers #559

Draft
wants to merge 17 commits into
base: master
Choose a base branch
from
48 changes: 48 additions & 0 deletions docs/_data/config-header.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
brand:
type: button
image: https://executablebooks.org/en/latest/_static/logo.svg
url: https://sphinx-book-theme.readthedocs.io
# For testing
# content: Test site name
start:
- type: dropdown
content: Projects
items:
- content: Jupyter Book
url: https://jupyterbook.org
- content: MyST Markdown
url: https://myst-parser.readthedocs.io
- content: MyST-NB
url: https://myst-nb.readthedocs.io

- type: dropdown
content: Community
items:
- content: Community guide
url: https://executablebooks.org
- content: Forum
url: https://github.com/orgs/executablebooks/discussions
- content: Feature Voting
url: https://executablebooks.org/en/latest/feature-vote.html

- type: button
content: Book gallery
url: http://gallery.jupyterbook.org/


end:
- type: group
items:
- type: button
icon: fab fa-twitter-square
title: Twitter
url: https://twitter.com/executablebooks
- type: button
icon: fab fa-github-square
title: GitHub
url: https://github.com/executablebooks
- type: button
icon: fas fa-comments
outline: true
content: Discussion
url: https://github.com/orgs/executablebooks/discussions
5 changes: 4 additions & 1 deletion docs/_static/custom.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
:root {
--sd-color-primary: #f37726;
/* WONT WORK UNTIL THE NEXT PYDATA THEME IS RELEASED
--sbt-color-primary: #f37726;
--sd-color-primary: var(--sbt-color-primary);
*/
}
2 changes: 0 additions & 2 deletions docs/_templates/sections/header.html

This file was deleted.

43 changes: 31 additions & 12 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os
from pathlib import Path
from urllib import request
from yaml import safe_load

project = "Sphinx Book Theme"
copyright = "2020"
Expand Down Expand Up @@ -98,23 +99,40 @@
html_static_path = ["_static"]
html_css_files = ["custom.css"]
jupyter_execute_notebooks = "cache"
thebe_config = {
"repository_url": "https://github.com/binder-examples/jupyter-stacks-datascience",
"repository_branch": "master",
}

header_config = safe_load(Path("./_data/config-header.yml").read_text())

html_theme_options = {
"path_to_docs": "docs",
"repository_url": "https://github.com/executablebooks/sphinx-book-theme",
"repository_branch": "master",
# "repository_branch": "gh-pages", # For testing
"launch_buttons": {
"binderhub_url": "https://mybinder.org",
"colab_url": "https://colab.research.google.com/",
"deepnote_url": "https://deepnote.com/",
"notebook_interface": "jupyterlab",
"thebe": True,
# "jupyterhub_url": "https://datahub.berkeley.edu", # For testing
},
"launch_buttons": [
{
"type": "binderhub",
"hub_url": "https://mybinder.org",
"notebook_interface": "jupyterlab",
"content": "Launch in Lab",
},
{
"type": "binderhub",
"hub_url": "https://mybinder.org",
"notebook_interface": "classic",
"content": "Launch in Notebook",
},
{
"type": "jupyterhub",
"hub_url": "https://datahub.berkeley.edu",
}, # For testing
{"type": "colab"},
{"type": "deepnote"},
{
"type": "thebe",
"hub_url": "https://mybinder.org",
"repository_url": "https://github.com/binder-examples/jupyter-stacks-datascience", # noqa
"repository_branch": "master",
},
],
"use_edit_page_button": True,
"use_issues_button": True,
"use_repository_button": True,
Expand All @@ -126,6 +144,7 @@
"⚠️The latest release refactored our HTML, "
"so double-check your custom CSS rules!⚠️"
),
"header": header_config,
# For testing
# "use_fullscreen_button": False,
# "home_page_in_toc": True,
Expand Down
Loading