foambubble / foam

A personal knowledge management and sharing system for VSCode
https://foambubble.github.io/
Other
15.44k stars 662 forks source link

markdown links should use readme.md as index file of directory #1128

Open milahu opened 1 year ago

milahu commented 1 year ago

Describe the bug

foam navigates to somedir/.md instead of somedir/readme.md

Small Reproducible Example

No response

Steps to Reproduce the Bug or Issue

lets say i have this markdown file

# asdf

[somedir/](somedir/)

then Control-Click on [somedir/](somedir/) navigates to somedir/.md

Expected behavior

foam should use somedir/readme.md as the index file of the somedir/ folder

... or show a directory listing, if there is no index file

my goal is a "buildless" wiki on the github blob api so readme.md is the default index file, and i can use only markdown links

Screenshots or Videos

No response

Operating System Version

x

Visual Studio Code Version

x

Additional context

No response

riccardoferretti commented 1 year ago

This is interesting, there was a conversation about this on Discord as well: https://discord.com/channels/729975036148056075/729975036664086560/1049379410228301935

A few notes:

Happy to hear more suggestions, edge cases, and considerations

stefanfritsch commented 1 year ago

How about prioritizing

index.md > README.md > <name of the directory>.md > show a explorer view

j6k4m8 commented 1 year ago

How about prioritizing

index.md > README.md > .md > show a explorer view

👍 My understanding is that this chain of defaults (at least index.md and readme.md) is the same as how github.com chooses docs to render in a repo directory, which feels good and consistent!

riccardoferretti commented 1 year ago

That's interesting, do you have a reference for that chain of defaults?

j6k4m8 commented 1 year ago

Unfortunately not — I've looked and it looks like it doesn't exist anywhere in the docs... I can try to make a demo repo at some point to test

milahu commented 1 year ago

github tree api index file: