No description
Find a file
m455 0a9518c2e4 Fixed a bug that broke links to files if a readme wasn't present
There was a bug that caused a double "html/html" in front of the link
URLs for each file listed in the "Files" view.

This PR fixes this. It's an ugly fix, because I just replaced "html"
with "" as the function argument, but it works? haha. Feel free to do
this the proper way, if such a way exists!
2023-02-01 23:27:56 -05:00
assets distinguish between repo name and repo path 2022-12-26 10:49:17 -08:00
docker keep the docker image around for quicker compiles the next time 2022-12-18 11:57:18 -08:00
documentation small tutorial fix 2022-12-20 01:36:28 -05:00
ISSUES add some data for issue tracker 2022-12-12 11:07:26 -05:00
.gitattributes remove some env vars; make output land in html/ 2022-12-18 10:19:36 -08:00
.gitignore lightened shade of the default pink 2022-12-02 16:47:20 -05:00
.mailmap map e-mail addresses to canonical names! 2022-12-10 20:17:13 -05:00
LICENSE added license :) 2022-12-04 00:51:48 -05:00
main.scm Fixed a bug that broke links to files if a readme wasn't present 2023-02-01 23:27:56 -05:00
Makefile put message about docker image after docker build, before compile 2022-12-22 21:03:35 -08:00
README.md remove manual html/ prefix 2022-12-26 21:58:30 -08:00

repo2html

A command-line tool that generates a static HTML representation of a Git repository.

Page contents

Features

  • Static html files
  • Customizable templates
  • Can be used as a standalone command-line tool, or in a Git hook
  • Built-in, plaintext issue support
  • Image support
  • Markdown files are rendered as HTML
  • No resident background process

Requirements

Usage

repo2html <destination> <template-directory>

Run repo2html inside the root directory of a Git repository or a bare Git repository.

  • <destination> is the path to the directory that you want the HTML files to be generated in.
  • <template-directory> is the path to the directory that contains a default.html file. Refer to assets/templates/default.html for an example default.html file.

The HTML that's generated represents the state of the HEAD commit, not the current state of the work tree.

Installation

This section guides you through installing the required dependencies, compiling a binary, and then installing the binary. By default, repo2html installs into the /usr/local/bin directory.

  1. Ensure you're in the repo2html git repository.
  2. As root, run make dependencies to install the required Chicken Scheme eggs.
  3. Run make to compile a static repo2html binary in the current directory.
  4. As root, run make install to copy the repo2html binary into the /usr/local/bin directory.

Note: If you want to use main.scm as the repo2html executable, instead of compiling a static binary file, then run cp main.scm /usr/local/bin/repo2html as root.

Configuration

You can repo2html by changing the following items:

Templates

You can customize repo2html by editing the assets/templates/default.html, and then specifying the path to the default.html file as the second command-line argument when running repo2html.

For example, if you placed a default.html file in ~/bin, and you serve HTML files from /var/www/git, then you run repo2html /var/www/git ~/bin.

Environment variables

You can provide a generic description by setting the REPO2HTML_DESCRIPTION environment variable, or by adding a description in a description file in the root directory of your Git repository.

Creating a Git forge on your web server

Refer to Create a Git forge with repo2html to learn how use repo2html in a post-receive hook to auto-generate HTML representations of bare Git repositories on a remote web server after you git push to them.

Alternative Git-to-HTML tools

Existing Git forges

Existing Git forge software

Todos

  • documentation/feature: use post-update rather than post-receive hook for simplicity
  • documentation: also describe use with post-commit hook
  • documentation: describe readme, license, and issues behaviours
  • feature: multi-page or collapse-able files list
  • feature: branches and releases (tags)
  • feature: diffs for each commit
  • feature: clickable line numbers in source files
  • feature: display binary files as output from binary-file analysis tools like hexdump, xxd, dumpelf, elfls, readelf, etc.?
  • feature: syntax highlighting?
  • feature: markdown-render git log text
  • feature: other mechanisms for header id application like uniqueness checking, sequential numbering
  • feature: remotes, upstream identification, and tracking branch status