Skip to content

Commit 8c40e06

Browse files
authored
Merge pull request #35 from cludden/cludden/documentation
feat: adds experimental support for configurable doc generation
2 parents 8e5cffd + 4397562 commit 8c40e06

20 files changed

Lines changed: 3944 additions & 15 deletions

File tree

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ A protoc plugin for generating typed Temporal clients and workers in Go from pro
2020
- [Cross-Namespace (XNS)](#cross-namespace-xns)
2121
- [Codec](#codec)
2222
- [Documentation](#documentation)
23+
- [Reference](#reference)
2324
- [License](#license)
2425

2526
## How it works
@@ -59,6 +60,8 @@ Generated [Cross-Namespace (XNS)](#cross-namespace-xns) helpers: **[Experimental
5960

6061
Generated [Remote Codec Server](#codec) helpers **[Experimental]**
6162

63+
Generated [Markdown Documentation](#documentation) **[Experimental]**
64+
6265

6366
## Getting Started
6467
1. Install [buf](https://docs.buf.build/installation)
@@ -478,6 +481,8 @@ via:
478481
| cli-categories | `bool` | enables cli categories | `true` |
479482
| cli-enabled | `bool` | enables cli generation | `false` |
480483
| disable-workflow-input-rename | `bool` | disables renamed workflow input suffix | `false` |
484+
| docs-out | `string` | path to output documentation, leave empty to disable doc generation | |
485+
| docs-template | `string` | built-in template name or path to custom template file | `basic` |
481486
| enable-codec | `bool` | enables [experimental codec-server support](#codec) | `false` |
482487
| enable-patch-support | `bool` | enables experimental support for [protoc-gen-go-patch](https://github.com/alta/protopatch) | `false` |
483488
| enable-xns | `bool` | enables [experimental cross-namespace support](#cross-namespace-xns) | `false` |
@@ -749,6 +754,10 @@ func main() {
749754
750755
## Documentation
751756
757+
This plugin has experimental support for generating documentation via Go templates. You can enable it by setting the [docs-out](#plugin-options) plugin option. By default, it uses the embedded `basic` template (see [example](./docs/basic.md)). A custom template can be specified using the [docs-template](#plugin-options) plugin option. Templates receive a [Data](./internal/plugin/docs/docs.go) struct value as input, and have access to various Template functions, including the functions included via [text/template](https://pkg.go.dev/text/template#hdr-Functions), as well as the third-party [sprig](https://masterminds.github.io/sprig/) template functions.
758+
759+
## Reference
760+
752761
- [Generated code reference](./docs/generated.md)
753762
754763
## License

buf.gen.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ plugins:
99
opt: plugin=go,paths=source_relative
1010
- plugin: go_temporal
1111
out: gen
12-
opt: paths=source_relative,cli-enabled=true,cli-categories=true,workflow-update-enabled=true,enable-patch-support=true,enable-xns=true,enable-codec=true
12+
opt: paths=source_relative,cli-enabled=true,cli-categories=true,workflow-update-enabled=true,enable-patch-support=true,enable-xns=true,enable-codec=true,docs-out=./docs/basic.md
1313
strategy: all
1414
- plugin: doc
1515
out: docs/api

0 commit comments

Comments
 (0)