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: remove old files (#3228)

Myles Scolnick57a6fe0ce084
diff --git a/docs/__init__.py b/docs/__init__.py
index 6f3288e1b9..e738d2041e 100644
--- a/docs/__init__.py
+++ b/docs/__init__.py
@@ -1,6 +1,5 @@
-"""Marimo documentation package."""
+"""marimo documentation package."""
-from . import macros # noqa: F401
-from . import blocks # noqa: F401
+from . import blocks
-__all__ = ["macros", "blocks"]
+__all__ = ["blocks"]
diff --git a/docs/_static/css/custom.css b/docs/_static/css/custom.css
deleted file mode 100644
index 0e95e6c0f1..0000000000
--- a/docs/_static/css/custom.css
+++ /dev/null
@@ -1,195 +0,0 @@
-@font-face {
- font-family: 'CalSans';
- src: url('../CalSans-SemiBold.woff');
-}
-
-body .page {
- --api-font-size: var(--font-size--normal) !important;
-}
-
-/* Slightly wider than default for our WASM examples. */
-.content {
- width: 48em;
-}
-
-.sidebar-brand-text {
- font-family: 'CalSans';
- color: #1c7362;
- font-weight: 600;
- font-size: 1.85rem;
- line-height: 1.5rem;
-}
-
-body {
- color-scheme: light;
-}
-body[data-theme='dark'] {
- color-scheme: dark;
-}
-
-h1,
-h2 {
- font-family: 'CalSans';
- letter-spacing: 0.025em;
-}
-
-[data-theme='dark'] .sidebar-brand-text {
- color: #fff;
-}
-
-iframe.demo {
- width: 100%;
- height: 250px;
- border: 1px solid var(--color-background-border);
- border-radius: 5px;
-}
-
-.autosummary > table {
- width: 98%;
-}
-
-iframe.demo.medium {
- height: 400px;
-}
-
-iframe.demo.large {
- height: 600px;
-}
-
-iframe.demo.xlarge {
- height: 900px;
-}
-
-iframe.demo.xxlarge {
- height: 1200px;
-}
-
-.highlight {
- border-radius: 0.4rem;
-}
-
-/* Better formatting of signatures from https://github.com/sphinx-doc/sphinx/issues/1514#issuecomment-742703082 */
-/* Newlines (\a) and spaces (\20) before each parameter */
-.sig-param::before {
- content: '\a\20\20';
- white-space: pre;
-}
-
-/* Newline after the last parameter (so the closing bracket is on a new line) */
-dt em.sig-param:last-of-type::after {
- content: '\a';
- white-space: pre;
-}
-
-.sig-param,
-.sig-return-typehint {
- font-size: 0.875rem;
-}
-
-.sidebar-logo-container {
- height: 150px;
-}
-
-figcaption {
- font-size: 0.875rem;
- color: gray;
-}
-
-[data-theme='dark'] figcaption {
- color: var(--color-content-foreground);
-}
-
-figure img {
- border: 1px solid #ebebeb;
- border-radius: 5px;
-}
-
-blockquote {
- border-left-color: #1c7362;
-}
-
-details.sd-dropdown summary {
- padding-top: 0.25em;
- padding-bottom: 0.25em;
-}
-
-details.sd-dropdown:not([open]) > .sd-card-header {
- /* make border more visible */
- border: 1px solid #d7d7d7;
-}
-
-details.sd-dropdown .sd-summary-title {
- font-weight: normal;
-}
-
-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-radius: 6px;
-}
-
-.announcement .sidebar-search {
- 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;
-}
-
-/* Hide Furo warning about unrelated duplicate table of contents error */
-.marimo .contents::before {
- display: none !important;
-}
diff --git a/docs/assets/vscode-marimo.png b/docs/assets/vscode-marimo.png
deleted file mode 100644
index 35d5a6368d..0000000000
Binary files a/docs/assets/vscode-marimo.png and /dev/null differ
diff --git a/docs/conf.py b/docs/conf.py
deleted file mode 100644
index 7ae623d393..0000000000
--- a/docs/conf.py
+++ /dev/null
@@ -1,153 +0,0 @@
-# Configuration file for the Sphinx documentation builder.
-#
-# For the full list of built-in configuration values, see the documentation:
-# https://www.sphinx-doc.org/en/master/usage/configuration.html
-
-# -- Project information -----------------------------------------------------
-# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
-
-import datetime
-import os
-import sys
-
-# If modules to document with autodoc (or sphinx extensions) are in another
-# directory, add these directories to sys.path here. If the directory is
-# relative to the documentation root, use os.path.abspath to make it absolute,
-# like shown here.
-#
-# To import marimo:
-sys.path.insert(0, os.path.abspath(".."))
-# To import helpers
-sys.path.insert(0, os.path.abspath("."))
-
-from helpers.md2rst import md2rst
-from helpers.sections import PublicMethods
-from helpers.marimo_embed import MarimoEmbed
-from helpers.copy_readme import ReadmePartDirective
-
-import marimo
-
-project = "marimo"
-copyright = f"{datetime.datetime.now().year}, marimo-team"
-author = "marimo-team"
-release = marimo.__version__
-
-# -- General configuration ---------------------------------------------------
-# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
-
-extensions = [
- # Write source in markdown, not rst
- "myst_parser",
- # For API docs
- "sphinx.ext.autodoc",
- "sphinx.ext.autosummary",
- "sphinx_copybutton",
- "sphinx_new_tab_link",
- "sphinx_sitemap",
- # To generate tables of inherited members
- "autoclasstoc",
- "sphinx_design",
-]
-
-myst_enable_extensions = [
- "colon_fence",
-]
-
-
-autoclasstoc_sections = [
- PublicMethods.key,
- "public-attrs",
-]
-
-# Group symbols by the order they appear in source
-autodoc_member_order = "bysource"
-
-templates_path = ["_templates"]
-exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
-
-
-# -- Options for HTML output -------------------------------------------------
-# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
-
-html_theme = "furo"
-html_static_path = ["_static"]
-html_favicon = "_static/favicon-32x32.png"
-html_baseurl = "https://docs.marimo.io/"
-html_css_files = [
- # Font Awesome
- "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/fontawesome.min.css",
- "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/solid.min.css",
- "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/brands.min.css",
- # Inter font
- "https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=block",
- # Fira Mono font
- "https://fonts.googleapis.com/css2?family=Fira+Mono&display=block",
- "css/custom.css",
-]
-html_js_files = [
- "js/analytics.js",
-]
-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://marimo.io/discord?ref=docs" 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",
- # Show edit on github button
- "source_repository": "https://github.com/marimo-team/marimo",
- "source_branch": "main",
- "source_directory": "docs/",
- "light_css_variables": {
- "color-sidebar-background": "var(--color-background-primary)",
- "color-sidebar-search-background": "var(--color-background-primary)",
- "font-stack": "Inter, sans-serif",
- "font-stack--monospace": "Fira Mono",
- "code-font-size": "0.875rem",
- },
- "footer_icons": [
- {
- "name": "GitHub",
- "url": "https://github.com/marimo-team/marimo",
- "html": "",
- "class": "fa-brands fa-solid fa-github fa-2x px-1",
- },
- {
- "name": "Discord",
- "url": "https://marimo.io/discord?ref=docs",
- "html": "",
- "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",
- },
- ],
-}
-
-pygments_style = "monokai"
-pygments_dark_style = "monokai"
-
-
-# -- Hooks -------------------------------------------------------------------
-# https://www.sphinx-doc.org/en/master/extdev/appapi.html#events
-def setup(app):
- # https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#docstring-preprocessing
- app.connect("autodoc-process-docstring", md2rst)
- app.add_directive("readmepart", ReadmePartDirective)
- app.add_directive("marimo-embed", MarimoEmbed)
diff --git a/docs/getting_started/quickstart.md b/docs/getting_started/quickstart.md
index aaaab93720..c7a5be2435 100644
--- a/docs/getting_started/quickstart.md
+++ b/docs/getting_started/quickstart.md
@@ -59,7 +59,7 @@ Then open the notebook with `marimo edit your_notebook.py`
2. If no config file exists, create it at `~/.marimo.toml` or `$XDG_CONFIG_HOME/marimo/marimo.toml`.
3. Update your config to include the following:
- ```toml
+ ```toml title="marimo.toml"
[runtime]
auto_instantiate = false
```
diff --git a/docs/guides/configuration/index.md b/docs/guides/configuration/index.md
index fde2f862bc..cdea8c0aca 100644
--- a/docs/guides/configuration/index.md
+++ b/docs/guides/configuration/index.md
@@ -77,7 +77,7 @@ notebooks. You must edit the `pyproject.toml` file directly to override settings
For example, the following `pyproject.toml` file overrides the `autosave` setting
in the user configuration:
-```toml
+```toml title="pyproject.toml"
[tool.marimo.format]
line_length = 120
diff --git a/docs/guides/editor_features/ai_completion.md b/docs/guides/editor_features/ai_completion.md
index 414322a20b..75fd780117 100644
--- a/docs/guides/editor_features/ai_completion.md
+++ b/docs/guides/editor_features/ai_completion.md
@@ -30,7 +30,7 @@ _Get started with Copilot_:
6. This action will log a new API request in the **Network** tab. Click on "Preview" to get the API key.
7. Paste the API key in the marimo settings in the UI, or add it to your `marimo.toml` file as follows:
-```toml
+```toml title="marimo.toml"
[completion]
copilot = "codeium"
codeium_api_key = ""
@@ -63,7 +63,7 @@ codeium_api_key = ""
8. Copy the value of the `apiKey` to `.marimo.toml` in your home directory
-```toml
+```toml title="marimo.toml"
[completion]
codeium_api_key = "a1e8..." # <-- paste your API key here
copilot = "codeium"
@@ -135,7 +135,7 @@ Below we describe how to connect marimo to your AI provider. Once enabled, you c
2. Add the following to your `marimo.toml`:
-```toml
+```toml title="marimo.toml"
[ai.open_ai]
# Get your API key from https://platform.openai.com/account/api-keys
api_key = "sk-proj-..."
@@ -155,7 +155,7 @@ To use Anthropic with marimo:
1. Sign up for an account at [Anthropic](https://console.anthropic.com/) and grab your [Anthropic Key](https://console.anthropic.com/settings/keys).
2. Add the following to your `marimo.toml`:
-```toml
+```toml title="marimo.toml"
[ai.open_ai]
model = "claude-3-5-sonnet-20240620"
# or any model from https://docs.anthropic.com/en/docs/about-claude/models
@@ -172,7 +172,7 @@ To use Google AI with marimo:
2. Install the Google AI Python client: `pip install google-generativeai`
3. Add the following to your `marimo.toml`:
-```toml
+```toml title="marimo.toml"
[ai.open_ai]
model = "gemini-1.5-flash"
# or any model from https://ai.google.dev/gemini-api/docs/models/gemini
@@ -217,7 +217,7 @@ Ollama allows you to run open-source LLMs on your local machine. To integrate Ol
6. Add the following to your `marimo.toml`:
-```toml
+```toml title="marimo.toml"
[ai.open_ai]
api_key = "ollama" # This is not used, but required
model = "codellama" # or another model from `ollama ls`
diff --git a/docs/guides/troubleshooting.md b/docs/guides/troubleshooting.md
index b9cbc99bde..7b2d8630bf 100644
--- a/docs/guides/troubleshooting.md
+++ b/docs/guides/troubleshooting.md
@@ -118,7 +118,7 @@ If you are using `bazel` or `uv`'s [**link-mode: symlink**](https://docs.astral.
Locate your `marimo.toml` configuration file with `marimo config show`, and edit the `follow_symlink` flag:
-```toml
+```toml title="marimo.toml"
[server]
follow_symlink = true
```
diff --git a/docs/helpers/__init__.py b/docs/helpers/__init__.py
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/docs/helpers/copy_readme.py b/docs/helpers/copy_readme.py
deleted file mode 100644
index 916854e74b..0000000000
--- a/docs/helpers/copy_readme.py
+++ /dev/null
@@ -1,48 +0,0 @@
-from docutils.parsers.rst import Directive
-import re
-import os
-from myst_parser.docutils_ import Parser
-
-
-class ReadmePartDirective(Directive):
- required_arguments = 1
- optional_arguments = 0
- final_argument_whitespace = True
- has_content = False
-
- def run(self):
- header = self.arguments[0]
-
- # Read and parse the README.md file
- current_dir = os.path.dirname(os.path.realpath(__file__))
- readme = os.path.join(current_dir, "..", "..", "README.md")
- with open(readme, "r") as file:
- content = file.read()
-
- # Find the header
- header_pattern = r"#{1,6} " + re.escape(header)
- match = re.search(header_pattern, content, re.IGNORECASE)
- if not match:
- return []
- level = match.group(0).count("#")
- next_header_with_same_level = r"\n#{" + str(level) + r"} "
- next_match = re.search(
- next_header_with_same_level, content[match.end() :], re.IGNORECASE
- )
-
- stripped_content = ""
- if match:
- # Extract everything below the header, up to the next header
- if next_match and next_match.group(0):
- stripped_content = content[
- match.end() : match.end() + next_match.start()
- ].strip()
- else:
- stripped_content = content[match.end() :].strip()
-
- # Update asset links, add a leading slash if needed
- stripped_content = re.sub(
- r"https.*?docs/_static", "/_static", stripped_content
- )
- Parser().parse(stripped_content, self.state.document)
- return []
diff --git a/docs/helpers/marimo_embed.py b/docs/helpers/marimo_embed.py
deleted file mode 100644
index 3f83c66222..0000000000
--- a/docs/helpers/marimo_embed.py
+++ /dev/null
@@ -1,59 +0,0 @@
-from docutils.parsers.rst import Directive
-from docutils import nodes
-import urllib.parse
-
-
-def uri_encode_component(code: str) -> str:
- return urllib.parse.quote(code, safe="~()*!.'")
-
-
-class MarimoEmbed(Directive):
- required_arguments = 0
- optional_arguments = 0
- final_argument_whitespace = True
- has_content = True
- option_spec = {
- # default, medium, large
- "size": str,
- # read, edit
- "mode": str,
- # normal, full
- "app_width": str,
- }
-
- def run(self):
- # Configs
- size = self.options.get("size", "default")
- mode = self.options.get("mode", "read")
- app_width = self.options.get("app_width", "normal")
-
- header = "\n".join(
- [
- "import marimo",
- f'app = marimo.App(width="{app_width}")',
- "",
- ]
- )
- footer = "\n".join(
- [
- "",
- "@app.cell",
- "def __():",
- " import marimo as mo",
- " return",
- ]
- )
- body = header + "\n".join(self.content) + footer
- encoded_code = uri_encode_component(body)
-
- # Create an iframe of the app
- html = f"""
- <iframe
- class="demo {size}"
- src="https://marimo.app/?code={encoded_code}&embed=true&mode={mode}"
- allow="camera; geolocation; microphone; fullscreen; autoplay; encrypted-media; picture-in-picture; clipboard-read; clipboard-write"
- width="100%"
- frameBorder="0"
- ></iframe>
- """
- return [nodes.raw("", html, format="html")]
diff --git a/docs/helpers/md2rst.py b/docs/helpers/md2rst.py
deleted file mode 100644
index b08d9d03c2..0000000000
--- a/docs/helpers/md2rst.py
+++ /dev/null
@@ -1,13 +0,0 @@
-import pypandoc
-
-
-# Convert markdown docstrings to RST.
-#
-# LaTeX written with single or double $ is supported, but not with \[ \],
-# as per Pandoc Markdown syntax.
-def md2rst(app, what, name, obj, options, lines):
- del app, what, name, obj, options
- md = "\n".join(lines)
- rst = pypandoc.convert_text(source=md, format="md", to="rst")
- lines.clear()
- lines += rst.splitlines()
diff --git a/docs/helpers/sections.py b/docs/helpers/sections.py
deleted file mode 100644
index 9fe0a99f05..0000000000
--- a/docs/helpers/sections.py
+++ /dev/null
@@ -1,10 +0,0 @@
-from autoclasstoc import Section, is_method
-
-
-class PublicMethods(Section):
- key = "public-methods-no-dunder"
- title = "Public methods"
-
- def predicate(self, name, attr, meta):
- del meta
- return is_method(name, attr) and not name.startswith("_")
diff --git a/docs/make.bat b/docs/make.bat
deleted file mode 100644
index 32bb24529f..0000000000
--- a/docs/make.bat
+++ /dev/null
@@ -1,35 +0,0 @@
-@ECHO OFF
-
-pushd %~dp0
-
-REM Command file for Sphinx documentation
-
-if "%SPHINXBUILD%" == "" (
- set SPHINXBUILD=sphinx-build
-)
-set SOURCEDIR=.
-set BUILDDIR=_build
-
-%SPHINXBUILD% >NUL 2>NUL
-if errorlevel 9009 (
- echo.
- echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
- echo.installed, then set the SPHINXBUILD environment variable to point
- echo.to the full path of the 'sphinx-build' executable. Alternatively you
- echo.may add the Sphinx directory to PATH.
- echo.
- echo.If you don't have Sphinx installed, grab it from
- echo.https://www.sphinx-doc.org/
- exit /b 1
-)
-
-if "%1" == "" goto help
-
-%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
-goto end
-
-:help
-%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
-
-:end
-popd
diff --git a/docs/vercel.json b/docs/vercel.json
index 98753b3d22..a002941d50 100644
--- a/docs/vercel.json
+++ b/docs/vercel.json
@@ -629,6 +629,11 @@
"source": "/recipes.html",
"destination": "/recipes",
"permanent": true
+ },
+ {
+ "source": "/:path*.html",
+ "destination": "/:path*",
+ "permanent": true
}
]
}
diff --git a/mkdocs.yml b/mkdocs.yml
index 2daa40c574..50d148878f 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -24,6 +24,8 @@ extra:
link: https://pypi.org/project/marimo/
extra_css:
- stylesheets/extra.css
+extra_javascript:
+ - js/analytics.js
markdown_extensions:
- admonition
- attr_list