-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Notion markdown addition #16194
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
Notion markdown addition #16194
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
WalkthroughThe changes update the Notion integration by broadening the functionality of the retrieve actions. The "Retrieve Block" action is now renamed to "Retrieve Page Content" with added support for markdown output via conditional logic in its run method. The "Retrieve Page" action is revised to "Retrieve Page Metadata" with an advisory label. Additionally, a new method for converting pages to markdown is added, and the package version and dependencies have been updated accordingly. Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant A as Page Content Action
participant N as Notion App
U->>A: Invoke action with parameters (including retrieveMarkdown flag)
alt retrieveMarkdown is true
A->>N: Call getPageAsMarkdown(pageId)
N-->>A: Return markdown content
A-->>U: Return success message with markdown
else
A->>N: Retrieve block and child blocks
N-->>A: Return block objects
A-->>U: Return success message with block data
end
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
components/notion/actions/retrieve-block/retrieve-block.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs components/notion/actions/retrieve-page/retrieve-page.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs components/notion/notion.app.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs ✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
components/notion/actions/retrieve-block/retrieve-block.mjs (1)
32-37: Good implementation of markdown retrieval logic.The conditional handling for markdown retrieval is implemented correctly, calling the appropriate method and returning the result.
Consider standardizing the summary messages for consistency:
- $.export("$summary", "Successfully retrieved page as markdown"); + $.export("$summary", "Successfully retrieved page content as markdown");And on lines 42-44:
- $.export("$summary", `Successfully retrieved block${this.retrieveChildren + $.export("$summary", `Successfully retrieved page content${this.retrieveChildren ? ` with ${block.children.length ?? 0} children` : ""}`);
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (4)
components/notion/actions/retrieve-block/retrieve-block.mjs(2 hunks)components/notion/actions/retrieve-page/retrieve-page.mjs(1 hunks)components/notion/notion.app.mjs(2 hunks)components/notion/package.json(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: pnpm publish
- GitHub Check: Verify TypeScript components
- GitHub Check: Lint Code Base
- GitHub Check: Publish TypeScript components
🔇 Additional comments (9)
components/notion/package.json (2)
3-3: Version bump appropriately reflects new functionality.The version increment from 0.4.1 to 0.5.0 follows semantic versioning principles, correctly indicating the addition of new functionality (markdown support) rather than just a bug fix.
16-17:✅ Verification successful
Note the use of an alpha version dependency.
Adding the notion-to-md dependency is necessary for the new markdown conversion functionality. However, be aware that you're using an alpha version (4.0.0-alpha.4) which may not be fully stable for production use.
🌐 Web query:
Is [email protected] stable for production use? Are there any known issues?💡 Result:
The
[email protected]package is explicitly labeled as experimental in its documentation, with warnings that it is part of a "fundamental reimagining" of the library and not yet suitable for production use[5].Key considerations:
- The v4 release introduces architectural changes aimed at modularity and extensibility, but these are still in alpha testing[5].
- The maintainers emphasize that this version is intended for early adopters and contributors, not production workflows[5].
No specific stability issues or bugs are mentioned in the available sources, but the alpha designation itself indicates inherent instability typical of early development phases. For production environments, the maintainers recommend waiting for stable releases[5].
Citations:
- 1: https://github.com/joelparkerhenderson/versioning/blob/main/README.md
- 2: middleman/middleman-blog#238
- 3: https://www.oecd-nea.org/dbdata/data/manual-endf/endf102_2009.pdf
- 4: https://github.com/backstage/backstage/blob/master/docs/releases/v1.4.0-changelog.md
- 5: https://www.npmjs.com/package/notion-to-md
- 6: https://pmc.ncbi.nlm.nih.gov/articles/PMC11919731/
- 7: https://docs.buildbot.net/4.0.0/full.html
- 8: https://graphite.dev/docs/cli-changelog
- 9: https://skybrary.aero/sites/default/files/bookshelf/2507.pdf
- 10: https://pmc.ncbi.nlm.nih.gov/articles/PMC7616792/
Attention: Experimental Dependency Usage
The inclusion of
[email protected]enables the new markdown conversion functionality, but please be aware that this version is explicitly marked as experimental. As highlighted in the package documentation, this alpha release is undergoing significant architectural changes and is not considered stable for production environments. Use with caution and plan for potential updates or issues as the library matures.components/notion/actions/retrieve-page/retrieve-page.mjs (2)
5-5: Improved action naming for clarity.Renaming from "Retrieve Page" to "Retrieve Page Metadata" more accurately describes the functionality of this action, helping users understand its purpose.
11-15: Good user guidance with info label.The added info label effectively guides users to the appropriate action for retrieving page content, improving the overall user experience and reducing potential confusion.
components/notion/notion.app.mjs (2)
4-5: Appropriate imports for new functionality.The imports for NotionConverter and DefaultExporter are correctly added to support the new markdown conversion capability.
360-373: Well-implemented markdown conversion method.The getPageAsMarkdown method properly initializes the necessary components from the notion-to-md library and follows the correct pattern for converting Notion pages to markdown. The implementation is concise and effective.
components/notion/actions/retrieve-block/retrieve-block.mjs (3)
5-7: Improved naming and description for expanded functionality.The name change from "Retrieve Block" to "Retrieve Page Content" better reflects the expanded capabilities. The updated description clearly communicates the action's ability to retrieve content in both block and markdown formats.
19-20: Clearer label and description for child blocks retrieval.The updated label and description for the retrieveChildren property provide better clarity regarding its purpose, making it easier for users to understand what this option does.
24-29: Well-defined property for markdown retrieval.The addition of the retrieveMarkdown property gives users control over the output format, with clear labeling and description.

Added the option of retrieving page content as markdown to "Retrieve Block" which was renamed to "Retrieve Page Content".
Renamed "Retrieve Page" to "Retrieve Page Metadata" for clarity.
Summary by CodeRabbit