Import markdown files to Notion.so using its official API.
Requirments: Python >= 3.7.
- All markdown basic syntax.
- Some markdown extended syntax:
- Tables.
- Code blocks.
- Footnotes.
- Definition lists.
- Strikethrough.
- Task lists.
- Automatic URL Linking.
- Firstly, follow the instruction to create an notion integration and share a page with the integration.
- Run the Python script:
python main.py import-notion --token={{YOUR NOTION TOKEN}} --parent_page_id={{PAGE ID}} --file_path={{FILE PATH}}
- The script will import the markdown file to Notion. A new page under
parent_page_id
will be created with the content.
For example, this README.md
will look like this in Notion:
- Highlighting.
- MathJax.
- Support local image files.
- Handle deeply (> 3 levels) nested children properly.
- Deal with Notion API's request limits.
- More tests on markdown extensions.