---
title: Import from Notion
description: Bring a public Notion page and its subpages into one collection as drafts, with their images, their links and a report of what changed.
section: guides
order: 16
---

# Import from Notion

`hollware import --from notion` reads a Notion page and every page below it, and writes each as a draft of one collection of your Hollware, over MCP. The images go in as assets, and the links between the pages point at their new paths.

## Before you start

- The top page is **shared to the web** in Notion: the import reads public pages, with no Notion account or integration. A page it cannot read stops the import, and names the page.
- The collection exists, with `title`, a field for the section and a field for the order in its schema (`section` and `order` unless you name others).
- A personal token with `content:read` and `content:write`, and `content:publish` for `--publish`.

## Run it

```sh
npx hollware import --from notion --root https://www.notion.so/acme/Handbook-0123456789abcdef0123456789abcdef \
  --collection docs --url https://cms.example.com --token-file ./token.txt --dry-run
```

`--root` takes the address of the top page or its id. `--dry-run` reads everything and validates every page, and writes nothing. Without it, every page is a draft; with `--publish`, the pages are published too. Running it again changes nothing that did not change in Notion.

## What each page becomes

Each page, the top page included, is an entry of the collection. With `--skip-root`, the top page is not: only the pages below it are.

| Frontmatter | What it holds                                                               |
| ----------- | --------------------------------------------------------------------------- |
| `title`     | the title of the page                                                       |
| `section`   | the title of the page below the root that it sits under (`--section-field`) |
| `order`     | its place among its siblings, from 1 (`--order-field`)                      |

The slug comes from the title in ASCII, such as `getting-started`; two pages with one title get `getting-started` and `getting-started-2`. `--slug-map slugs.json`, a JSON object of page id to slug, names the slugs you choose. Every page goes to one locale, `--locale`, `en` unless you say otherwise.

## Sections from headings

A top page often groups its pages under headings rather than under pages: a heading, the links to its pages, then the next heading. `--sections headings` takes the section from there. Each page right below the top page takes the heading above it on the top page as its section, a heading inside a callout or a column too, and the pages below it take the same section. A page with no heading above it gets no section. List the headings in the `groups` of the collection's `navigation`, in their order, and the navigation shows the pages as Notion did.

## Into a nested collection

When the collection is [nested](/docs/nested-entries/), the import keeps the tree of Notion instead of `order`, and writes a section only with `--sections headings`, on the entries at the root. Each page goes under the page it sits under in Notion, the pages right below the top page at the root, next to it, and siblings in the order of Notion. The path of each entry holds the slugs of its ancestors, and links between pages point at it. A page deeper than the collection's `maxDepth` stops the import before anything is written, and names the page: raise the depth, or import a page further down with `--root`.

Running it again moves an entry whose page moved in Notion, and puts siblings back in Notion's order.

## Blocks

| In Notion                                                 | In Markdown                                                                                                                                                                                           |
| --------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Headings 1 to 4                                           | `##` to `#####`                                                                                                                                                                                       |
| Bulleted, numbered and to-do lists, nested                | `-`, `1.`, `- [ ]` and `- [x]`                                                                                                                                                                        |
| Quote                                                     | `>`                                                                                                                                                                                                   |
| Code, with its language                                   | a fenced block                                                                                                                                                                                        |
| Divider                                                   | `---`                                                                                                                                                                                                 |
| Table                                                     | a GFM table; one without a header row gets an empty one                                                                                                                                               |
| Callout                                                   | `::callout{icon="💡" tone="blue"}`, with the icon and color of the callout; with `--callouts alerts`, a GitHub alert by its color (`> [!NOTE]`, `[!TIP]`, `[!WARNING]`, `[!CAUTION]`, `[!IMPORTANT]`) |
| Toggle                                                    | `::details{summary="…"}`; with `--toggles flatten`, a bold line and its content                                                                                                                       |
| Columns and synced blocks                                 | their content, in order                                                                                                                                                                               |
| Video, embed, bookmark, file, PDF, audio and other embeds | `::embed{url="…"}` when the collection declares `embed`, a link otherwise                                                                                                                             |
| Link to a page, mention of a page                         | a link                                                                                                                                                                                                |
| Image                                                     | an asset, below                                                                                                                                                                                       |

Bold, italic, strikethrough, inline code, links and dates are kept. Equations are kept as inline code. Underline, text color, mentions of people, captions of code, tables of contents, breadcrumbs, buttons and databases are dropped.

Before it writes, the import checks that the collection declares every component the pages use: `callout`, `details` or `embed`. It names the ones missing and their fix (declare it, or use `--callouts alerts` or `--toggles flatten`), and writes nothing. The props a component gets must fit its schema too: the validation of each page says so.

## Images

The import downloads each image at once, while Notion's signed address still works, and uploads it to your Hollware as an asset: JPEG, PNG, WebP, AVIF, GIF or SVG, up to 10 MB. Its alt is the caption of the image, or the title of the page and its place in it, such as `Getting started (2)`. A custom emoji is an image too. An image that fails to download is dropped, and the report says why.

## Links

A link to a page of the import points at the route of the collection, such as `/docs/getting-started/`. A link to a Notion page outside the import stays a Notion address. With `--skip-root`, a link to the top page points at the route without a slug, such as `/docs/`. Without a route for the locale, the links stay Notion addresses as well.

## What it leaves behind

```sh
npx hollware import --from notion --root 0123456789abcdef0123456789abcdef --collection docs \
  --url https://cms.example.com --token-file ./token.txt --id-map ids.json --report report.json
```

- `--id-map ids.json` writes, for each Notion page id, the collection, locale and slug of its entry: what a redirect from the old addresses needs.
- `--report report.json` writes, for each page, what it lost or changed on the way: an underline dropped, an image that did not download, a link kept to Notion.

Without `--report`, the import says how many pages have notes.
