Skip to content

A lightweight automation tool to seamlessly push Notion exports (Notes Specifically) to GitHub. It auto-detects, extracts, renames, cleans HTML links, logs changes, commits to Git, and removes the original ZIP — all in one click.

License

Notifications You must be signed in to change notification settings

MathewJobey/notion_export-to-github

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📝Notion Export to GitHub Auto Sync Tool

Ever needed to publish Notion notes to GitHub without broken links, ugly filenames, or manual commits? Automatically sync your Notion-exported HTML (and .md) pages to a GitHub repository — cleaned, fixed, committed, and pushed with one click.just go through the installation and how to use steps and u will be okay.


📦 What It Does

  • 🔍 Detects the latest Notion export .zip from your Downloads folder(dont rename the file 😅)
  • 📦 Extracts it to a temp folder
  • ✂️ Cleans folder and file names by removing UUIDs
  • 🧠 Fixes internal HTML links and emoji/encoding issues
  • 🔄 Mirrors changes into a local GitHub repo
  • 📝 Auto-commits and pushes changes to GitHub
  • 🌐 Opens your GitHub repo in the browser
  • 🧹 Cleans up the ZIP and temp folder after use

🛠 Requirements

Tool Usage
🪟 Windows Batch and PowerShell based
🐍 Python 3.7+ Required to fix HTML encoding and links
📦 Python packages ftfy, beautifulsoup4, chardet
🔧 Git Used for auto add, commit, and push
💻 PowerShell Used for safe folder renaming and link cleanup

⚙ Installation

  1. Install Git
    https://git-scm.com/downloads

  2. Install Python 3.x
    https://www.python.org/downloads/

  3. Install required Python packages:

    pip install ftfy beautifulsoup4 chardet
  4. Clone this repository or Download as ZIP

  5. Edit this line inside notion-sync.bat to match your local GitHub folder (line 49):

    set "GITHUB_DIR=C:\GitHub\Your-Repo-Name"
  6. .gitignore is auto-generated by the script:
    The script will automatically create a .gitignore file for you (if it doesn't exist), so you usually don't need to prepare one manually. You can add extra files to ignore later if needed.The script auto-creates a .gitignore for last-robocopy.log.

  7. Exclude specific files:
    To always skip certain files (like constants), add them to notion-sync.bat (see line 53). Some common files are already excluded.


🚀 How to Use

  1. Export your Notion workspace (as in this case) HTML and place the .zip file in your Downloads folder. Screenshot 2025-06-26 150128

  2. Run notion-sync.bat (double-click or run from terminal).

  3. Done! It will:

    • Extract & clean the export
    • Fix internal links and encoding
    • Push the updates to GitHub
    • Open your repo in browser
    • delete the original notion zip file and the temp files.

📁 File Structure

notion-html-sync/
├── notion-sync.bat              # Master script
├── cleanup-notion.ps1           # PowerShell rename utility
├── process_notion_html.py       # Python cleanup for HTML encoding/links
├── .gitignore                   # Ignores logs and temp files
└── README.md                    # You're reading this

🙌 Credits

Created by Mathew Jobey


💡 Want a Portable .exe Version?

If you'd prefer a version that runs without needing Python, Git, or setup:

👉 Join the discussion here
React with a 👍 or leave a comment — if enough people ask, an .exe will be published in Releases!


About

A lightweight automation tool to seamlessly push Notion exports (Notes Specifically) to GitHub. It auto-detects, extracts, renames, cleans HTML links, logs changes, commits to Git, and removes the original ZIP — all in one click.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published