Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Also works with gists... #125

Open
oaustegard opened this issue Dec 21, 2022 · 1 comment
Open

Also works with gists... #125

oaustegard opened this issue Dec 21, 2022 · 1 comment

Comments

@oaustegard
Copy link

oaustegard commented Dec 21, 2022

Not an issue, more of a PSA: this also works with the raw url of an html gist (public or private).

See e.g.
https://htmlpreview.github.io/?gist.githubusercontent.com/oaustegard/a1902d995b5c6157a9eaf69afa355723/raw/helloworld.html

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

@oaustegard
Copy link
Author

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant