foam
foam copied to clipboard
markdown links should use readme.md as index file of directory
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
This is interesting, there was a conversation about this on Discord as well: https://discord.com/channels/729975036148056075/729975036664086560/1049379410228301935
A few notes:
- I am wondering whether explicitly linking to a directory by appending the
/
is good or not, still making up my mind about that -
readme.md
kinda makes sense in the context of documentation, some might sayindex.md
would be also good/better? - what happens when no such file is found? from the Discord conversation, the suggestion was to show an "explorer-like" list of the files in the directory
Happy to hear more suggestions, edge cases, and considerations
How about prioritizing
index.md
> README.md
> <name of the directory>.md
> show a explorer view
- index.html is the web standard
- README.md catches github, gitlab and other DevOps defaults
- If you're using dirs to sort by chapters or similar then having a file with the name of the dir makes sense
- If there's nothing of that kind give up and let the user decide
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!
That's interesting, do you have a reference for that chain of defaults?
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
github tree api index file:
- readme.md is used
- index.md is not used
- index.html is not used
- readme.md is preferred over readme.txt
- readme.adoc is preferred over readme.md
- README.md is preferred over readme.md
- readme.markdown is preferred over readme.md
- readme.png is not used
- readme.html is used but rendered as plain text
- readme.svg is used but rendered as plain text
- a custom file like index.md is used when symlinked from .github/readme.md
- ...