frostfs-api-go/.github/markdown.tmpl
Evgeniy Kulikov 04a5b80550
docs: prepare template and gen make command
- add markdown simple template
- add Makefile `docgen` command
2019-11-20 18:56:35 +03:00

83 lines
2 KiB
Cheetah

# Protocol Documentation
<a name="top"></a>
## Table of Contents
{{range .Files}}
{{$file_name := .Name}}- [{{.Name}}](#{{.Name}})
{{if .Services}} - Services
{{range .Services}}- [{{.Name}}](#{{.FullName}})
{{end}}{{end}}
{{if .Messages}} - Messages
{{range .Messages}}- [{{.LongName}}](#{{.FullName}})
{{end}}{{end}}
{{end}}
- [Scalar Value Types](#scalar-value-types)
{{range .Files}}
{{$file_name := .Name}}
<a name="{{.Name}}"></a>
<p align="right"><a href="#top">Top</a></p>
## {{.Name}}
{{.Description}}
{{range .Services}}
<a name="{{.FullName}}"></a>
### Service "{{.FullName}}"
{{.Description}}
```
{{range .Methods -}}
rpc {{.Name}}({{if .RequestStreaming}}stream {{end}}{{.RequestLongType}}) returns ({{if .ResponseStreaming}}stream {{end}}{{.ResponseLongType}});
{{end}}
```
{{range .Methods -}}
#### Method {{.Name}}
{{.Description}}
| Name | Input | Output |
| ---- | ----- | ------ |
| {{.Name}} | [{{.RequestLongType}}](#{{.RequestFullType}}) | [{{.ResponseLongType}}](#{{.ResponseFullType}}) |
{{end}}{{end}} <!-- end services -->
{{range .Messages}}
<a name="{{.FullName}}"></a>
### Message {{.LongName}}
{{.Description}}
{{if .HasFields}}
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
{{range .Fields -}}
| {{.Name}} | [{{.LongType}}](#{{.FullType}}) | {{.Label}} | {{nobr .Description}}{{if .DefaultValue}} Default: {{.DefaultValue}}{{end}} |
{{end}}{{end}}
{{end}} <!-- end messages -->
{{range .Enums}}
<a name="{{.FullName}}"></a>
### {{.LongName}}
{{.Description}}
| Name | Number | Description |
| ---- | ------ | ----------- |
{{range .Values -}}
| {{.Name}} | {{.Number}} | {{nobr .Description}} |
{{end}}
{{end}} <!-- end enums -->
{{end}}
## Scalar Value Types
| .proto Type | Notes | C++ Type | Java Type | Python Type |
| ----------- | ----- | -------- | --------- | ----------- |
{{range .Scalars -}}
| <a name="{{.ProtoType}}" /> {{.ProtoType}} | {{.Notes}} | {{.CppType}} | {{.JavaType}} | {{.PythonType}} |
{{end}}