Folder as markdown note

I added the proposal to the op.

1 Like

Hello,

I am coming from Trilium Notes and because it is SQLite based it is possible that a note can also be a folder (containing child notes).

And although I do like the fact that obsidian uses simple files for the content, I do miss the possibility to have note content on a folder level. I use that a lot in Trilium.

Would it be an option to have for every folder you create in your vault a hidden md file is created in that folder (for example .foldername.md or maybe even a fixed name like .foldertext.md or so). And when you click on the folder the tree is not only opened but the content of that hidden md file is also presented.

My tree might looks like:

  • Project A
    - sprint 1
    - sprint 2
    - sprint 3

Now I have to create a sprint 1 file in my sprint 1 folder (which contains multiple files ect). That is not logically for my. Specially as you cannot force a note to be at the top of the child files.

For me this functionality would make my use of folder a lot easier and self-explaning because you define what you mean on a folder level.

I just thought this up and would lik e to know if anybody sees the value in this. Otherwise I might have to change my working habbits :-).

Let me know.

Kind regards,
JeRoen

7 Likes
  1. when a folder is created, a automatic virtual note is created as a hub
  2. when notes are placed into this folder, they automatically link to this folder/hub

Questions to consider
a. do existing links continue to exist when the note is moved to the folder
b. can a switch of some sort exist that allows you to allow/disallow the keeping of existing links to the notes being put into the folder.

1 Like

I am very much a fan of this proposal because it’s a 1-to-1 match for how basic HTML page structure works (for example, going to whatever.com/heres-a-thing/ will attempt to load whatever.com/heres-a-thing/index.html on most web servers), which would make this use also directly correspond with using tools like Github Pages that translate nested folders of Markdown files into nested folders of HTML files.

6 Likes

This is a very similar concept to page bundles in hugo. CC: @ Roadie

It’s a fantastic idea and would be an ‘official’ implementation of the work-flow that i’ve already started to create w/ Obsidian.

I have a Projects vault with each sub-dir being an actual project which leads to:

