Skip to content

Commit ba00bfc

Browse files
committed
template fixes
1 parent 3c51729 commit ba00bfc

File tree

8 files changed

+211
-336
lines changed

8 files changed

+211
-336
lines changed

docs/api.md

Lines changed: 200 additions & 275 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
<aside class="warning">
2-
To perform this operation, you must be authenticated by means of one of the following methods:
3-
{{= data.utils.getAuthenticationStr(data) }}
4-
</aside>
5-
1+
To perform this operation, you must be authenticated by means of one of the following methods: **{{= data.utils.getAuthenticationStr(data) }}**.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# You can also use wget
2-
curl -X {{=data.methodUpper}} {{=data.url}}{{=data.requiredQueryString}}{{?data.allHeaders.length}} \{{?}}
2+
curl -X {{=data.methodUpper}} http://coder-server:8080{{=data.url}}{{=data.requiredQueryString}}{{?data.allHeaders.length}} \{{?}}
33
{{~data.allHeaders :p:index}} -H '{{=p.name}}: {{=p.exampleValues.object}}'{{?index < data.allHeaders.length-1}} \{{?}}
44
{{~}}

scripts/apidocgen/markdown-template/main.dot

Lines changed: 4 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,13 @@
1-
{{= data.tags.section }}
2-
<h1 id="{{=data.title_prefix}}">{{=data.api.info && data.api.info.title}} {{=data.version}}</h1>
3-
4-
> XScroll down for {{? data.header.language_tabs.length}}code samples, {{?}}example requests and responses.{{? data.header.language_tabs.length}} Select a language for code samples from the tabs above or the mobile navigation menu.{{?}}
5-
6-
{{? data.api.info && data.api.info.description}}{{=data.api.info.description}}{{?}}
7-
8-
{{? data.api.servers }}
9-
Base URLs:
10-
{{~data.api.servers :s}}
11-
* <a href="{{=s.url}}">{{=s.url}}</a>
12-
{{ for(var v in s.variables) { }}
13-
* **{{=v}}** - {{=s.variables[v].description||''}} Default: {{=s.variables[v].default}}
14-
{{? s.variables[v].enum}}
15-
{{~ s.variables[v].enum :e}}
16-
* {{= e}}
17-
{{~}}
18-
{{?}}
19-
{{ } }}
20-
{{~}}
21-
{{?}}
22-
23-
{{? data.api.info && data.api.info.termsOfService}}<a href="{{=data.api.info.termsOfService}}">Terms of service</a>{{?}}
24-
{{? data.api.info && data.api.info.contact}}{{? data.api.info.contact.email}}Email: <a href="mailto:{{=data.api.info.contact.email}}">{{=data.api.info.contact.name || 'Support'}}</a> {{?}}{{? data.api.info.contact.url}}Web: <a href="{{=data.api.info.contact.url}}">{{= data.api.info.contact.name || 'Support'}}</a> {{?}}{{?}}
25-
{{? data.api.info && data.api.info.license}}{{? data.api.info.license.url}}License: <a href="{{=data.api.info.license.url}}">{{=data.api.info.license.name}}</a>{{??}} License: {{=data.api.info.license.name}}{{?}}{{?}}
26-
{{= data.tags.endSection }}
27-
28-
{{? data.api.components && data.api.components.securitySchemes }}
29-
{{#def.security}}
30-
{{?}}
1+
{{? data.api.components && data.api.components.securitySchemes }}{{#def.security}}{{?}}
312

323
{{ for (var r in data.resources) { }}
334
{{ data.resource = data.resources[r]; }}
345

356
{{= data.tags.section }}
36-
<h1 id="{{=data.title_prefix+'-'+data.utils.slugify(r)}}">{{= r}}</h1>
7+
# {{= r}}
378

389
{{? data.resource.description }}{{= data.resource.description}}{{?}}
3910

40-
{{? data.resource.externalDocs}}
41-
<a href="{{=data.resource.externalDocs.url}}">{{=data.resource.externalDocs.description||'External documentation'}}</a>
42-
{{?}}
43-
4411
{{ for (var m in data.resource.methods) { }}
4512
{{ data.operationUniqueName = m; }}
4613
{{ data.method = data.resource.methods[m]; }}
@@ -62,12 +29,7 @@ Base URLs:
6229
{{ var schema = data.api.components.schemas[s]; }}
6330

6431
{{= data.tags.section }}
65-
<h2 id="tocS_{{=s}}">{{=s}}</h2>
66-
{{ /* backwards compatibility */ }}
67-
<a id="schema{{=s.toLowerCase()}}"></a>
68-
<a id="schema_{{=s}}"></a>
69-
<a id="tocS{{=s.toLowerCase()}}"></a>
70-
<a id="tocs{{=s.toLowerCase()}}"></a>
32+
## {{=s}}
7133

7234
{{? data.options.yaml }}
7335
```yaml
@@ -105,7 +67,7 @@ Base URLs:
10567

10668
{{? block.rows.length}}|Name|Type|Required|Restrictions|Description|
10769
|---|---|---|---|---|{{?}}
108-
{{~ block.rows :p}}|{{=p.displayName}}|{{=p.safeType}}|{{=p.required}}|{{=p.restrictions||'none'}}|{{=p.description||'none'}}|
70+
{{~ block.rows :p}}|{{=p.displayName}}|{{? p.$ref}}{{=p.$ref}}{{?}}{{? !p.$ref}}{{=p.type}}{{?}}|{{=p.required}}|{{=p.restrictions||'none'}}|{{=p.description||'none'}}|
10971
{{~}}
11072
{{~}}
11173
{{? (blocks[0].rows.length === 0) && (blocks.length === 1) }}

scripts/apidocgen/markdown-template/operation.dot

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
## {{= data.operationUniqueName}}
44

5-
{{? data.operation.operationId}}
6-
<a id="opId{{=data.operation.operationId}}"></a>
7-
{{?}}
8-
95
{{ data.methodUpper = data.method.verb.toUpperCase(); }}
106
{{ data.url = data.utils.slashes(data.baseUrl + data.method.path); }}
117
{{ data.parameters = data.operation.parameters; }}

scripts/apidocgen/markdown-template/parameters.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{{= data.tags.section }}
2-
<h3 id="{{=data.operationUniqueSlug}}-parameters">Parameters</h3>
2+
### Parameters
33

44
|Name|In|Type|Required|Description|
55
|---|---|---|---|---|

scripts/apidocgen/markdown-template/responses.def

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
{{~}}
66

77
{{? data.responseSchemas }}
8-
> Example responses
8+
### Example responses
99

1010
{{= data.utils.getResponseExamples(data) }}
1111
{{?}}
1212

1313
{{= data.tags.section }}
14-
<h3 id="{{=data.operationUniqueSlug}}-responses">Responses</h3>
14+
### Responses
1515

1616
|Status|Meaning|Description|Schema|
1717
|---|---|---|---|

scripts/apidocgen/markdown-template/security.def

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
{{= data.tags.section }}
2-
3-
# Authentication
4-
1+
{{= data.tags.section }}# Authentication
52
{{ for (var s in data.api.components.securitySchemes) { }}
63
{{ var sd = data.api.components.securitySchemes[s]; }}
74
{{? sd.type == 'apiKey' }}
8-
* API Key ({{=s}})
5+
- API Key ({{=s}})
96
- Parameter Name: **{{=sd.name}}**, in: {{=sd.in}}. {{=sd.description || ''}}
107
{{?}}
118
{{? sd.type == 'http'}}
@@ -27,5 +24,4 @@
2724
{{ } /* of flows */ }}
2825
{{?}}
2926
{{ } /* of securitySchemes */ }}
30-
3127
{{= data.tags.endSection }}

0 commit comments

Comments
 (0)