Also works with gists...
oaustegard opened this issue · comments
Not an issue, more of a PSA: this also works with the raw url of an html gist (public or private).
rendering the helloworld.html file in https://gist.github.com/oaustegard/a1902d995b5c6157a9eaf69afa355723
Note: you likely have to strip the revision identifier from your raw gist's url
If your gist only contains the one file you can simply use the https://gist.githubusercontent.com/oaustegard/a1902d995b5c6157a9eaf69afa355723/raw url
=> https://htmlpreview.github.io/?gist.githubusercontent.com/oaustegard/a1902d995b5c6157a9eaf69afa355723/raw
If any users are interested in "hosting" their own version to specifically surface their own gists, take a look at the fork at
https://github.com/oaustegard/oaustegard.github.io/blob/main/pv.html and
https://github.com/oaustegard/oaustegard.github.io/blob/main/scripts/htmlpreview.js
It allows surfacing your own gists with a short url like https://austegard.com/pv?a1902d995b5c6157a9eaf69afa355723 rather than the lengthy generic version above
(*also includes the license/attribution back to this repo)