在http://github.com开发人员保持HTML, CSS, JavaScript和图像文件的项目。如何在浏览器中看到HTML输出?

例如:https://github.com/necolas/css3-social-signin-buttons/blob/master/index.html

当我打开这个,它不显示渲染的HTML代码的作者。它以源代码的形式显示页面。

是否有可能将其直接视为呈现的HTML ?否则,我总是需要下载整个ZIP才能看到结果。


当前回答

此外,如果你使用Tampermonkey,你可以添加一个脚本,将添加预览http://htmlpreview.github.com/按钮到操作菜单旁边的'raw', 'blame'和'history'按钮。

像这样的脚本: https://gist.github.com/vanyakosmos/83ba165b288af32cf85e2cac8f02ce6d

其他回答

如果你已经配置了GitHub页面,你可以得到你的公共url,如:

https://<username>.github.io/<repository>/index.html

哪里<用户名>和<存储库>将分别为用户名和回购名称占位符

所以,结果是这样的: http://necolas.github.io/css3-social-signin-buttons/index.html

如果它是一个在所有存储库中启用GithubPages的组织,它将是这样的:

https://<org>.github.io/<repository>/

在GitHub上预览HTML文件最舒服的方法是访问https://htmlpreview.github.io/或直接将其添加到原始URL前,即:https://htmlpreview.github.io/?https://github.com/bartaz/impress.js/blob/master/index.html

我读了所有的评论,认为GitHub让普通用户创建GitHub页面太难了,直到我访问了GitHub主题页面,其中明确提到,在相关回购的设置页面下有一个“GitHub页面”的部分,在那里你可以选择“使用GitHub页面的主分支”选项,voilà!!在https://username.github.io/reponame上签出特定的回购

如果你不想下载一个存档,你可以使用GitHub Pages来渲染这个。

将存储库转移到您的帐户。 在您的机器上本地克隆它 创建一个gh-pages分支(如果已经存在,则删除它并基于master创建一个新的分支)。 将分支推回GitHub。 浏览网址:http://username.github.io/repo”

在代码:

git clone git@github.com: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

此外,如果你使用Tampermonkey,你可以添加一个脚本,将添加预览http://htmlpreview.github.com/按钮到操作菜单旁边的'raw', 'blame'和'history'按钮。

像这样的脚本: https://gist.github.com/vanyakosmos/83ba165b288af32cf85e2cac8f02ce6d