git-to-html

command module
v0.0.0-...-60cfb24 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 1, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

README

How to Compile

Using Go

Run the following command

go build

Using Nix

Run the following command

nix build

How to Run

After Building

If you built using nix, the binary will be at results/bin/. If you built using go, the binary will be in the root directory.

Run the following command

go-to-html path/to/repository "repository name goes here"

Using Nix

Run the following command

nix run . -- path/to/repository "repository name goes here"

What Gets Generated?

Inside the public directory we have the following:

  1. ref.html --- This is the entry point for the repository and will display tags and branches
  2. c --- This folder contains html files corresponding to each commit with the commit hash as the file name
  3. {branch_name} --- A folder for each branch in your repository is additionally made.
  4. {branch_name}/t --- This will contain the tree representation of your repository including seperate html for each folder and file.

Styles

Currently, the generated html looks for a static/style.css one folder above the root (one folder above public). This will change soon to be specified by the caller.

Todos

  1. Better styling
  2. Allowing two compiling styles, one with the templates contained in the binary and one with the templates external.
  3. Better representation of commit diffs for merges

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
This code comes from the go-git repository's unified encoder I've replicated it here so that I can access line types for rendering in HTML See https://github.com/go-git/go-git/blob/master/plumbing/format/diff/unified_encoder.go
This code comes from the go-git repository's unified encoder I've replicated it here so that I can access line types for rendering in HTML See https://github.com/go-git/go-git/blob/master/plumbing/format/diff/unified_encoder.go

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL