Support non-flat filesystem hierarchy #309
Replies: 24 comments 9 replies
-
Beta Was this translation helpful? Give feedback.
-
Are you asking about supporting note files recursively (discarding the hierarchy) |
Beta Was this translation helpful? Give feedback.
-
Neuron already supports hierarchical tags. Perhaps the file system tree could be mapped 1:1 with tags and otherwise zettels would link to each other normally? |
Beta Was this translation helpful? Give feedback.
-
@jared-w commented on Jul 31, 2020, 5:22 PM GMT+4:30:
This is a good idea. I think to facilitate the linking, neuron might need to change its linking scheme a bit. As far as I understand, currently, neuron uses IDs as filenames to make changing the title of notes costless. A better approach might be to allow both an ID and a title. The title won't be included in the links, only the ID. The title's only use is to allow interoperability with other tools. (For example, I use fzf to jump between my notes, and I need meaningful names for each note for this to work.) This title can be further used as the last tag in the hierarchy of tags. To illustrate:
|
Beta Was this translation helpful? Give feedback.
-
This is what I was thinking. One could write an import script that converts the hierarchical notes directory, recursively, to a flat list of files each tagged accordingly, in addition to creating "portal zettels", for intermediate directories, that queries it's contents by tag. So, for example, given
|
Beta Was this translation helpful? Give feedback.
-
@NightMachinary There is no good reason to change the ID scheme and complicate it unnecessarily. You can use title (slug) as the ID if you want. Neuron doesn't care as long as they are unique, and are alphanumeric (with hyphen and underscore). I recommend that you give the above approach a try. |
Beta Was this translation helpful? Give feedback.
-
I would like it if neuron could eventually support at least one level of subdirectories. I use four "bins" or subfolders that really seldom need cross-referencing among the bins. It was annoying to me if kept in the same folder. My bins/subdirectories are, as follows: Academic work, personal technology notes (e.g. program documentation, cheat sheets, boilerplate, etc.), Cooking/Recipes, and Current News. I have made some aliases to take away some of the complexity. However, serving a localhost for each seems messy. Others might, of course, have different bins. Others may only use neuron for one type of notes. (Analog-analogy or pseudo-joke: Given the presence of slipnote paper, I would not be surprised if the Luhmann household used slipnotes for recipes, but I would be surprised if 'how to make Aunt Gertrude's apple strudel' ended up in the same zettlelkasten as his academic work.) |
Beta Was this translation helpful? Give feedback.
-
@jaysnoddy I think the cross-links idea mentioned at #355 may very well cover your use case. |
Beta Was this translation helpful? Give feedback.
-
i think this would be cool if you could implement something like dendron. so we don't really sub folders. just name the file based on our convention |
Beta Was this translation helpful? Give feedback.
-
I think this issue should be considered if neuron is to become a "complete" note-taking system that tries to support all kinds of workflows. If it wants to remain close to the Zettelkasten idea, then this is a distraction. I say this without deep knowledge of Zettelkasten, but I think doing less things is better. |
Beta Was this translation helpful? Give feedback.
-
I would be perfectly happy if Neuron simply recursively picked up all markdown files from all subdirs and then proceeded to handle them just as if they were all in a single directory. Of course, then the problem is possible name clashes, so the id of A bit of sugar on top of that would be to the ability resolve links relative to the current file's location, like how module references work in most programming languages. So Finally, it would be a nice to have if Neuron would optionally tag all files with their path, so that For all of us who already keep our notes in a file tree, I think the above would let us get productive with Neuron right away without having to change anything about our existing notes. |
Beta Was this translation helpful? Give feedback.
-
For those interested in this feature, I've pushed experimental support in the To use this feature, install latest neuron and add EDIT: docs https://neuron.zettel.page/subdir.html |
Beta Was this translation helpful? Give feedback.
-
Just tried this out and works great. As expected, I got warnings about id clashes. Are you leaning towards not doing anything to help resolve these? (By eg taking the file path into account?) I'd say that's reasonable, would introduce complexity to support what seems to be a rather small group of users who already have or want hierarchical file organization. Auto-tagging might still be a helpful thing, and doesn't really affect anything else? (My suggestion above: "...optionally tag all files with their path, so that |
Beta Was this translation helpful? Give feedback.
-
A notion of "namespaced linking" could be considered. So [[qux]] can also be explicitly linked to as [[bar/qux]] (from a note inside foo/ directory) or [[foo/bar/qux]]. This should take cross links proposal in #355 into consideration. We should combine them, and come up with a simple proposal - that satisfies the two use cases. See also "linking strategy" of vscode-memo: svsool/memo#131 Auto-tagging is a separate feature, possibly to be implemented as a plugin. cf. https://github.com/b0o/neuron-extras#demo |
Beta Was this translation helpful? Give feedback.
-
I've just started testing this out, and it may also be worth considering adding an option to ignore certain directories--I have a |
Beta Was this translation helpful? Give feedback.
-
In that case, we can just replace both patterns = [ "*.md" ] ^ That's the default, but it can be changed to |
Beta Was this translation helpful? Give feedback.
-
Sounds good to me. That's more ergonomic. |
Beta Was this translation helpful? Give feedback.
-
This is #141 |
Beta Was this translation helpful? Give feedback.
-
That's probably a different issue -- see #141 |
Beta Was this translation helpful? Give feedback.
-
There is a proposal for taking this feature to its natural next step by making the directories folgezettels. See #497 |
Beta Was this translation helpful? Give feedback.
-
I'm inclined to choose the following style of configuration for including/excluding Markdown files in a recursive traversal scenario and otherwise: { exclude = [".*", "README*"]
, ...
} This example will read Markdown files recursively, excluding dotfiles (eg: There is no "include" here, as I don't see a need for it; and then recursive traversal is enabled by default. The previous behaviour of looking for only top-level Markdown files can be resurrected by configuring as follows: { exclude = [".*", "README*", "*/*"]
} (The third entry excludes every second level file/directory; effectively limiting notes to top-level) |
Beta Was this translation helpful? Give feedback.
-
Now available: https://neuron.zettel.page/dirtree.html Give it a try; the documentation can certainly be improved (PR welcome!). |
Beta Was this translation helpful? Give feedback.
-
I just read this discussion and I still have some questions (I am a new user of Neuron, so maybe I am just misconfiguring something) I use Vim with the vimwiki plugin to write and do most of my production work, while Neuron is used to display the notes in a more usable way. As discussed here above, I also have a "rather flat" hierarchy of folders (one single level of directories after root). I use the dirtree plugin and it seems to work as intended. Currently if I do that, it will not find the note it is looking for. Is it something possible with neuron? Coudn't it be something worth adding? |
Beta Was this translation helpful? Give feedback.
-
Those that rely on filesystem hierarchy to structure their notes, I recommend trying out the neuron successor, Emanote. You can use partial paths in links, eg: |
Beta Was this translation helpful? Give feedback.
-
I already have my notes in markdown, but I organize them in a hierarchy of directories. It seems to me that supporting this shouldn't be very hard? As I have encoded a lot of information in the hierarchy, I don't wish to move them to a flat structure. The hierarchical organization is also supported by generic software very well; I use WorkingCopy on iOS to edit my notes, and it's quite up to the task, even though it's just a general git client.
Beta Was this translation helpful? Give feedback.
All reactions