diff --git a/.gitignore b/.gitignore index bf6447435dd..ca87ece16e8 100644 --- a/.gitignore +++ b/.gitignore @@ -127,3 +127,6 @@ __marimo__ # pixi environments .pixi *.egg-info + +# mkdocs +site diff --git a/docs/api/inspect.md b/docs/api/inspect.md deleted file mode 100644 index 7018401aafd..00000000000 --- a/docs/api/inspect.md +++ /dev/null @@ -1,21 +0,0 @@ -# Inspect - -Use `mo.inspect()` to explore Python objects with a rich, interactive display of their attributes, methods, and documentation. - -## Example - -```python -import marimo as mo - -# Inspect a class -mo.inspect(list, methods=True) - -# Inspect an instance -my_dict = {"key": "value"} -mo.inspect(my_dict) - -# Show all attributes including private and dunder -mo.inspect(my_dict, all=True) -``` - -::: marimo.inspect \ No newline at end of file diff --git a/docs/api/miscellaneous.md b/docs/api/miscellaneous.md index f5687abe832..adffb45c066 100644 --- a/docs/api/miscellaneous.md +++ b/docs/api/miscellaneous.md @@ -9,3 +9,25 @@ ::: marimo.notebook_dir ::: marimo.notebook_location + +## Inspect + +Use `mo.inspect()` to explore Python objects with a rich, interactive display of their attributes, methods, and documentation. + +### Example + +```python +import marimo as mo + +# Inspect a class +mo.inspect(list, methods=True) + +# Inspect an instance +my_dict = {"key": "value"} +mo.inspect(my_dict) + +# Show all attributes including private and dunder +mo.inspect(my_dict, all=True) +``` + +::: marimo.inspect diff --git a/docs/guides/configuration/runtime_configuration.md b/docs/guides/configuration/runtime_configuration.md index b5074c7726b..d16590ba776 100644 --- a/docs/guides/configuration/runtime_configuration.md +++ b/docs/guides/configuration/runtime_configuration.md @@ -5,7 +5,7 @@ cells. -## Disable autorun on startup +## Disable autorun on startup { #on-startup } By default, marimo notebooks run automatically on startup; just how the command diff --git a/docs/guides/deploying/scheduled.md b/docs/guides/deploying/scheduled.md index bf968581222..6bef5417b5b 100644 --- a/docs/guides/deploying/scheduled.md +++ b/docs/guides/deploying/scheduled.md @@ -4,7 +4,7 @@ marimo notebooks are stored as Python files, so any system that can schedule a P ## Github Actions -As an alternative to using [cron](https://en.wikipedia.org/wiki/Cron) directly, you might be interested in running scheduled marimo notebooks as part of your [Github actions](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#schedule) workflow. You can use the code below as a starting point. Note that this example assumes you're using [inline dependencies](guides/package_management/inlining_dependencies). +As an alternative to using [cron](https://en.wikipedia.org/wiki/Cron) directly, you might be interested in running scheduled marimo notebooks as part of your [Github actions](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#schedule) workflow. You can use the code below as a starting point. Note that this example assumes you're using [inline dependencies](../package_management/inlining_dependencies.md). ```yaml name: Run marimo notebook every day at 09:00 @@ -16,21 +16,21 @@ jobs: jobs: run-marimo: runs-on: ubuntu-latest - + steps: - name: Checkout repository uses: actions/checkout@v4 - + - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.11' - + - name: Install uv uses: astral-sh/setup-uv@v6 with: version: "latest" - + - name: Use uv to run notebook as normal script run: | uv run path/to/marimo_notebook.py @@ -38,8 +38,8 @@ jobs: ## Alternatives -For tools like Airflow and Prefect, you can also choose to reuse parts of a marimo notebook in larger Python batch jobs. Check the [docs on reusing functions](https://docs.marimo.io/guides/reusing_functions/) if you're interested in that. +For tools like Airflow and Prefect, you can also choose to reuse parts of a marimo notebook in larger Python batch jobs. Check the [docs on reusing functions](https://docs.marimo.io/guides/reusing_functions/) if you're interested in that. Alternatively, you may be interested in having specific cells in marimo run on an automated schedule as you have the notebook open. The simplest way to do that is to use the [mo.ui.refresh](https://docs.marimo.io/api/inputs/refresh/#marimo.ui.refresh) widget to manually specify how often a cell needs to rerun. -Finally, if you have very custom needs, you can always use third party Python libraries (like [schedule](https://schedule.readthedocs.io/en/stable/index.html)) to set up something bespoke from your own code. \ No newline at end of file +Finally, if you have very custom needs, you can always use third party Python libraries (like [schedule](https://schedule.readthedocs.io/en/stable/index.html)) to set up something bespoke from your own code. diff --git a/docs/guides/generate_with_ai/prompts.md b/docs/guides/generate_with_ai/prompts.md index 183c30af4eb..19f0663c2bb 100644 --- a/docs/guides/generate_with_ai/prompts.md +++ b/docs/guides/generate_with_ai/prompts.md @@ -1,10 +1,10 @@ -marimo offers many tools for [AI assisted coding](/guides/editor_features/ai_completion/). However, sometimes you may want to do something more custom and could benefit from a prompt template to get started from. The goal of this page is to share prompts that have proven to be useful and will help you get started on specific tasks. +marimo offers many tools for [AI assisted coding](../editor_features/ai_completion.md). However, sometimes you may want to do something more custom and could benefit from a prompt template to get started from. The goal of this page is to share prompts that have proven to be useful and will help you get started on specific tasks. -You can add these prompts to your [custom rules](/guides/editor_features/ai_completion/?h=#custom-rules) but be mindful that doing so will make every call to the LLM more expensive because you're feeding it more tokens. That's why we generally recommend to start your conversations with these snippets if you don't plan on using them very often. +You can add these prompts to your [custom rules](../editor_features/ai_completion.md#custom-rules) but be mindful that doing so will make every call to the LLM more expensive because you're feeding it more tokens. That's why we generally recommend to start your conversations with these snippets if you don't plan on using them very often. ## CLAUDE.md -You can run [claude code](https://www.anthropic.com/claude-code) in the terminal and ask it to edit a marimo notebook on your behalf. Make sure that you run your notebook with the [watch flag](/api/watch) turned on, like `marimo edit --watch notebook.py`, to see updates appear live whenever claude makes a change. +You can run [claude code](https://www.anthropic.com/claude-code) in the terminal and ask it to edit a marimo notebook on your behalf. Make sure that you run your notebook with the [watch flag](../..//api/watch.md) turned on, like `marimo edit --watch notebook.py`, to see updates appear live whenever claude makes a change. To help claude code, you might want to take the snippet below as starting context for your `CLAUDE.md` file. This snippet should be seen as a starting point and we recommend adding extra context yourself. Things like "prefer polars over pandas" to indicate your preferred libraries and tools. @@ -22,7 +22,7 @@ curl https://docs.marimo.io/CLAUDE.md > CLAUDE.md ## Anywidget -If you want to generate [custom UIs or widgets for marimo](/api/inputs/anywidget/?h=anywidget#building-custom-ui-elements) then anywidget is the way to go. Because anywidget is a fairly revent project, LLMs have been known to hallucinate when you try to generate custom widgets from scratch. The following prompt contains an example that helps prevent this behaviour and it also points out common failure scenarios that the LLM should avoid. +If you want to generate [custom UIs or widgets for marimo](../../api/inputs/anywidget.md?#building-custom-ui-elements) then anywidget is the way to go. Because anywidget is a fairly revent project, LLMs have been known to hallucinate when you try to generate custom widgets from scratch. The following prompt contains an example that helps prevent this behaviour and it also points out common failure scenarios that the LLM should avoid. ``` When writing an anywidget use vanilla javascript in `_esm` and do not forget about `_css`. The css should look bespoke in light mode and dark mode. Keep the css small unless explicitly asked to go the extra mile. When you display the widget it must be wrapped via `widget = mo.ui.anywidget(OriginalAnywidget())`. diff --git a/marimo/_plugins/stateless/inspect.py b/marimo/_plugins/stateless/inspect.py index 51219f5748f..ed9b06a7b8c 100644 --- a/marimo/_plugins/stateless/inspect.py +++ b/marimo/_plugins/stateless/inspect.py @@ -27,7 +27,7 @@ class inspect(Html): value: Show the object's value/repr. Returns: - An `Html` object. + (Html): An `Html` object. Example: ```python diff --git a/mkdocs.yml b/mkdocs.yml index 4b6b7633bb8..2ceade6f653 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -93,6 +93,7 @@ nav: - Import star: guides/understanding_errors/import_star.md - Cycles: guides/understanding_errors/cycles.md - Setup References: guides/understanding_errors/setup.md + - Debugging notebooks: guides/debugging.md - Lint Rules: - Lint Rules: guides/lint_rules/index.md - Rules: @@ -204,6 +205,7 @@ nav: - Chat: api/inputs/chat.md - Checkbox: api/inputs/checkbox.md - Code Editor: api/inputs/code_editor.md + - Data Editor: api/inputs/data_editor.md - Data Explorer: api/inputs/data_explorer.md - DataFrame: api/inputs/dataframe.md - Dates: api/inputs/dates.md @@ -239,8 +241,8 @@ nav: - Plain: api/layouts/plain.md - Routes: api/layouts/routes.md - Sidebar: api/layouts/sidebar.md - - Stat: api/layouts/stat.md - Stacks: api/layouts/stacks.md + - Stat: api/layouts/stat.md - Tree: api/layouts/tree.md - Plotting: api/plotting.md - Media: @@ -248,6 +250,7 @@ nav: - Audio: api/media/audio.md - Download: api/media/download.md - Image: api/media/image.md + - Image Compare: api/media/image_compare.md - PDF: api/media/pdf.md - Plain Text: api/media/plain_text.md - Video: api/media/video.md @@ -261,6 +264,7 @@ nav: - State: api/state.md - App: api/app.md - Cell: api/cell.md + - Watch: api/watch.md - Miscellaneous: api/miscellaneous.md - Commands: cli.md - FAQ: faq.md @@ -379,3 +383,6 @@ theme: toggle: icon: material/brightness-4 name: Switch to system preference + +exclude_docs: | + apps/README.md diff --git a/pyproject.toml b/pyproject.toml index e7779ac7508..705a86dc27a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -125,26 +125,6 @@ mcp = [ "pydantic>2; python_version >= '3.10'", ] - -docs = [ - "mkdocs>=1.6.1", - "mkdocs-material>=9.5.49", - "mkdocstrings[python]>=0.27.0", - "mkdocs-material-extensions>=1.3.1", - "mkdocs-autorefs>=1.2.0", - "mkdocs-git-revision-date-localized-plugin>=1.3.0", - "mkdocs-minify-plugin>=0.8.0", - "mkdocs-glightbox>=0.4.0", - "mkdocs-macros-plugin>=1.3.7", - "mkdocs-redirects>=1.2.2", - "mkdocs-click>=0.8.1", - "mike>=2.0.0", # for versioning - "pillow>=10.2.0,!=11.3.0", # for social cards, 11.3.0 doesn't have manylinux wheels - "cairosvg>=2.7.1", # for social cards - "mdx-include>=1.4.2", - "pymdown-extensions>=10.7", -] - [tool.hatch] installer = "uv" @@ -304,10 +284,25 @@ extra-dependencies = [ python = ["3.9", "3.10", "3.11", "3.12", "3.13"] [tool.hatch.envs.docs] -features = ["docs"] dependencies = [ "marimo_docs @ file://docs", "ruff>=0.13.1", + "mkdocs>=1.6.1", + "mkdocs-material>=9.5.49", + "mkdocstrings[python]>=0.27.0", + "mkdocs-material-extensions>=1.3.1", + "mkdocs-autorefs>=1.2.0", + "mkdocs-git-revision-date-localized-plugin>=1.3.0", + "mkdocs-minify-plugin>=0.8.0", + "mkdocs-glightbox>=0.4.0", + "mkdocs-macros-plugin>=1.3.7", + "mkdocs-redirects>=1.2.2", + "mkdocs-click>=0.8.1", + "mike>=2.0.0", # for versioning + "pillow>=10.2.0,!=11.3.0", # for social cards, 11.3.0 doesn't have manylinux wheels + "cairosvg>=2.7.1", # for social cards + "mdx-include>=1.4.2", + "pymdown-extensions>=10.7", ] [tool.uv.sources]