The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 2,977 other subscribers

Some experience of htmlpreview.github.io as a replacement for rawgit.com

Posted by jpluimers on 2022/12/01

With [Wayback/Archive] rawgit.com having sunset years ago, but still having a [Wayback/Archive] few links to it from my blog, it was time to take a closer look at the alternative [Wayback/Archive] htmlpreview.github.io.

First of all, htmlpreview needs more examples. I might submit a pull request for it later, as it is open source at [Archive/Archive] htmlpreview/htmlpreview.github.com: HTML Preview for GitHub Repositories.

Second, some actual example URLs, based on content I previously accessed through rawgit.com.

But first a new example which I created after rawgit.com died, and really required me to look into alternatives like htmlpreview: a gist referenced from a blog post that got live this summer: Some links on PostScript books and online content, back from the days.

It resulted in this html gist: [Wayback/Archive] The rainbow of PostScript related books by Adobe. with link gist.github.com/jpluimers/9a50d0ba14fe975906ea8788a352e269 (the full html is below the signature).

From that, if the gist has just one html file, two htmlpreview links will work exactly the same:

  1. htmlpreview.github.io/?https://gist.githubusercontent.com/jpluimers/9a50d0ba14fe975906ea8788a352e269/raw/
  2. htmlpreview.github.io/?https://gist.githubusercontent.com/jpluimers/9a50d0ba14fe975906ea8788a352e269/raw/cde35d4a6b55050206d70daa597d04590585a419/PostScriptBooks.html

If you have multiple html files in your gist, then you need to specify the actual html file, but with one you can omit the cde35d4a6b55050206d70daa597d04590585a419/PostScriptBooks.html part.

A few remarks before trying other URLs:

The other still relevant gist is mentioned in my blog post Decode URLs from The Great Suspender after a browser restart fails to reload them, and is at [Wayback/Archive] Decode URLs from The Great Suspender after a browser restart fails to reload them.

Since this is a single-html-file gist, the raw file is at both these URLs:

The htmlpreview URLs then are these:

What I really like about htmlpreview is that the original gist URLs are still clearly visible, so it is easier to switch back to the original gists.

The innards of htmlpreview

Another thing I like is that it is a very small code base which is easy to grasp. If you want to learn, then take a look here:

It either does CORS (Cross-origin resource sharing) proxying itself or makes use of api.codetabs.com as CORS proxy service so I did a quick search for [Wayback/Archive] “https://api.codetabs.com” – Google Search revealing that too is both open source (so you can host it yourself) and easy to use:

References

–jeroen


Full HTML of gist.github.com/jpluimers/9a50d0ba14fe975906ea8788a352e269:

https://gist.github.com/jpluimers/9a50d0ba14fe975906ea8788a352e269

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

 
%d bloggers like this: