Support repos "without source code"
Summary 💡
It would be great to have some onefetch work on repositories currently considered as "without source code", but with plain text or markdown.
Motivation 🔦
Plain text repos are a real thing and there are even very popular tools specifically to do this (hello https://github.com/Vinzent03/obsidian-git), so I believe these repos deserve the same beautiful information display as repos with real code.
Markdown is supposed to be supported, but it looks like it's not considered by onefetch at all. I believe it makes sense that languages like markdown don't count in fields like lines of code and languages but all other fields are still relevant (and Tokei already gives data for markdown and plain text, and even languages inside code blocks).
In a case that is currently detected as "without source code", irrelevant fields should be removed or their meaning could be adapted (logo corresponding to the most used format, same for languages, lines of code become lines of text, etc).
Currently, it's possible to add one (almost empty) python file to allow info to be displayed, but it's a silly solution in my opinion.
I don't think we support plain text, but we do support Markdown.
Check out the -T option.
That's beautiful! I'm sorry I missed this!
Plain text could still be considered as data, but it certainly isn't the most critical feature.
I think it could be useful to include plain text as a new supported language. Like you said, there are some repositories which are only plain text. Would you like to make a PR to add that language?
I agree, the tool could be more robust. When no source is detected, we should still display some information about the repo instead of returning an error.
Perhaps we can fall back to a "fake" language called "unknown"? That way we can keep most of the structure intact, and have an ASCII question mark.
Another option would be a fallback equivalent to --type prose programming markup data (all types) in case there is no code for the actual types passed as arguments, perhaps with a warning. There would still be cases that would return an error though.
Yes, I’ll look into adding plain text