Skip to content

feat. Implement bookmark metadata extraction and filtering system #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

myjeong19
Copy link
Member

@myjeong19 myjeong19 commented Mar 24, 2025

Overview

This PR implements a comprehensive system for extracting, processing, and filtering metadata from bookmark blocks in Notion. The implementation extends the Notion API SDK to transform standard bookmark blocks into enhanced notionpress_bookmark blocks with rich metadata.

Key Features

  • Type Extension: Added NotionpressBookmarkBlock type that extends standard Notion blocks with enhanced metadata capabilities

  • Metadata Extraction: Implemented HTML parsing using Cheerio to extract rich metadata from bookmarked web pages

  • Intelligent Default Fields: Set up default metadata fields (title, url, description, favicon, image) that are always included

  • Flexible Field Filtering: Added ability for users to specify which metadata fields to include via the --fields option

  • Error Handling: Robust error handling for URL fetching and HTML processing failures

Implementation Details

  • Created a clean, modular architecture for bookmark processing

  • Used preprocessors for consistent metadata cleaning and formatting

  • Ensured backward compatibility with the original Notion API

  • Implemented a recursive processing method to handle nested bookmark blocks

  • Fixed ESM module compatibility issues with proper file extensions

@Moon-DaeSeung

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant