Uploading html file in github - html

I have created a html file using R markdown, and when I open it in browser, it looks exactly how I want. But if I upload the same html file in github and open there, it gives me totally different outlook.
https://github.com/syedaash/ML-Project/blob/main/ML_project.html is the link of my html doc in github, which is not I want. But if I open the html file from my local computer in a browser it's good. Why is that and what to do?

GitHub does not automatically load and render an HTML file because GitHub is about code, therefore going straight to any file will display the internals of that file, not how it would be rendered on a browser.
The HTML Preview project has a way to render HTML files hosted on GitHub, you can just append your HTML path like so and put it on your README for example:
https://htmlpreview.github.io/?https://github.com/syedaash/ML-Project/blob/main/ML_project.html
However, I would recommend that you look into creating a GitHub Page for your project, you only need to make a few changes and turn it on and you got it.
Edit: So I checked on your status #Alex and it looks like you created the GitHub Page for your GitHub profile, which is not rendering your profile properly. Maybe this tutorial from codeacademy will be easier to understand that you can get GitHub Pages rendered for EVERY repo if you wish. You can see I do that with my own simple project with its live site.

If you want to see the output of the file (what it looks like when opened in a browser, you have to enable Github pages for your repository, more here. The link you sent is just the HTML text file that you have written, not what it actually would look like in a browser. Github pages hosts the HTML text file (link you sent) so that you can actually see it in a browser window.

GitHub is to share code not to deploy website. So now you should use GitHub Pages this is my sample website Hariienesh1901 hosted by GitHub Pages. See tutorial from GitHub https://guides.github.com/features/pages/

Related

when people go to my website it shows all my files and not the landing page of my website -mclosed

when I go to my website directory it shows all my files and not to my landing page, is there a way to fix this? I have tried everything even looked through the internet without any clear response. I am close to finishing my website I only need to resolve this problem.
Thank you!
The issue seems to be that you are not on the HTML file, but on the folder.
To fix this issue, you have to redirect yourself to the HTML landing page.
/ar/home.html
This should show your HTML landing page correctly rendered.
Tip: Normally, the main page is called index.html by convention. This can be helpful. For example, the Live Server extension on Visual Studio Code will automatically go to index.html if the file isn't specified. Other hosting services, like GitHub Pages, also do the same.
None of the extensions, IDEs and hosting services listed above are sponsored! They are just used for the sole purpose of examples.
In conclusion, you need to go to the HTML file, instead of the folder.

Viewing interpreted HTML, rather HTML source, on github and gist

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:
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?).
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?
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.

Github index.html and MVC

I seem to be running into a problem. I am wanting to upload my website to github but see that one needs to have the main page as index.html. This is an issue as i have created an empty ASP.NET MVC application with views and controllers that have the .cshtml tag.
How can I create an index.html as the main page and then call my other main page which will be a view, this way all I am doing is getting github to look at index.html and then my main page will be displayed? by index.html calling it.
I have tried to use the following as I saw them mentioned in a few other posts but can not seem to get it to work, I know that it did change my URL but still displayed index.html
routes.IgnoreRoute("");
Here is a picture of my project folder layout
Thanks for the the future reply's! Sorry if this post is a bit messy it is my first time posting here. TO add i am trying to host on gitHub through username.github.io
As far as I know Github does not support ASP.NET, but you can use a free Azure account. Take a look at:
http://www.asp.net/hosting
find answer by S.Spieker
kindly have a look on Deploying from ASP.Net MVC to GitHub Pages using AppVeyor if you want to do via AppVeyor

Images don't show up in GitHub Pages

I have a website on GitHub pages. When I tried to incorporate an image in a post.md file, the image works in the GitHub, but not in the website.
I wrote ![](images/em.png) in the Markdown file and it looked good when I saw the preview of changes. However, when I look at the website I've created, it doesn't work and shows a question mark like this:

IFrame of local HTML file not displaying in Jupyter nbviewer

I'm trying to share a Jupyter Notebook containing some regresison results (in an IFrame) with my university lecturer because I need to ask him something. The regression results are in a HTML file, generated from the stargazer library in R. The notebook can be viewed here: http://nbviewer.jupyter.org/urls/dl.dropbox.com/s/vnt875efjwqbi2g/regressions.ipynb?flush_cache=True. Is there any way to render a local HTML file in the notebook without it breaking for other people? I have tried using nbconvert to convert my notebook to HTML, but though I can see the IFrame properly, others cannot.
The folder is synced to Dropbox, and currently what I see in the IFrame is just this error:
Error (403)
It seems you don't belong here! You should probably sign in. Check out our Help Center and forums for help, or head back to home.
Of course, I could link my lecturer to the HTML file that contains the results, but that is not optimal because he has to jump between the nbviewer page for the code and the results page for the results.
I've figured out a workaround. Since the HTML results file is hosted on Dropbox, this answer explains how to access the contents of the HTML file directly from a Dropbox shared link. I can then display the IFrame using the Dropbox link instead of my local file.