0.0.1 • Published 4 months ago

push-to-notion v0.0.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
4 months ago

Push to Notion šŸ“š

Move your local content to Notion while preserving directory structure and formatting. Perfect for importing Lumentis generated content or any folder containing markdown, MDX, and text files.

Features ✨

  • šŸ”„ Smart Directory Sync: Recursively imports your content while maintaining folder hierarchy
  • šŸ“ Multiple File Types: Supports Markdown, MDX, plain text, and JSON files
  • šŸ”— Lumentis Integration: Direct import of Lumentis-generated pages with full formatting
  • šŸ“ Flexible Structure: Works with both flat files and nested directories
  • šŸŽØ Content Organization: Use _meta.json to customize titles and order
  • šŸ”„ Smart Updates: Only updates modified files, saving time and API calls
  • šŸ§™ā€ā™‚ļø Interactive Setup: User-friendly wizard for configuration
  • šŸ“Š Progress Tracking: Real-time progress bars and detailed logging

Installation šŸš€

# Using npm
npm install -g push-to-notion

# Using yarn
yarn global add push-to-notion

# Using bun
bun add -g push-to-notion

# Or run directly with npx
npx push-to-notion

Quick Start šŸƒā€ā™‚ļø

  1. Get your Notion API key from Notion Integrations
  2. Create a page in Notion where you want to import your content
  3. Share the page with your integration
  4. Run the tool:
push-to-notion --token YOUR_NOTION_TOKEN --parent YOUR_PAGE_ID --path ./your/content/path

Or use the interactive wizard:

push-to-notion

Directory Structure šŸ“

Your content directory can include:

content/
ā”œā”€ā”€ _meta.json           # Optional: Configure titles and order
ā”œā”€ā”€ index.mdx           # Root content (processed first)
ā”œā”€ā”€ getting-started/
│   ā”œā”€ā”€ index.mdx      # Directory content
│   ā”œā”€ā”€ setup.mdx      # Sub-page
│   └── configuration/ # Nested directory
│       └── index.md   # Nested content
└── api/
    ā”œā”€ā”€ _meta.json     # Directory-specific meta
    ā”œā”€ā”€ endpoints.mdx
    └── auth.mdx

_meta.json Configuration šŸŽÆ

Control page titles and order:

{
  "getting-started": "Getting Started Guide",
  "api": {
    "title": "API Documentation",
    "order": 1
  },
  "endpoints": "API Endpoints",
  "auth": "Authentication"
}

Files are ordered:

  1. By their order in _meta.json
  2. Alphabetically for files not in _meta.json

Lumentis Integration šŸ¤

Import Lumentis-generated content directly:

  1. Generate content with Lumentis
  2. Point push-to-notion to your output directory:
push-to-notion --path ./lumentis-output --parent YOUR_PAGE_ID

Best Practices šŸ’”

  1. Directory Organization:

    • Use index.mdx for main directory content
    • Keep related files in subdirectories
    • Use consistent file naming
  2. Content Structure:

    • Start with a clear root index.mdx
    • Use headings for better navigation
    • Break large content into subpages
  3. Updates:

    • The tool tracks file modifications
    • Only changed files are updated
    • Use --fresh to force full reimport

Advanced Usage šŸ› ļø

CLI Options

Options:
  -t, --token <token>        Notion API token
  -p, --parent <id>         Parent page ID
  -d, --path <path>         Content directory path
  -v, --verbose             Enable verbose logging
  --dry-run                 Test run without making changes
  --fresh                   Force reimport of all files
  -h, --help               Display help

Environment Variables

export NOTION_TOKEN=your_token
export NOTION_PARENT_PAGE=your_page_id

Development šŸ”§

# Clone the repo
git clone https://github.com/southbridgeai/push-to-notion.git

# Install dependencies
bun install

# Build
bun run build

# Run locally
bun run cli

Contributing šŸ¤

Contributions are welcome! Please feel free to submit a Pull Request.

License šŸ“„

Apache-2.0 - see LICENSE for details.


Made with ā¤ļø by Hrishi Olickel