Skip to content

Code-Triarii/notion-exporter-to-mkdocs

Repository files navigation

📝 Notion Wiki exporter to MkDocs

Python Docker

This project aims to provide an easy way for migrating Notion Wikis from your organization to MkDocs. We had a use case in which we were needing to migrate all the content that we have been generating in our Notion wiki to other system/platform. Since MkDocs is extending as powerful solution for managing wikis, we decided to give it a try thinking always with the automation first mindset.

View Demo · Report Bug · Request Feature

📚 Table of contents

🚧 Solution Architecture

Important

Do not forget to change the Architecture picture/diagram and delete the label

Architecture

Components

🔝 Back to top

🚀 Installation and Execution

🔨 Prerequisites

  • Docker
  • Python 3.10+

🔝 Back to top

🔧 Installation

Docker environment

Install Docker Engine. Visit https://docs.docker.com/engine/install/ for more information.

  1. Build docker image:
docker build . -t notion-exporter:1.0
  1. Run docker image:
docker run -it --name notion-exporter --rm -v $(pwd):/app --user $(id -u):$(id -g) -e NOTION_TOKEN="" -e NOTION_REQUEST_WAIT_TIME="500" notion-exporter:1.0 list all -p bc3caa74-66ba-4cd1-bfcd-02f18521903e

Tip

You can play with the NOTION_REQUEST_WAIT_TIME (in ms) value. This will set the delay in between requests to the API. Notice that Notion allows on average 3 requests per second by the integration. Therefore, to not get blocked the bare minimum wait time should be 333 theoretically.

  1. After the assets have been generated from Notion if everything went well, you can build the mkdocs image:
docker build .  -f Dockerfile.mkdocs -t mkdocs:1.0
  1. Finally, you can set up you mkdocs wiki with the contents from your Notion.
docker run -d --name mkdocs -e MKDOCS_SITE="https://example.com" -e MKDOCS_PORT="8000" -e MKDOCS_INTERFACE="0.0.0.0" -e MKDOCS_SITE_NAME="mkdocs" -p 8000:8000 mkdocs:1.0

🔝 Back to top

💼 Usage

Tip

TOEDIT: Use this space to show useful examples of how a project can be used. Additional screenshots, code examples and demos work well in this space. You may also link to more resources.

🔝 Back to top

Local development

For quick development set-up leveraging Docker, you can use the build image and run it eternally:

docker run -it --name notion-exporter --rm -v $(pwd):/app --user $(id -u):$(id -g) -e NOTION_TOKEN="" -e NOTION_REQUEST_WAIT_TIME="500" --entrypoint sh notion-exporter:1.0

If you need to install additional dependencies, you can access the container in a different terminal with root permissions:

docker exec -it -u 0:0 notion-exporter sh

This way you would be able to develop without having to concern about dependencies installation in your host system, testing and breaking as you like.

📍 Features and roadmap

  • Functionality:
  • Export Notion wiki.
  • Parametrized execution for reusability.
  • Indentation with 4 spaces for compatibility with Syntax rules for python-markdown - MkDocs
  • Include support for databases (currently only pages and blocks)
  • Deployment:
    • Bundle automation in Docker image definition.
    • Prepare automation to deploy in kubernetes cluster with Helm.

See the open issues for a full list of proposed features (and known issues).

🔝 Back to top

📎 Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated 💹.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".

  1. Fork the Project
  2. Create your Feature Branch
    git checkout -b feature/AmazingFeature
  3. Commit your Changes
    git commit -m 'Add some AmazingFeature
  4. Push to the Branch
    git push origin feature/AmazingFeature
  5. Open a Pull Request

🔝 Back to top

📃 License

Distributed under the Apache2.0 License. See LICENSE for more information.

🔝 Back to top

👥 Contact

X TikTok Medium YouTube Instagram

As we always state, our main purpose is keep learning, contributing to the community and finding ways to collaborate in interesting initiatives. Do not hesitate to contact us at codetriariism@gmail.com

If you are interested in our content creation, also check our social media accounts. We have all sorts of training resources, blogs, hackathons, write-ups and more! Do not skip it, you will like it 😏 😏 😏 👍

Don't forget to give the project a star if you liked it! Thanks again! 🌟 💛

🔝 Back to top

References

🔍 Acknowledgments

💯 💯 💯 For those that are curious about some of the resources or utilities and for sure thanking and giving credit to authors, we provide you a list of the most interesting ones (in our understanding) 💯 💯 💯

🔝 Back to top

Releases

No releases published

Packages

No packages published