diff --git a/docs/0000-parenting.md b/docs/0000-parenting.md new file mode 100644 index 0000000..7286ee7 --- /dev/null +++ b/docs/0000-parenting.md @@ -0,0 +1,85 @@ +--- +Start Date: 2020-08-04 +RFC PR: (leave this empty) +Foam Issue: (leave this empty) +--- +[[index]] + +# 0000 Parenting (Notes Hierarchy) + +## Summary + +I suggest implementing a concept of parenting (visual notes hierarchy): when every note can be a parent and/or a child and the same notes may appear in different parent/children trees. There may be a special children view (similar to backlinks explorer) and some special hierarchy visualisation. +In general, this is a convenient folders system replacement (one note can be child of several parents). + +## Basic example + +This concept is brilliantly implemented in [Supernotes](https://supernotes.app) and [Trilium Notes](https://github.com/zadam/trilium) (for example). +Imagine set of notes collecting quotes from favorite books: +``` +Author Name +Another Author Name +Book Title 1 +Book Title 2 +Book Title 3 +Quote 1 +Quote 2 +Quote 3 +Quote 4 +Quote 5 +Quote 6 +``` +In flat notes list these notes are looking like a mess. With parenting they may look like this: +``` +Author Name +|-- Book Title 1 + |-- Quote 1 + |-- Quote 2 +|-- Book Title 2 + |-- Quote 3 +Another Author Name +|-- Book Title 3 + |-- Quote 4 + |-- Quote 5 + |-- Quote 6 +``` +`Author Name` and `Another Author Name` are roots. There is smth like `parent: Author Name` in the metadata section of `Book Title 1` and `Book Title 2`. There is `parent: Book Title 1` in the metadata section of `Quote 1` and `Quote 2`. There is `parent: Book Title 2` in the metadata section of `Quote 3` etc. + +In the same time the 'root' notes `Author Name` and `Another Author Name` can be children of some other note(s) (say, `Reading`). + +It should be possible to add more than one parent to a note: `parent: Software, Programming` + +## Motivation + +Wiki links are great, but they are not representing the hierarchy of the notes. And when we are putting notes in foders/subfolders there is a need to create a special notes-placeholders, which exist to collect a backlinks. For example, if you keep your travel notes in `Travel` folder, there are good chances, there is a `Travel` note in this folder, which keeps all of the backlinks from all other travel-related notes. +Another one drawback of using folders is that you can't have the same note in several folders without phisically copying it. +Implementing parenting allows you to keep notes hierarchy clean and effective, while using wiki links for adding semantical context. + +## Detailed design + +The obvious way of implementing parenting is that the parent-relationship info could be stored in frontmatter metadata at the top of the file: `parent: Other document`. That could be made click-navigatable in the document, and we could build features on top of that: +- Visualisation of the hierarchy +- Children view (similar to backlinks explorer) +- Whatever is needed + +There should be a way to ***hoist*** notes: being able to focus on/zoom into the specific note (using the specific note as the root of the hierarchy). + +When you are in the middle of notes hierarchy (for example: `Author Name` > `Book Title 1`), the newly created notes should be created in the current context (`parent: Book Title 1`), until user explicitly specified another location. + +Drag and drop to change the parent notes? + +## Drawbacks + +Using parenting makes file explorer almost obsolete and may be confusing to the users, which are too tied to using files and folders. + +## Alternatives + +There may be a way to implement hierarchy in it's simplest form using just wiki links. For example, we may decide, that note, which has a link to other note is a child of the latter note. So the previous book quotes example may look like this: + +`Author Name` and `Another Author Name` are roots (they have wiki links to 'Reading' note). There is a link `[[Author Name]]` somwhere inside `Book Title 1` and `Book Title 2` notes. There is a link `[[Book Title 1]]` somewhere inside `Quote 1` and `Quote 2` notes. There is a link `[[Book Title 2]]` somewhere inside `Quote 3` etc. + +This is much easier to implement, but may clash with bidirectional links. + +[//begin]: # "Autogenerated link references for markdown compatibility" +[index]: index "Foam RFCs" +[//end]: # "Autogenerated link references" \ No newline at end of file