> For the complete documentation index, see [llms.txt](https://docs.vale.sh/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.vale.sh/formats/jupyter.md).

# Jupyter

Learn how Vale handles Jupyter notebooks.

{% hint style="info" %}
Requires Vale v3.21.0 or later. Earlier versions can read the Markdown cells with a [View](/topics/views.md#data) instead.
{% endhint %}

A [Jupyter](https://jupyter.org/) notebook is a JSON file of cells. Vale reads it cell by cell, in order:

* A Markdown cell is linted as [Markdown](/formats/markdown.md).
* A code cell is linted as [code](/formats/code.md) in the kernel's language, so its comments are the prose. A cell that opens with the `%%markdown` (or `%%md`) magic is prose instead.
* Raw cells and cell outputs are skipped.

The supported extension is `.ipynb`:

```ini
[*.ipynb]
BasedOnStyles = Vale
```

An alert's line and column are those of the `.ipynb` file itself: the position of the text inside the JSON string that holds it.

## [Code cells](#code-cells)

The kernel's language comes from the notebook's `kernelspec`, then from its `language_info`. A cell that names its own language, as VS Code does in the cell's metadata, is linted as that language instead.

| Kernel language                | Linted as  |
| ------------------------------ | ---------- |
| `python`, `python3`, `ipython` | Python     |
| `r`                            | R          |
| `julia`                        | Julia      |
| `javascript`                   | JavaScript |
| `typescript`                   | TypeScript |
| `rust`                         | Rust       |
| `go`                           | Go         |
| `c`, `c++`, `cpp`              | C++        |
| `java`                         | Java       |
| `ruby`                         | Ruby       |
| `lua`                          | Lua        |
| `php`                          | PHP        |
| `haskell`                      | Haskell    |
| `elixir`                       | Elixir     |
| `clojure`                      | Clojure    |
| `perl`                         | Perl       |
| `csharp`, `c#`                 | C#         |
| `scala`                        | Scala      |
| `powershell`                   | PowerShell |

A comment carries the same scopes it would in a source file, `text.comment.line.py` for a one-line Python comment, so a rule can target notebook code by language. Code cells in a language that is not listed, a Bash kernel for one, are skipped.

## [Older notebooks](#older-notebooks)

Notebooks with `nbformat` 3 are read too: cells are found in each worksheet, a heading cell is read as a Markdown heading of its level, and a code cell's `language` field names its language.

## [Views](#views)

A [View](/topics/views.md) on the section takes precedence over the built-in reading, for anyone who wants a different one: only the Markdown cells, say, or the strings in a cell's outputs.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.vale.sh/formats/jupyter.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
