Markdown export and import
One-time export to a folder and import of Markdown files: file names, front matter, links between files and notebook folders. Decisions: D-34, D-36, D-42. Folder sync is still a plan (docs/spikes/folder-sync.md) and has no tests.
- Export lays out files (default notebook at the root, a folder per notebook, trashed notes left out); import recreates notes and notebooks; re-import skips unchanged files and adds IMPORT revisions for changed ones
- Shared:
NotesCoreTest.exportImportRoundTrip - Android:
ExportIntegrationTest.exportedFilesKeepNoteLinksAndImportBackIntoTheSameNotes - iOS:
ExportIntegrationTests.ExportedFilesKeepNoteLinksAndImportBackIntoTheSameNotes
- Shared:
- Export from Settings writes one file per note, note links as relative links
- Android:
ExportUiTest.exportWritesEachNoteAsAFileWithNoteLinksAsRelativeLinks - iOS:
ExportUITests.ExportWritesEachNoteAsAFileWithNoteLinksAsRelativeLinks - Not tested: Shared
- Android:
- Importing a folder from Settings adds its notes, turns subfolders into notebooks and shows a summary
- Android:
ImportUiTest.importingAFolderAddsItsNotesAndNotebooks - iOS:
ImportUITests.ImportingAFolderAddsItsNotesAndNotebooks - Not tested: Shared
- Android:
- Note links become relative file links and import reads them back (D-36)
- Shared:
NotesCoreTest.exportWritesNoteLinksAsRelativeLinksAndImportReadsThemBack - Android:
ExportIntegrationTest.exportedFilesKeepNoteLinksAndImportBackIntoTheSameNotes - iOS:
ExportIntegrationTests.ExportedFilesKeepNoteLinksAndImportBackIntoTheSameNotes
- Shared:
- Files are named after titles and kept apart when titles clash (D-42)
- Shared:
NotesCoreTest.exportNamesFilesAfterTitlesAndKeepsThemApart - Not tested: Android, iOS
- Shared:
- File name cleanup: unsafe characters, empty names, titles from paths, folders from paths
- Shared:
DomainSupportTest.pathsAndFileNames - Not tested: Android, iOS
- Shared:
- Front matter round-trips: ids, title, dates, pinned
- Shared:
DomainSupportTest.frontMatterRoundTrip - Not tested: Android, iOS
- Shared:
- Invalid front matter keeps the whole file as the body, with a warning
- Shared:
DomainSupportTest.invalidFrontMatterKeepsWholeFile - Not tested: Android, iOS
- Shared:
- Pins are exported and restored on import
- Shared:
NotesCoreTest.exportKeepsPinsAndImportRestoresThem - Not tested: Android, iOS
- Shared:
- Re-import keeps an automatic title unless the file changes it
- Shared:
NotesCoreTest.reimportKeepsAnAutomaticTitleUnlessTheFileChangesIt - Not tested: Android, iOS
- Shared:
- Files without front matter are still linked to each other on import
- Shared:
NotesCoreTest.importLinksFilesWithoutFrontMatter - Not tested: Android, iOS
- Shared:
- Plain Markdown files (from other apps) import, with titles and notebooks from paths
- Shared:
NotesCoreTest.importPlainMarkdownFiles - Not tested: Android, iOS
- Shared:
- Exported names are Unicode NFC
- Shared:
NotesCoreTest.exportWritesComposedNames - iOS:
ExportIntegrationTests.ExportWritesComposedUnicodeNames - Not tested: Android
- Shared:
- Decomposed (NFD) file names match composed links and notebooks on import
- Shared:
NotesCoreTest.importMatchesDecomposedFileNamesToComposedLinksAndNotebooks - Not tested: Android, iOS
- Shared:
- Settings explain where notes live
- Android:
HistorySearchTrashUiTest.settingsExplainWhereNotesLive - iOS:
HistorySearchTrashUITests.SettingsExplainWhereNotesLive - Not tested: Shared
- Android:
The system pickers are replaced in UI tests (Espresso-Intents on Android, JOTRY_EXPORT_FOLDER and JOTRY_IMPORT_FOLDER on iOS); see CONTRIBUTING.md.
Gaps
- Importing single files from Settings (Android’s Import Markdown files, picking files rather than a folder on iOS) and the unreadable-file warning have no UI test.
- The real folder picker is never driven, by design.
- Importing into a chosen notebook (
targetNotebookIdnot null) is untested; both apps pass null today. - Re-importing an edited export that conflicts with newer changes in the app is untested beyond titles.
- Android: no test for NFC file names on a real Android file system (iOS has one).