README-notion

Mnemos ↔ Notion Integration

Bridge your Notion workspace with Mnemos for Git-based knowledge management with full version history and offline access.

Architecture

Notion Workspace
    ↓ (export via API/manual)
~/notion-backup/ (Git repo)
β”œβ”€β”€ databases/
β”‚   β”œβ”€β”€ projects/
β”‚   β”œβ”€β”€ notes/
β”‚   └── tasks/
β”œβ”€β”€ pages/
β”‚   └── individual-pages/
└── assets/
    └── images/
    ↓ (symlink integration)
mnemos/p/notion/
β”œβ”€β”€ projects/ β†’ ~/notion-backup/databases/projects/
β”œβ”€β”€ notes/ β†’ ~/notion-backup/databases/notes/
└── pages/ β†’ ~/notion-backup/pages/

Quick Setup

1. Get Notion API Token (Optional but Recommended)

  1. Go to Notion Integrations
  2. Create a new integration
  3. Copy the β€œInternal Integration Token”
  4. Share your databases/pages with this integration

2. Set Up Sync

# Set your Notion token (optional)
export NOTION_TOKEN="secret_xxxxxxxxxxxx"

# Run initial setup
make notion-setup

# Sync your Notion content
make notion-sync

3. Manual Export (Fallback)

If API export doesn’t work:

  1. Go to Notion β†’ Settings & Members β†’ Export content
  2. Choose β€œMarkdown & CSV” format
  3. Download and extract to ~/notion-backup/
  4. Run make notion-sync to integrate with Mnemos

Usage

Regular Sync

# Sync Notion β†’ Git β†’ Mnemos
make notion-sync

# Format and update Mnemos metadata
make fmt

# Push everything to Git
make push

Access in Mnemos

Your Notion content will be available in:

Git History

All changes are tracked in the ~/notion-backup/ Git repository:

cd ~/notion-backup
git log --oneline  # View sync history
git diff HEAD~1    # See latest changes

Advanced Configuration

Custom Sync Location

# Use custom backup location
./scripts/notion-to-git.sh /path/to/custom/notion-backup

Automated Sync

Add to crontab for automatic daily sync:

# Sync Notion daily at 9 AM
0 9 * * * cd /path/to/mnemos && make notion-sync >/dev/null 2>&1

Docker Export Setup

For API-based export, ensure Docker is available:

# Pull the export tool
docker pull looorent/notion-exporter

Benefits

βœ… Git Version Control

βœ… Offline Access

βœ… Mnemos Integration

βœ… Format Flexibility

Troubleshooting

Export Issues

If automatic export fails:

Permission Errors

# Fix permissions if needed
chmod +x scripts/notion-to-git.sh

Missing Dependencies

# Install required tools
brew install git        # macOS
apt install git         # Ubuntu/Debian

File Structure

Your ~/notion-backup/ will contain:

notion-backup/
β”œβ”€β”€ .git/                    # Git history
β”œβ”€β”€ README.md               # Backup info
β”œβ”€β”€ databases/              # Notion databases
β”‚   β”œβ”€β”€ projects/
β”‚   β”‚   β”œβ”€β”€ project-a.md
β”‚   β”‚   └── project-b.md
β”‚   β”œβ”€β”€ notes/
β”‚   β”‚   β”œβ”€β”€ idea-1.md
β”‚   β”‚   └── research-notes.md
β”‚   └── tasks/
β”‚       └── todo-items.md
β”œβ”€β”€ pages/                  # Individual pages
β”‚   β”œβ”€β”€ meeting-notes/
β”‚   └── reference-docs/
└── assets/                 # Images and files
    β”œβ”€β”€ image-1.png
    └── document.pdf

Next Steps

After setting up Notion sync:

  1. Review Content: Check ~/notion-backup/ for exported content
  2. Format Notes: Run make fmt to add Mnemos metadata
  3. Explore Integration: Browse p/notion/ in your Mnemos vault
  4. Set Up Automation: Add to crontab for regular syncing
  5. Backup: Consider pushing ~/notion-backup/ to a Git remote

This integration gives you the best of both worlds: Notion’s collaborative editing with Git’s version control and Mnemos’s structured knowledge management.

← Back to Knowledge Base