-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
14 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
# Examples | ||
|
||
There are few target files: | ||
- [`config.go`](./config.go) has a simple type `Config` with a few documented fields. It has | ||
`go:generate` directives to call `envdoc` with different params to build | ||
documentation in different formats: [`config.md`](./config.md), [`config.html`](./config.html) and [`config.txt`](./config.txt). | ||
- [`complex.go`](./complex.go) has multiple types, and this file tries to cover all possible cases | ||
of field tags and type comments. Also, it has more `go:generate` directives to | ||
produce documentation not only in different formats but it uses different options | ||
for `envdoc`, e.g. there you can find `-no-styles` and `-env-prefix` options: [`complex.md`](./complex.md), [`complex.html`](./complex.html), | ||
[`complex.txt`](./complex.txt) for default markdown, HTML and text documentation files; [`x_complex.md`](./x_complex.md) with | ||
envprefix parameter; [`complex-nostyle.html`](./complex-nostyle.html) is HTML documentation without built-in styles. | ||
- [`envprefix.go`](./envprefix.go) has nested config structure with `envPrefix` tag for structure field. It generates [`envprefix.md`](./envprefix.md). | ||
- [`config.go`](./config.go) contains a simple type `Config` with several documented fields. It includes | ||
`go:generate` directives to call `envdoc` with different params, creating | ||
documentation in various formats: [`config.md`](./config.md), [`config.html`](./config.html) and [`config.txt`](./config.txt). | ||
- [`complex.go`](./complex.go) features multiple types, covering a broad range of field tags and type comments. | ||
Additionally, it includes more `go:generate` directives to | ||
produce documentation in not only different formats but also using various options | ||
for `envdoc`. For instance, options such as `-no-styles` and `-env-prefix` are utilized here. The outputs include [`complex.md`](./complex.md), | ||
[`complex.html`](./complex.html) and [`complex.txt`](./complex.txt) for standard markdown, HTML and text documentation, respectively; | ||
[`x_complex.md`](./x_complex.md) with `-env-prefix` argument; | ||
and [`complex-nostyle.html`](./complex-nostyle.html) which is HTML documentation without built-in styles. | ||
- [`envprefix.go`](./envprefix.go) showcases a nested config structure with the `envPrefix` tag for a structure field. | ||
It generates [`envprefix.md`](./envprefix.md). | ||
|
||
The examples dir has helper script files as well: | ||
- `build-examples.sh` - you can modify any example go file and regenerate all documentation outputs by running it via `./build-examples.sh`. | ||
The examples directory also contains helper script files: | ||
- `build-examples.sh` - modify any example Go file and regenerate all documentation outputs by executing it via `./build-examples.sh`. | ||
- `clean.sh` - removes all documentation files. |