I am confused and could use more help.
Each of my students has a repo and I have asked them to do the following as an exercise.
- Create a branch in GIT
- Edit the provided HTML file so it is correct
- Commit the changes
- Push to GitHub
- Create a PR on GitHub with a message stating “Submit project xx”
- Merge into master…and keep working on next assignment.
( I would skip the PR all together if I could figure out how to do that as all I really need is an “official” commit stating that this is the submittal )
Now I want to review their HTML and make sure it validates and looks as expected, etc etc.
It seems that the validation could be automated but based on the incredibly cryptic descriptions it seems like way too much trouble to automate.
On GitHub I can view a particular student’s PR…and comment on specific code if I want, but how do I actually open it in a browser to view the HTML page?
I think I would need to clone each student’s repo onto my local machine, then when I want to grade an exercise, pull from github … and then work locally to look at it.
Is there a better way to review webpages they are creating?
Also, if I find a problem in their HTML, where do I comment on it? Do I have to figure it out locally, then open GitHub and comment on it there?
Any guidance would be appreciated.
To answer your main question: you can use http://htmlpreview.github.io/? as a prefix to the GitHub URL (there’s a bookmarklet there to simplify the process).
However, looking at your assignment, I would surmise you’d rather have your students fork the repo and commit their changes to their fork. I’d suggest having them:
- create a fork of the repo in their own Github account
- edit the HTML
- commit to master
- enable GitHub pages https://pages.github.com
- Create a PR to your repo… to indicate they’re ready for review.
In this way, each student has his own repo (no risk of branch name collision) where you can easily view the HTML file. You still have to deal with the multitude of similar PRs, but you can choose to close them without incident, and once you get to a clean base for assignment #2 you can ask that they all pull from the upstream (your) repo.
Have you tried https://rawgit.com? This service can host static files from Git repositories. I guess, it’s not going to work if the repo is private, though.
It seems so. I don’t know about any ready-to-use tool to assist your quest of live-commenting HTML code to GitHub. Maybe your’ve chosen the wrong tool and something like JsFiddle (where you can easily add comments to the code without leaving the browser tab) will fit your teaching style much better than GitHub.
Thanks for the feedback… forgot about jsfiddle… that may do the trick.
I want to use github primarily so students get exposed to it, and to simplify delivering “starter” code.
I’m looking for a similar solution. I don’t need to comment on the code, I just want to run the HTML and associated scripts to see how they render. Does htmlpreview work with private repositories?
I use the mocha test framework to urn unit tests on html & css files, then set up travis to run the tests on submission of a PR. It’s not perfect and I haven’t completely finished my marking system, but will try to write something up when I have a chance. Meanwhile, I’ve collected my thoughts in this thread, and you can see my assignments at the organization page for my class. Happy to try to fill in the blanks if I can just find time to write my afternoon lecture first!