Skip to content
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

Import non-Notion markdown directory #273

Merged
merged 13 commits into from
Dec 3, 2024

Conversation

cloverich
Copy link
Owner

@cloverich cloverich commented Nov 24, 2024

This branch adds experimental support for non-Notion markdown import (e.g. Obsidian import). Goal is to allow me to import all my old markdown notes from two directories (one is a Notion, other is Apple Notes -> Obsidian) in a basic (experimental) sense. #258 and #271 were relevant pre-cursors to this branch. See #247 for motivation.

  • add option to importer UI for Notion / Other
  • add sourceType to importer
  • conditionally strip and track notion Id from note title
  • pull title from filename
  • conditionally skip (notion style) front matter
  • track note creation time via ctime
  • convert wikilink embeddings (![[My File.webp]]) to markdown links
  • convert wikilinks ([[My other note]]) to markdown-based note links
  • convert wikilinks that point to files (link to them, instead of embed them)
  • handle relative wikilinks and embeddings ([[../My relative link]]). Presumably from duplicate filenames.
  • track alias and hash on wiki style links
  • import #tags

Will most likely defer handling duplicate / relative wikilinks if I don't have personal need. Will be better prepared to tackle them after #251 since that probably requires some related refactoring.

Closes #132

First commit preparing for non-Notion markdown import (e.g. Obsidian import).

- add sourceType to importer
- conditionally strip and track notion Id from note title
- skip front matter parsing when not Notion (existing routine is _very_ Notion specific)
- skip title parsing from front matter; fallback to file name when non-Notion import
- rely on ctime / mtime for created at and updated at by stubbing empty front matter
@cloverich cloverich changed the title add source type to importer; optional notion id Import non-Notion markdown directory Nov 24, 2024
- update wikilink (mdast) url to the resolved url
- convert wiikilink from ofmWikiEmbedding to image

Almost works, but intermediate step will die trying to write mdast back to markdown.
- move all file handling and update logic to WikiFileResolver
- change order of update / file move operations somewhat
- convert ofmWiki links and embedding (naively)
- complete first Obsidian import test (partial, focused on images, it works)

Next some refactoring, a fuller test, then Wikilinks, then edge case searching
- convert wiki-style note links to markdown-style note links
- update internal note links to updated note location
- make import type (Notion, Other) configurable via UI
- use birthtime, else mtime, for note creation date
- check for empty / null value when selecting new chronicles root - it implies the user clicked cancel
- when importing, parse #tags in content and convert to document tags on create
- add supporting libraries (temporarily forked into project, b/c esm)
@cloverich cloverich merged commit fe301bd into master Dec 3, 2024
2 checks passed
@cloverich cloverich deleted the cloverich/experimental_importer_2 branch December 3, 2024 16:42
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.

Import from markdown (directory)
1 participant