README.md (2266B)
1 gout 2 ==== 3 4 `gout` is a static git repository builder designed to be output-compatible with 5 the excellent `stagit` tool, but adds support for multiple output formats in the 6 same binary: html (-H), gopher (-G), and gemini (-M). 7 8 Prerequisites 9 ------------- 10 11 To build, the following tooling must be installed on the system: 12 * [gn](https://gn.googlesource.com/gn) 13 * [ninja](https://github.com/ninja-build/ninja) 14 * A [clang](http://clang.llvm.org) toolchain 15 16 To build and run, the following libraries must be installed on the system: 17 * [libgit2](https://libgit2.org) 18 19 20 Building and running 21 -------------------- 22 23 First, edit `.gn` as necessary to set the `system_include_dirs` and 24 `system_lib_dirs` for your system. 25 26 Next, generate the ninja build files under the `out` directory: 27 28 gn gen --args=is_debug=true out/debug 29 gn gen --args=is_debug=false out/release 30 31 32 ### Unit tests 33 34 To build and run the unit tests, run: 35 36 gn gen --args=is_debug=true out/debug 37 ninja -C out/debug :gout_tests 38 ./out/debug/gout_tests 39 40 or 41 42 make test 43 44 45 ### Executable release-mode binary 46 47 To build and run the binary: 48 49 gn gen --args=is_debug=false out/release 50 ninja -C out/release :gout :gout_index 51 ./out/release/gout 52 ./out/release/gout_index 53 54 or 55 56 make release 57 ./out/release/gout 58 ./out/release/gout_index 59 60 61 Background 62 ---------- 63 64 `gout` started as a set of small refactorings of `stagit` written primarily to 65 separate git logic from formatting logic in order to experiment with merging 66 gopher support into the same tool, and eventually add gemini support. Things got 67 a bit out of hand and I'm embarrassed to say the code now reads a bit more like 68 Enterprise Stagit. 69 70 In my defence, the final compiled binary is still small; under 56 kB on FreeBSD, 71 yet it includes support for HTML, gopher, and gemini output. It would be 72 worthwhile trying to simplify the code a bit, now that things are separated out 73 and the formatters are now effectively pluggable. 74 75 76 Patches welcome 77 --------------- 78 79 Patches are more than welcome via [`git send-email`](https://git-send-email.io): 80 ``` 81 $ git config sendemail.to "Chris Bracken <chris@bracken.jp>" 82 $ git send-email ... 83 ``` 84 or alternatively, generate the patches via `git format-patch` and email them 85 manually.