github.com/cdmixer/woolloomooloo@v0.1.0/pkg/codegen/docs/templates/function.tmpl (about) 1 {{ template "header" .Header }} 2 3 {{ htmlSafe "<!-- WARNING: this file was generated by" }} {{ .Tool }}. {{ htmlSafe "-->" }} 4 {{ htmlSafe "<!-- Do not edit by hand unless you're certain you know what you are doing! -->" }} 5 6 {{- if .DeprecationMessage }} 7 <p class="resource-deprecated">Deprecated: {{ print "{{% md %}}" -}}{{- .DeprecationMessage -}}{{- print "{{% /md %}}" -}}</p> 8 {{- end }} 9 10 {{ htmlSafe .Comment }} 11 {{- if ne (len .ExamplesSection) 0 }} 12 {{ template "examples" .ExamplesSection }} 13 {{- end }} 14 15 <!-- Input properties --> 16 ## Using {{ .Header.Title }} {#using} 17 18 {{ htmlSafe "{{< chooser language \"typescript,python,go,csharp\" / >}}" }} 19 20 <!-- TS/JS --> 21 {{ print "{{% choosable language nodejs %}}" }} 22 <div class="highlight"><pre class="chroma"><code class="language-typescript" data-lang="typescript"><span class="k">function </span>{{ .FunctionName.nodejs }}<span class="p">(</span>{{ htmlSafe .FunctionArgs.nodejs }}<span class="p">): Promise<{{ template "linkify_param" .FunctionResult.nodejs }}></span></code></pre></div> 23 {{ print "{{% /choosable %}}" }} 24 25 <!-- Python --> 26 {{ print "{{% choosable language python %}}" }} 27 <div class="highlight"><pre class="chroma"><code class="language-python" data-lang="python"><span class="k">def </span>{{ .FunctionName.python }}(</span>{{ htmlSafe .FunctionArgs.python }}<span class="p">) -></span> {{ .FunctionResult.python.Name }}</code></pre></div> 28 {{ print "{{% /choosable %}}" }} 29 30 <!-- Go --> 31 {{ print "{{% choosable language go %}}" }} 32 <div class="highlight"><pre class="chroma"><code class="language-go" data-lang="go"><span class="k">func </span>{{ .FunctionName.go }}<span class="p">(</span>{{ htmlSafe .FunctionArgs.go }}<span class="p">) (*{{ template "linkify_param" .FunctionResult.go }}, error)</span></code></pre></div> 33 {{ if ne .FunctionName.go .Header.Title }} 34 > Note: This function is named `{{ .FunctionName.go }}` in the Go SDK. 35 {{ end }} 36 {{ print "{{% /choosable %}}" }} 37 38 <!-- C# --> 39 {{ print "{{% choosable language csharp %}}" }} 40 <div class="highlight"><pre class="chroma"><code class="language-csharp" data-lang="csharp"><span class="k">public static class </span><span class="nx">{{ .FunctionName.csharp }} </span><span class="p">{</span><span class="k"> 41 public static </span>Task<{{ template "linkify_param" .FunctionResult.csharp }}> <span class="p">InvokeAsync(</span>{{ htmlSafe .FunctionArgs.csharp }}<span class="p">)</span><span class="p"> 42 }</span></code></pre></div> 43 {{ print "{{% /choosable %}}" }} 44 45 {{ if ne (len .InputProperties) 0 }} 46 47 The following arguments are supported: 48 {{ template "properties" .InputProperties }} 49 50 {{ end }} 51 52 <!-- Output properties --> 53 ## {{.Header.Title}} Result {#result} 54 55 The following output properties are available: 56 57 {{ template "properties" .OutputProperties }} 58 59 <!-- Supporting types --> 60 {{ if ne (len .NestedTypes) 0 }} 61 62 ## Supporting Types 63 64 {{ range .NestedTypes }} 65 <h4 id="{{ .AnchorID }}">{{ htmlSafe .Name }}</h4> 66 {{ if (hasDocLinksForLang .APIDocLinks "nodejs") -}} 67 {{ htmlSafe "{{% choosable language nodejs %}}" }} 68 > See the {{ if ne .APIDocLinks.nodejs.InputType "" }}<a href="{{ .APIDocLinks.nodejs.InputType }}">input</a>{{ end }} {{ if and (ne .APIDocLinks.nodejs.InputType "") (ne .APIDocLinks.nodejs.OutputType "") }}and{{ end }} {{ if ne .APIDocLinks.nodejs.OutputType "" }}<a href="{{ .APIDocLinks.nodejs.OutputType }}">output</a>{{ end }} API doc for this type. 69 {{ htmlSafe "{{% /choosable %}}" }} 70 {{- end }} 71 72 {{ if (hasDocLinksForLang .APIDocLinks "go") -}} 73 {{ htmlSafe "{{% choosable language go %}}" }} 74 > See the {{ if ne .APIDocLinks.go.InputType "" }}<a href="{{ .APIDocLinks.go.InputType }}">input</a>{{ end }} {{ if and (ne .APIDocLinks.go.InputType "") (ne .APIDocLinks.go.OutputType "") }}and{{ end }} {{ if ne .APIDocLinks.go.OutputType "" }}<a href="{{ .APIDocLinks.go.OutputType }}">output</a>{{ end }} API doc for this type. 75 {{ htmlSafe "{{% /choosable %}}" }} 76 {{- end }} 77 78 {{- if (hasDocLinksForLang .APIDocLinks "csharp") }} 79 {{ htmlSafe "{{% choosable language csharp %}}" }} 80 > See the {{ if ne .APIDocLinks.csharp.InputType "" }}<a href="{{ .APIDocLinks.csharp.InputType }}">input</a>{{ end }} {{ if and (ne .APIDocLinks.csharp.InputType "") (ne .APIDocLinks.csharp.OutputType "") }}and{{ end }} {{ if ne .APIDocLinks.csharp.OutputType "" }}<a href="{{ .APIDocLinks.csharp.OutputType }}">output</a>{{ end }} API doc for this type. 81 {{ htmlSafe "{{% /choosable %}}" }} 82 {{- end }} 83 84 {{ template "properties" .Properties }} 85 {{ end }} 86 87 {{ end }} 88 89 {{ template "package_details" .PackageDetails }}