git-to-web

root/

📁 test2020-07-02 19:42
🖹 .gitignore[raw]2020-07-02 19:42
🖹 LICENSE[raw]2020-07-02 19:42
🖹 README[raw]2020-07-02 19:42
🖹 directory-view.scm[raw]2024-03-27 22:00
🖹 example-settings[raw]2020-07-02 19:42
🖹 example-settings-eval[raw]2020-07-02 19:42
🖹 file-utils.scm[raw]2020-07-02 19:42
🖹 file-view.scm[raw]2024-03-27 22:00
🖹 html-wrapper.scm[raw]2023-10-04 10:41
🖹 main.scm[raw]2024-03-27 22:00
🖹 path-utils.scm[raw]2020-07-02 19:42
🖹 system-utils.scm[raw]2020-07-02 19:42
🖹 utils.scm[raw]2020-07-02 19:42

Latest Logs

2024-03-27 improve accessibility by adding aria labels
2023-10-04 untested too big handler, idc
2023-10-04 padding right for file views

README

Generates static html view of a git directory.

What git-to-web is:
- a simple way for new people to have a look at the current state of your
  project, so they can figure out what it is about and it's basic
  source structure.
- a quick guide on how to contribute to your project
  by listing:
    - git urls
    - a readme
- easy to setup, no database required,
  you just need guile and some git hook configuration (see below)

What git-to-web is not:
- interactive
- a complete web interface for git and all it's commands
- a generator for persistent links to each revision of your project
- a generator for diffs of all your projects revisions
- a viewer for multiple branches

* How to use

Init example:
  mkdir my-git-project
  cd my-git-project
  git init --bare
  git clone . raw/
  guile -L ~/git-to-web/ -e main -s ~/git-to-web/main.scm
    #-> ./index.html
    #-> ./html/file-in-repo.scm.html
    #-> ./html/dir-in-repo/index.html

You can use the follwing hook/post-update script:
  GIT_TO_WEB=~/git-to-web/
  unset GIT_DIR
  git update-server-info
  cd raw; git pull -f origin master; cd ..
  rm -r html/
  guile -L "$GIT_TO_WEB" -e main -s "$GIT_TO_WEB/main.scm"

Of course you must replace ~/git-to-web/ with your installation path.
You can create a .sh file that automatically sets up a new git directory
with the hooks using the information above.

Settings files:

You can give a settings file with:
  guile -L "." -e main -s "./main.scm" -s settings-example
And eval a scm file and use the result as settings with:
  guile -L "." -e main -s "./main.scm" -e example-settings-eval

You can give -s and -e multiple times. Settings from the last file given will
outrule previous ones.

See example files: example-settings
                   example-settings-eval