Projects/project-1/Overview.md (this has many back links to the many other notes in the project-1 dir
Projects/project-2/Overview.md … etc

The overview page is usually a quick glance of status (blocked, in progress, back burner…) and any remaining milestones and links to the document where the idea is described and the architecture fleshed out.

w/r/t the zettelkasten work flow, I absolutely expect that future notes for future projects will link to notes in current projects. For example:projects/project-long-running-thing/2020-03-01_production-issue-with-SomeProcessSpecificMachine.md might describe an issue and eventual solution. It is likely that future projects will later encounter the same or a similar issue.

The reason for using folders is simple:

  • it’s how a lot of people think about taxonomies / storing their info and data.
  • it’s also much easier for tools and scripts outside of obsidian.md to manage files this way.
  • file systems (and, sync tools!) can choke if there’s a ton of files in one directory. I don’t think that most people will have 100K+ files in one dir, but it’s a potential issue that goes away as soon as you split those 100K files across a few directories.

w/r/t scripts and tools that liive outside of obsiidian:

I can run a script on my Projects vault and every file that has the string TODO: $some_string_here will get turned into a todo list item where the tags/project/due-data and other meta data for the task are inferred from the folder paths. This becomes nearly impossible to do in a consistent and sane way unless either:

  • every file is forced to have some sort of standard header
  • an API / database now holds all of the medadata. This is why i stopped using qOwn Notes.

Either approach starts to infringe on the purity of “you own your notes” idea from the front page.

W/r/t: implementation details

I think a ‘hard-coded’ approach that always assumes 2 levels deep would work, but a better approach would be to set a regex expression to the full file path. Anything that matches this expression get treated as the ‘page’ for that folder.

I can imagine a plugin that has some setting that I would configure like this:

folder-pages:
- ${vault-root}/project-.*/index.md$
- ${vault-root}/idea-.*/index.md$

Which would only treat index.md files inside a directory that is named project-* or idea-* as ‘special’. A file called templates/index.md would not match the configured regex expressions and so it would not be treated specially.

On a side note, I would love to see that sort of option make it’s way to the template plugin so I can have a new note in a specific path automatically use a given template rather than having to pick which template i want via the command pallet.

2 Likes

In the file explorer, this is something I really miss from TiddlyWiki.

Very useful, but not limited to, referring to people. Say, in one note I say to "Enjoyed hanging out with the [[Skywalkers]] today. [[Luke]] was great fun, [[Anakin]] was just grumpy." I would love being able to nest these references under People > Skywalkers > Anakin | Luke. (with “Anakin”, as well as “Luke”, being a separate note.

The current way to go about it is to make “Skywalkers” a folder and with that not being able to reference it. I would love to be able to reference the nesting elements as well. That is especially handy when referring to families in journaling but allow for a variety of use cases, like being able to switch from referencing book titles or specific chapters.

Using folders as a system to categorise notes discourages creativity and hampers making connections. It seems to me like a more associative nature of structuring content rather than folders is more in the spirit of Obsidian.

This is slightly similar to the Nested Tags request but allows for an even greater variety of use cases. Implementation would not change existing workflows if users don’t choose to link to the notes they use as folders.

2 Likes

Maybe there is something that I am missing but there is no need to use folders in obsidian. If you want to use them, they are there. If you want to keep everything in place, that is fine too.

See folders in obisidan are more for keeping some related files together (if you choose so) not so much for organizing a hierarchy of concepts (which as you pointed out might even be a bad thing).

Folders are for something like, I keep my daily notes here. Stuff for my project there. That is it.

Perhaps, in your case, having a file with the same name as the directory would help. However, again, I am not sure how nice or effective it will be to have deep folder structures because you want to replicate a conceptual hirarchy with it.

2 Likes

Wanted to offer the Dendron app as an example for this. Dendron bakes the hierarchy into the filename. Not sure this is the best way forward but wanted to add it to the discussion.

https://www.dendron.so/notes/4bb85c39-d8ac-48ad-a765-3f2a071f7bc9.html

8 Likes

+1 for this feature!

I love this feature request. Unfortunately, I think that this topic has been highjacked by a debate of how to structure data. If you don’t like Folders/Hierarchical structures, that’s totally fine. You don’t have to use it, which is why it’s great that this idea is a plugin idea. It’s optional.

I think Obsidian is best when it is flexible and powerful enough to allow us to organize our data however we want, without forcing us to think in one particular way.

Folders have a major weakness (they force you into a strict one-to-one relationship hierarchy) but this weakness is also a feature. That hierarchy can be a quick and easy way to organize and find information.

Tags and links are great because they free us from the strict rigidity of folder hierarchy but it also adds the burden of responsibility on us to create and follow a good organization system.

The beauty of Obsidian is that it doesn’t force you into any one tool. We can use folders, and tags, and links. They all have their strengths and their weaknesses and if you don’t like one tool, then you don’t have to use it.

@arcandio 's proposal is great because it makes Folders more powerful and modern without weakening the power of tags or links.

In some ways I miss how Notion would treat “Pages” as both “Pages” and “Folders”. There was no difference. Every page could hold more pages. This meant I could easily create a hierarchy organization. But I wasn’t limited to this hierarchy because I could put a page link anywhere I want to any other page. Because “Pages” in Notion are also “Folders” every page acted as an MOC which was nice because I didn’t have to waste time creating MOC’s. They were just already created.

But right now in Obsidian, if I want to easily see all the notes in a folder I have to create an MOC manually within each folder. And as soon as I add or remove notes from that folder, now the MOC is inaccurate and needs to be manually updated. An index could fix these problems.

6 Likes

My thoughts on @arcandio 's proposal:

A Specific Proposal

  1. enabling the plugin makes any file named index.md associated with its containing folder.

Does the plugin create index.md files or have an option to auto-create index.md files. If so could this auto-create feature be toggled on/off, perhaps even on a per folder basis. (Perhaps every folder could have a right-click option called “Create folder index”.

  1. hide any index.md file from the file list or move it to the top of the sort order, so that it’s not cluttering up the file explorer

Yes!!

  1. clicking on a folder with an index file shows the contents of index.md the way clicking on somerandommarkdown.md will show it in the editor / view pane.

Yes!!

  1. (Optional, but high value) Allow users to link to the folder [[some folder]]

Yes!!!

  1. (Optional, relies on #3 above) Allow the hover / mouseover plugin to show the content of links to [[some folder]]

Yes!!

My Proposed addition to the proposal

  1. (Optional) Plugin auto-monitors changes of files within a folder and auto-updates the index.md file to match the contents of the folder.

  2. (Optional but probably necessary if #6 is on): Still allow user to edit index.md after it has been auto updated by the plugin. For example: add links to other notes even if they are in other folders. (May cause conflicts. Not sure.)

  3. Instead of index.md, how about someFolder_index.md and the plugin would simply look for any file that 1) ends in _index.md and 2) begins with someFolder where someFolder is the exact same name as the parent folder. (I think this would probably resolve the naming conflict issue).

I was thinking of something similar. What if the “folder note” was simply the folder name with a leading underscore _folderName.md. One major benefit of this is that it would sort the folder note alphabetically to the top.

3 Likes

For index.md, the main thing to keep in mind is that that naming is the de facto web standard and so would work transparently with anything that uses it (Jekyll/GitHub Pages, Next.js with MDX files, etc). A configurable setting to change the name used for said notes would probably be a good idea, but using index.md out of the box would be the most interoperable with other tools.

4 Likes

I am trying to make a workflow using Obsidian and I must say this problem with nesting files and folders has been the most annoying one for me so far, specially the fact that folder and files are sorted separately. I like the idea of Zettlekasten but it has a very limited function. It would be nice to use Obsidian for our daily needs and not just for a huge research to connect different idea .

4 Likes

I would love to have the option to make hierarchical notes. It would really help me keep the side bar straightened up, help me stay organized, etc. Your idea sounds good.

6 Likes

I love this idea, it’s exactly what I’m looking for!

Not every note is simple, you’ll inevitably have a complex note containing multiple images or other types of attachments, or a complex idea which needs multiple notes to describe it. Folder Note is the perfect place for such notes. All materials for the same note or idea should be in the same location, the folder of the Folder Note.

And I think this should be the internal concept model of Obsidian, plugin is not a good choice for it.

7 Likes

I felt like sharing a (single) concrete example of my workflow for a specific project. I have more uses for this plugin, but I want to illustrate at least one purpose of this plugin to people who don’t understand how or what I’m writing, because it seems like we’re just not on the same page1.

I write a lot of fiction and tabletop roleplaying games. Those projects do indeed require hierarchy, because eventually the printed material will in fact be printed. I need to be able to organize my thoughts into discrete chunks, so that I can focus my writing.

When using a specific outlining tool (uv outliner, scrivener, manuskript, etc) I use a loose version of The Snowflake Method. In the context of my work, that means starting with the broadest possible strokes (breaking up the content of the project into the biggest categories) and then successively subdividing every section until sufficient detail is reached. For example, a rough initial outline might look like this:

  1. Front Matter
  2. Character Creation
  3. Extended Rules
  4. Specific Subsystems
  5. Running the Game
  6. Lore
  7. Creatures

A next level might look something like this:

  1. Front Matter
    1. publishing info
    2. TOC
    3. introductory fiction
  2. Character Creation
    1. Classes
    2. Cultures
    3. Options
    4. Spells
  3. Extended Rules
    1. skill checks
    2. combat
  4. Specific Subsystems
    1. vehicles
    2. Magic Duels
  5. Running the Game
    1. keeping players entertained
    2. planning the game
    3. balancing combat
  6. Lore
    1. world
    2. factions & groups
  7. Creatures
    1. villains
    2. npcs
    3. wandering monsters
    4. gods

Now, in an outliner application I’d be making notes about what goes into each chapter as I do the initial breakdown. As I transition into subdividing each chapter, I’d start working on the frontmatter of each chapter in the chapter section. So if each chapter has a pullquote, then I would at least mock that up with a blockquote. It takes a lot of revision to summarize these chapters, so I start on that as early as I can and continuously rewrite as the content of the chapter and the rules change.

In other words, in this particular workflow I would be using this plugin both in the initial planning of the manuscript as well as in the production of the final manuscript.

Having that built into Obsidian instead of having to use underscores or chapter numbering would just make things that much more straightforward and efficient for me.


As for why, I have never seen a tabletop roleplaying game where the chapter title is immediately followed by a second-level heading, such as the following:

Races of Middle Earth

Elves

The Elves are an ancient race of long eared, annoying, utterly un-dwarven–etc.

As far as I can find, there aren’t any. They always include some kind of summary or preparatory remarks at the start of each chapter. That content isn’t the content of a second order section, it’s second-order content itself. The content is at the same level as the following sections.

  • Heading 1
    • Summary
    • Sub-heading
    • sub-heading

Now, I don’t read a huge amount of scientific research papers, but it seems to me that having chapter summaries is the norm in almost every other kind of writing I can think of, or find in my library.

I also understand that a lot of people are looking at Obsidian as only the first step into their writing process, but I am not. There’s no reason I can’t write an entire project in Obsidian. I am in the process of doing so with 2 separate manuscripts at the moment, and nothing besides not having chapter summaries is really giving me any trouble at all. Conversion from markdown to HTML and then on to publishing is fantastic and much more efficient (by a matter of months) than my traditional process of laying out each page in Adobe Indesign or Affinity Publisher.

I just wish that I could more efficiently associate chapter summary text with a folder that represents a chapter.

Now, I hope I’ve sufficiently justified why I think this plugin would be useful, to at least some people in the community. I encourage everyone who supports this request to chime in with their own specific use case, so that we can show what we’d do with it!


As for improving the plugin proposal, I agree that some sort of regex matching would probably be both highly desirable and necessary in the long run. I believe that index.md is a solid contender because it is the de facto standard (markdown was designed to be translated to HTML after all) but I would definitely prefer for the plugin to be as configurable as is feasible for devs to implement as possible.


1: Pun absolutely intended.

1 Like

Hey i am a new user, so maybe thats why i came here looking for exactly this.
For example:
If i create a new note called “projects” and then in there add different nested articles, the file explorer on the left will grow longer and longer.

In my opinion #foldernotes or whatever they will be called, help decluttering the file explorer. I dont see why a note about “what screws are needed for project X” from the deepest detail levelwould be right next to one about “my food habits”
I mostly use the graph-view for navigation, but occasionally an alternative strictly treelike sorting is good.
Now i end up creating folders with the same name as the note talking about the contents, and this is unnecessary work in my opinion.

The file explorer i see as something that could look similar to dynalist or workflowy.
Because in the graph view you cannot collapse individual notes.

Dunno i hope this clarifies why some people want #foldernotes

2 Likes

+1
Dendron certainly does this. Its approach is based on a tree view plugin that interprets the syntax of file titles. The syntax is based on points “.”, For example:

Food.md
Food.Vegetables.md
Food Vegetables Broccoli.md
Food.Vegetables.Spinach.md
Food.Cereals.md
Food.Cereals.Wheat.md
Food.Cereals.Corn.md
Food.Cereals.Linseed.md
Food.Fruits.md
Food.Fruits.Mango.md
Food.Fruits.Strawberry.md
Food.Fruits.Banana.md

The tree view plugin panel interprets this and shows a folding scheme like this:

  • Food
    • Vegetables
      • Broccoli
      • Spinach
    • Cereals
      • Wheat
      • Corn
      • Linseed
    • Fruits
      • Mango
      • Strawberry
      • Banana

It works almost perfectly, why almost? Because logically when linking to [[Broccoli]] you will get [[Food.Vegetables.Broccoli]] so you will have to use the alternative text [[… | …]]. Depending on who you are, that may or may not be convenient.

Like everyone I really would like this feature or plugin.

Hello, I came to this discussion for the very reason outlined by others, i.e. the need to create subnotes into a note - or, to put it in a different way, to add content and linkability to a folder.

For those like @icouto and others who are experts on the Zettelkasten system, if a note is a macro-topic that can contain completely different sets of information, how would you handle it?

Eg.: Let’s say that I want to create a note called “Morocco” under “European Union Neighbourhood policy (ENP)”: in my mind, that “Morocco” page would contain all information that refers to the strict topic “ENP in Morocco”. At the same time, I could have another main “Morocco” note/folder addressing what pertains to Morocco only, or a sub-note under a folder “Middle East”, etc.

How would the Zettelkasten method replace the hierarchy in this case? Would it simply create a main note “Morocco”, which within time would become very long, or separate mini-notes all called differently (eg.: ENP-Morocco, Middle East-Morocco) with a general tag #Morocco inside each of them?
In the latter case, every time i mention “Morocco” in the context of the ENP should I write [ENP-Morocco]?

Thanks

Anyhow, I would definitely be interested in a plugin allowing the option of subnotes.

2 Likes

I have created an simple plugin to do that, you may have a try. I am not an expert of TypeScript, but the plugin can do what you described.
https://github.com/xpgo/obsidian-folder-note-plugin

4 Likes