Re:Stagit – A static Git page generator
by DorothySim on Wednesday August 02, 2017 @06:11AM
(#14909345)
> What I'd really like to see is a JS implementation of the "dynamic" features like diffing
That's possible. I've made something like that (dynamically fetching git info via dump HTTP server protocol) using Git.js [0] although for a different reason and it worked very well. Some caveats: the decompression must be handled in a WebWorker or the UI is stuck pretty easily. But objects can be fetched on demand so it's kind of like Microsoft's Git Virtual FS. As you've said cross origin policies apply so either have the viewer on the same site as repos or add appropriate CORS headers.
[0]: https://github.com/yonran/git.js
I see git.js even has a "repo-viewer" demo [1]. Although it's very primitive it shows the ref list and diffs.
[1]: https://github.com/yonran/git.js/blob/master/demos/repo-view...
I'll take a look at stagit, since it might be saner (plus the resulting pages look nicer, and I can stop maintaining my own patches to git2html).
What I'd really like to see is a JS implementation of the "dynamic" features like diffing, so rather than having to pre-compute and store them, they can be generated on demand on the client-side by fetching the required git objects, etc. over HTTP (would presumably require a clone to be accessible on the same domain as the HTML). That way, everyone gets the plain pages like now, but those enabling JS can browse repos more thoroughly.