Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

docs: add search and icons to the header (#1183)

Myles Scolnick7204b66a6a13
diff --git a/docs/_static/css/custom.css b/docs/_static/css/custom.css
index 4698ef150d..deb2e70203 100644
--- a/docs/_static/css/custom.css
+++ b/docs/_static/css/custom.css
@@ -112,3 +112,61 @@ details.sd-dropdown .sd-summary-down,
details.sd-dropdown .sd-summary-up {
top: 0.3em;
}
+
+.announcement.announcement {
+ background-color: var(--color-background-primary) !important;
+ overflow-y: hidden;
+ height: fit-content;
+ color: var(--color-content-foreground) !important;
+ border-bottom: 1px solid var(--color-sidebar-search-border);
+}
+
+.announcement-content.announcement-content a {
+ color: var(--color-foreground-secondary) !important;
+ text-decoration: none;
+}
+.announcement-content.announcement-content a:hover {
+ color: var(--color-link-hover) !important;
+}
+
+.announcement .sidebar-search-container {
+ width: 100%;
+ max-width: 500px;
+ margin-top: 0;
+ border-right: 1px solid var(--color-sidebar-search-border);
+ border-left: 1px solid var(--color-sidebar-search-border);
+ border-radius: 6px;
+}
+
+/* Hide as xs */
+@media (max-width: 576px) {
+ .hide-sm {
+ display: none;
+ }
+}
+@media (max-width: 768px) {
+ .hide-md {
+ display: none;
+ }
+}
+
+.px-1 {
+ padding-left: 0.25rem;
+ padding-right: 0.25rem;
+}
+.px-2 {
+ padding-left: 0.5rem;
+ padding-right: 0.5rem;
+}
+.px-4 {
+ padding-left: 1rem;
+ padding-right: 1rem;
+}
+.py-2 {
+ padding-top: 0.5rem;
+ padding-bottom: 0.5rem;
+}
+.py-4 {
+ padding-top: 1rem;
+ padding-bottom: 1rem;
+}
diff --git a/docs/conf.py b/docs/conf.py
index da44185ee9..3e5dbc82d7 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -89,6 +89,21 @@ html_js_files = [
]
html_title = f"{project}"
html_theme_options = {
+ "announcement": """
+ <div class="announcement-body" style="display: flex; justify-content: center; align-items: center;">
+ <div class="hide-md" style="flex: 1;"></div>
+ <form style="flex: 3;" class="sidebar-search-container" method="get" action="../search.html" role="search">
+ <input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
+ <input type="hidden" name="check_keywords" value="yes">
+ <input type="hidden" name="area" value="default">
+ </form>
+ <div style="flex: 1; display: flex; justify-content: flex-end; padding-left: 1rem;">
+ <a target="_blank" href="https://github.com/marimo-team/marimo" class="muted-link fa-brands fa-solid fa-github fa-2x px-2"></a>
+ <a target="_blank" href="https://discord.gg/JE7nhX6mD8" class="muted-link fa-brands fa-solid fa-discord fa-2x px-2"></a>
+ <a target="_blank" href="https://twitter.com/marimo_io" class="muted-link fa-brands fa-solid fa-twitter fa-2x px-2"></a>
+ </div>
+ </div>
+ """,
"sidebar_hide_name": True,
"light_logo": "marimo-logotype-thick.svg",
"dark_logo": "marimo-logotype-thick.svg",
@@ -110,13 +125,19 @@ html_theme_options = {
"name": "GitHub",
"url": "https://github.com/marimo-team/marimo",
"html": "",
- "class": "fa-brands fa-solid fa-github fa-2x",
+ "class": "fa-brands fa-solid fa-github fa-2x px-1",
},
{
"name": "Discord",
"url": "https://discord.gg/JE7nhX6mD8",
"html": "",
- "class": "fa-brands fa-solid fa-discord fa-2x",
+ "class": "fa-brands fa-solid fa-discord fa-2x px-1",
+ },
+ {
+ "name": "Twitter",
+ "url": "https://twitter.com/marimo_io",
+ "html": "",
+ "class": "fa-brands fa-solid fa-twitter fa-2x px-1",
},
],
}
diff --git a/docs/index.md b/docs/index.md
index fa3e6424d5..fb1aa6bc96 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -83,6 +83,15 @@ notebooks_</a>.
community
```
+```{eval-rst}
+.. toctree::
+ :caption: Links
+ :maxdepth: 2
+
+ GitHub <https://github.com/marimo-team/marimo>
+ Discord <https://discord.gg/JE7nhX6mD8>
+```
+
<h3>Index</h3>
```{eval-rst}