gtx


 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
## about

Go based [`git2html`](https://github.com/Hypercubed/git2html) remake with custom templating support to help when using `git(1)` as an archival tool basically. Because an HTML copy of your commit history is just enough in many cases, such as if aiming to simply publish solo projects for example.

## setup

Download from GitHub directly:

```
go install github.com/thewhodidthis/gtx
```

## usage

What flags and options are available?

```sh
$ gtx --help
usage: gtx [<options>] <path>
  -b value
    	Target branches
  -f	Force rebuild
  -n string
    	Project title (default "Jimbo")
  -q	Be quiet
  -s string
    	Source repository
  -t string
    	Page template
  -u string
    	Source URL (default "https://host.net/project.git")
```

Calling without any arguments prints out the default settings. At the very least pass it a repo to be parsing through:

```sh
# NOTE: Will save output in the current directory.
gtx -r https://github.com/thewhodidthis/gtx.git
```

Silence the logger:

```
gtx -r https://github.com/thewhodidthis/gtx.git -q
```

Templates can reference external files in the target directory. These are left intact across script runs making it easier to theme the output by linking in stylesheets and other assets as required. Use the `-t` flag to specify a custom template:

```
gtx -r https://github.com/thewhodidthis/gtx.git -t page.html.tmpl
```

Export a copy of the default HTML page template and quit:

```
gtx -r https://github.com/thewhodidthis/gtx.git -e
```

Only process select branches in order of appearance:

```
gtx -r https://github.com/thewhodidthis/gtx.git -b main -b develop
```

## requirements

- `git(1)`

## see also

- [Original GH mirror](https://github.com/Hypercubed/git2html)
- [Perl version](https://github.com/mmitch/git2html)