idan / gistio

A gist-backed pretty display for markdown.
https://gist.io
MIT License
484 stars 41 forks source link

Support multi-file gists which have one markdown file #75

Open Daenyth opened 5 years ago

Daenyth commented 5 years ago

It seems like this should "just work" vs having one markdown file in isolation.

Potherca commented 5 years ago

As far as I can tell, the first file is chosen (which might not be a markdown file).

This is because the used URL is https://gist.githubusercontent.com/${user}/${id}/raw rather than an API call. So as a work-around, making sure the desired markdown file is listed first resolves your issue.

The trick I use is naming the first file README.md and keeping all other filenames lowercase. That way the markdown file is always first.

Besides just markdown, other textual formats are also supported (like HTML and Restructured Text).

This would lead to addition logic being needed if this were to be implemented. For instance, if there are more than one format present in one gist, how would the logic know which one to pick?

Other issues aside, making an API call would allow implementing https://github.com/idan/gistio/issues/43

Daenyth commented 5 years ago

Weird; when I load this I get a blank page, but the first file in it is markdown.

Daenyth commented 5 years ago

Aha, <noscript>You need to enable JavaScript to run this app.</noscript>

Daenyth commented 5 years ago

Actually that doesn't explain it, ublock says it blocked 0 requests on that page, and I don't have any blanket javascript blockers.

Potherca commented 5 years ago

Looks like you missed the @ character in your link:

https://gist.io/Daenyth/28243952f1fcfac6e8ef838040e8638e ➡️ https://gist.io/@Daenyth/28243952f1fcfac6e8ef838040e8638e