Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to see an HTML page on Github as a normal rendered HTML page to see preview in browser, without downloading?

On http://github.com developer keep the HTML, CSS, JavaScript and images files of the project. How can I see the HTML output in browser?

For example this: https://github.com/necolas/css3-social-signin-buttons/blob/master/index.html

When I open this it doesn't show the rendered HTML of the code of author. It shows the page as a source code.

Is it possible to see it as rendered HTML directly? Otherwise I always need to download the whole ZIP just to see the result.

like image 564
Jitendra Vyas Avatar asked Dec 09 '11 13:12

Jitendra Vyas


People also ask

How do I view GitHub files in my browser?

Go to any GitHub repository and then press the dot key on your keyboard. Visual Studio Code will appear in your browser. It will load your entire repository and you can open any file from it. You have your entire source code with syntax highlighting and coloring.

Can you preview the website on GitHub?

You can often preview your web page by loading it directly in the browser as long as you aren't using aren't using AJAX or similar. Opening the HTML file in Explorer/Finder will usually open the file in your default browser.


2 Answers

The most comfortable way to preview HTML files on GitHub is to go to https://htmlpreview.github.io/ or just prepend it to the original URL, i.e.: https://htmlpreview.github.io/?https://github.com/bartaz/impress.js/blob/master/index.html

like image 136
niutech Avatar answered Oct 12 '22 10:10

niutech


If you don't want to download an archive you can use GitHub Pages to render this.

  1. Fork the repository to your account.
  2. Clone it locally on your machine
  3. Create a gh-pages branch (if one already exists, remove it and create a new one based off master).
  4. Push the branch back to GitHub.
  5. View the pages at http://username.github.io/repo`

In code:

git clone [email protected]:username/repo.git cd repo git branch gh-pages # Might need to do this first: git branch -D gh-pages git push -u origin gh-pages # Push the new branch back to github Go to http://username.github.io/repo 
like image 25
Ross Avatar answered Oct 12 '22 11:10

Ross