0.0.1 ⢠Published 4 months ago
push-to-notion v0.0.1
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 šāāļø
- Get your Notion API key from Notion Integrations
- Create a page in Notion where you want to import your content
- Share the page with your integration
- 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:
- By their order in
_meta.json
- Alphabetically for files not in
_meta.json
Lumentis Integration š¤
Import Lumentis-generated content directly:
- Generate content with Lumentis
- Point push-to-notion to your output directory:
push-to-notion --path ./lumentis-output --parent YOUR_PAGE_ID
Best Practices š”
Directory Organization:
- Use
index.mdx
for main directory content - Keep related files in subdirectories
- Use consistent file naming
- Use
Content Structure:
- Start with a clear root
index.mdx
- Use headings for better navigation
- Break large content into subpages
- Start with a clear root
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
0.0.1
4 months ago