commit
message
Rough docs for readme, build command for Make.
author
Ben Vogt <[email protected]>
date
2023-04-05 16:08:12
stats
2 file(s) changed,
89 insertions(+),
0 deletions(-)
files
Makefile
README.md
1diff --git a/Makefile b/Makefile
2index 643e7a6..3b0d0be 100644
3--- a/Makefile
4+++ b/Makefile
5@@ -22,6 +22,9 @@ clean:
6 target/gshr-${OS}-${ARCH}-${ENVIRONMENT}.bin: Makefile target $(wildcard *.go)
7 go build -o target/gshr-${OS}-${ARCH}-${ENVIRONMENT}.bin $(wildcard *.go)
8
9+build: Makefile target target/output target/cloning target/gshr-${OS}-${ARCH}-${ENVIRONMENT}.bin
10+ @# intentionally blank, proxy for prerequisite.
11+
12 dev: Makefile target target/output target/cloning target/gshr-${OS}-${ARCH}-${ENVIRONMENT}.bin
13 ./target/gshr-${OS}-${ARCH}-${ENVIRONMENT}.bin \
14 --config=$(PWD)/gshr.toml \
15diff --git a/README.md b/README.md
16index 8b260b9..f0a4bc0 100644
17--- a/README.md
18+++ b/README.md
19@@ -1,3 +1,88 @@
20 # gshr
21
22-Git static host repo.
23+> Git static host repo.
24+
25+Command line tool for generating stand-alone, static git html hosting. Produces a single output
26+directory for multiple repos, with html files for most preview-able text files, commit log, and
27+more.
28+
29+---
30+
31+## Usage
32+
33+```
34+Usage of gshr:
35+ -clone string
36+ Dir to clone into. Default is /tmp/${rand}
37+ -config string
38+ Config file.
39+ -output string
40+ Dir of output.
41+ -silent
42+ Run in silent mode.
43+```
44+
45+The toml file needs to be in the format:
46+
47+* `base_url`: String for base url that this site will be served from. Eg: `"/"` or
48+ `"https://mysite.com/git/"`.
49+* `site_name`: String overall site name. Displayed on the main index.html page that lists all
50+ repos.
51+* `repos` List of data for each repo.
52+ * `name`: String for rendering the name of this repo.
53+ * `description`: String for rendering the description.
54+ * `url`: String of the local absolute path, `git://`, `http://`, or `https://` url of the repo.
55+ * `published_git_url`: String of where the repo lives. Eg: `[email protected]:vogtb/gshr.git`
56+
57+---
58+
59+## Output
60+
61+```text
62+{output_dir}
63+ index.html
64+ {repo_name}
65+ log.html
66+ commits
67+ {hash}/commit.html
68+ files.html
69+ files
70+ {full_file_name}/file.html
71+```
72+
73+For example:
74+
75+```text
76+output
77+├── favicon.ico
78+├── gshr
79+│ ├── commit
80+│ │ ├── 069606b3fcd2f96fc4349943326fb31f9d3c561f
81+│ │ │ └── index.html
82+│ │ │ ...
83+│ │ │ ...
84+│ │ └── fe47541cb62d6f513734089afda72ddefe672924
85+│ │ └── index.html
86+│ ├── files
87+│ │ ├── LICENSE
88+│ │ │ └── index.html
89+│ │ ├── Makefile
90+│ │ │ └── index.html
91+│ │ ├── README.md
92+│ │ │ └── index.html
93+│ │ │ ...
94+│ │ │ ...
95+│ │ ├── main.go
96+│ │ │ └── index.html
97+│ │ └── templates
98+│ │ ├── commit.html
99+│ │ │ └── index.html
100+│ │ │ ...
101+│ │ │ ...
102+│ │ └── partials.html
103+│ │ └── index.html
104+│ ├── files.html
105+│ └── log.html
106+├── gshr.css
107+└── index.html
108+```