Notion Markdown



Any non-database Notion page can be exported as a Markdown file. Here's how:

Notion.so Markdown Importer An importer for Markdown files to Notion.so using notion-py It provides these features over Notion.so's Markdown importer: Picking a Notion.so page to upload to (instead of them all uploading to the root). The compatibility of Notion is very good, the tool has versions for Web, mobile devices and also for Desktop. With the online version it is possible to work with document synchronization. When we talk about Markdown support in Notion, things get a little more complicated. This video is about how to Markdown inside of Notion. If you like this video, please hit the 'Like' button and if you want to see more of my videos on produc. Exporting Notion in Markdown & CSV format When you export using the Markdown & CSV option, all of your pages will be exported in markdown while your databases/tables will be exported as CSV files. Once you have pressed the “ Export all workspace content ” button, select “ Markdown & CSV ” and click “. Critically, Notion supports import of markdown files. My importing led to a few glitches with complex files — ones with complicated markdown, or hundreds of links, for example — but was about 90%.

  • Click on the ••• icon at the top right of any Notion page you want to export.
  • Click Export. A window will pop up at the center of your screen asking what format you want to download and whether to include sub-pages.
  • Choose Markdown & CSV from the dropdown. Switch on Include subpages if you want to download pages contained within the page as separate files.
  • Click Export to automatically download a zip file containing a Markdown version of your Notion page(s). You can open these files as plain text with Markdown syntax. It'll look something like this when you open it with an app like TextEdit or Notepad:
  • Tap the ••• icon at the upper right of your screen.
  • Scroll down and tap Export.
  • Choose Markdown & CSV from the menu labeled Export format.
  • Tap Export and the share menu on your device will pop up, from which:
    • You can send the file to a nearby computer via AirDrop on Mac.
    • You can copy and paste the download link into your mobile browser to start the download.
    • You can paste the download link into your notes for later.
  • You'll also receive an email from Notion with a link to download the file.
  • ••• menu. What's the deal?
    Export might be turned off for your workspace. Admins can turn off this option in the Security & SAML tab of Settings & Members to keep workspace data internal.
  • If a file is very large (depending on the number of sub-pages included), we may send you an email with a download link rather than automatically starting a download. This is not always the case. No email will be sent if you were able to download the file right away.
Something we didn't cover?Message us in the app by clicking ? at the bottom right on desktop (or in your sidebar on mobile). Or email us at team@makenotion.com ✌️
Latest version

Released:

Utilities for importing Markdown files to Notion.so

Project description

An importer for Markdown files to Notion.so using notion-py

It provides these features over Notion.so's Markdown importer:

  • Picking a Notion.so page to upload to (instead of them all uploading to the root)
  • Code fences keep their original language (or as close as we can match it)
  • Code fences are formatted properly
  • Inline HTML is preserved
  • (Optionally) Upload images that are memtioned in the HTML <img> tags.
  • Markdown frontmatter is preserved
  • Local image references will be uploaded from relative URLs
  • Image alts are loaded as captions instead of as TextBlocks
  • Handles nested lists properly
  • Among other improvements...

Supports Python 3.6+

Usage from CLI

  • pip install md2notion
  • Then run like python -m md2notion [token_v2] [page-url] [...markdown_path_glob_or_url]
  • The markdown at the given path will be added as a new child to the Notion.so note at page-url

There are also some configuration options:

  • --clear-previous: If a child of the note at page-url has the same name as what you're uploading, it will first be removed.
  • --append: Instead of making a new child, it will append the markdown contents to the note at page-url
  • --html-img: Upload images that are memtioned in the HTML <img> tags.

Usage from script

  • pip install md2notion
  • In your Python file:

If you need to process notion-py block descriptors after parsing from Markdown but before uploading, consider using convert and uploadBlock separately. Take a look at upload.py#upload() for more.

If you need to parse Markdown differently from the default, consider subclassing NotionPyRenderer (a BaseRenderer for mistletoe). You can then pass it to upload(..., notionPyRendererCls=NotionPyRenderer) as a parameter.

Example, Custom Hexo Importer

Here's an example that imports a Hexo blog (slghtly hacky).

Contributing

See CONTRIBUTING.md

Release historyRelease notifications | RSS feed

2.4.1

2.3.1

2.2.1

2.1.1

2.0.1

2.0.0

1.2.1

1.1.0

1.0.1

1.0.0

App

0.1.2

0.1.1

0.1.0

0.0.4

Notion Markdown

0.0.3

0.0.2

0.0.1

Download files

Notion Markdown Github

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for md2notion, version 2.4.1
Filename, sizeFile typePython versionUpload dateHashes
Filename, size md2notion-2.4.1-py3-none-any.whl (12.8 kB) File type Wheel Python version py3 Upload dateHashes
Filename, size md2notion-2.4.1.tar.gz (13.3 kB) File type Source Python version None Upload dateHashes
Close

Hashes for md2notion-2.4.1-py3-none-any.whl

Hashes for md2notion-2.4.1-py3-none-any.whl
AlgorithmHash digest
SHA256accab0edb3ae05bbc08750bc2f1f2f3e358669c8490b4817f7a8afdcf56d4c3e
MD52f57ffeb6eea213770783d93d0098d36
BLAKE2-256ff52e586d3ea9270b2c43fc3f0077d4c882515626839b441ebe35a04081aa059
Close

Hashes for md2notion-2.4.1.tar.gz

Hashes for md2notion-2.4.1.tar.gz
AlgorithmHash digest
SHA25654e8c438ff1cf1db5980b82910c6bf1807f02b874d38efae060fb2cfd4d3d62c
MD5e49a5b880cc109cc765ec52c168e5b98
BLAKE2-2566b55d697e4f0009cf8538e7129531138eab93050ffe8287f6476bce28479b9ad