feat(#70): add option to flat page tree inside a destination#71
Merged
feat(#70): add option to flat page tree inside a destination#71
Conversation
Owner
Author
|
👋 Hi, Myastr0! Thanks for opening a PR. We will review it soon. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #70
Description
This PR adds a new
--flatoption that allows users to flatten the page tree structure when synchronizing markdown files to Notion. When enabled, all pages become direct children of the destination instead of maintaining nested folder structures, making it particularly useful for database syncs where you want all items at the same level.Changes
Core Features
flatten()method toTreeNode: Recursively flattens all children, excluding the root node itselfflatten()method toSiteMap: Returns a new SiteMap instance with the tree flattened under the root node, including a root copy as the first childSynchronizeMarkdownToNotionfeature:flattenoption toSynchronizeOptionsinterfaceflattenis true, the root node is skipped during synchronizationPreviewSynchronizationfeature: Addedflattenoption to preview how the structure will look when flattenedCLI Commands
synccommand: Added--flatflag to flatten the result page treepreview-synccommand: Added--flatflag to preview flattened structureGitHub Actions
flatinput parameter to support flattening in CI/CD workflowsDocumentation
--flatoptionTests
TreeNode.flatten()methodSiteMap.flatten()methodPreviewSynchronizationwith flatten optionMkNotesclass with flatten optionflattenparameterUse Cases
The
--flatoption is particularly useful for:Example
Without
--flat:With
--flat:Testing
Checklist
All Submissions:
New Feature Submissions:
Changes to Core Features: