0

I find the answers to What is the difference between GitHub and gist? unsatisfying, and I'm wondering if the difference (partially) lies in their treatment of HTML. In particular, I'm wondering:

  1. Is it possible to point others to an HTML file on github.com such that when they view the file, they view the HTML page rather than its source? Normally on github, and even when the extension in the URL bar is .html, the HTML code is not interpreted by the browser (why?).
  2. When an HTML page is viewed on gist.github.com, the HTML page is indeed seen rather than its source. Is this the main (or a main) feature of the difference between github and gist?
Calaf
  • 10,113
  • 15
  • 57
  • 120
  • 1
    Github is a site dedicated to organization and presentation of code, most of which wouldn't run in a browser on its own. Why would you expect HTML files in particular to deviate from that? See also: https://pages.github.com/ – isherwood Feb 20 '20 at 21:44
  • Do you have a link to an HTML file on Gist? – isherwood Feb 20 '20 at 21:49

1 Answers1

1

Is it possible to point others to an HTML file on github.com such that when they view the file, they view the HTML page rather than its source?

Only by using Github Pages

Normally on github, and even when the extension in the URL bar is .html, the HTML code is not interpreted by the browser (why?).

Because the purpose of Github is to manage code, not to host webpages.

URLs do not have file extensions. Browsers determine what to do with content based on the Content-Type header.

When an HTML page is viewed on gist.github.com, the HTML page is indeed seen rather than its source. Is this the main (or a main) feature of the difference between github and gist?

It doesn't when I test it.

Github proper is for hosting Git repositories.

Gist is for showing ad-hoc code samples managed by git, but without the full interface to the repository.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335