Skip to content

Commit 4719a18

Browse files
committed
Fix: code sample trim empty line
1 parent 095a463 commit 4719a18

File tree

6 files changed

+9
-20
lines changed

6 files changed

+9
-20
lines changed

docs/api/applications.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
# Example request using curl
1111
curl -X GET http://coder-server:8080/api/v2/applications/auth-redirect \
1212
-H 'Coder-Session-Token: API_KEY'
13-
1413
```
1514

1615
`GET /applications/auth-redirect`
@@ -38,7 +37,6 @@ To perform this operation, you must be authenticated by means of one of the foll
3837
curl -X GET http://coder-server:8080/api/v2/applications/host \
3938
-H 'Accept: application/json' \
4039
-H 'Coder-Session-Token: API_KEY'
41-
4240
```
4341

4442
`GET /applications/host`

docs/api/authorization.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ curl -X POST http://coder-server:8080/api/v2/authcheck \
1212
-H 'Content-Type: application/json' \
1313
-H 'Accept: application/json' \
1414
-H 'Coder-Session-Token: API_KEY'
15-
1615
```
1716

1817
`POST /authcheck`

docs/api/templates.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ curl -X POST http://coder-server:8080/api/v2/organizations/{organization-id}/tem
1212
-H 'Content-Type: application/json' \
1313
-H 'Accept: application/json' \
1414
-H 'Coder-Session-Token: API_KEY'
15-
1615
```
1716

1817
`POST /organizations/{organization-id}/templates/`
@@ -99,7 +98,6 @@ To perform this operation, you must be authenticated by means of one of the foll
9998
curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/templates \
10099
-H 'Accept: application/json' \
101100
-H 'Coder-Session-Token: API_KEY'
102-
103101
```
104102

105103
`GET /organizations/{organization}/templates`
@@ -192,7 +190,6 @@ To perform this operation, you must be authenticated by means of one of the foll
192190
curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/templates/{template-name} \
193191
-H 'Accept: application/json' \
194192
-H 'Coder-Session-Token: API_KEY'
195-
196193
```
197194

198195
`GET /organizations/{organization}/templates/{template-name}`
@@ -256,7 +253,6 @@ To perform this operation, you must be authenticated by means of one of the foll
256253
curl -X GET http://coder-server:8080/api/v2/templates/{id} \
257254
-H 'Accept: application/json' \
258255
-H 'Coder-Session-Token: API_KEY'
259-
260256
```
261257

262258
`GET /templates/{id}`
@@ -319,7 +315,6 @@ To perform this operation, you must be authenticated by means of one of the foll
319315
curl -X DELETE http://coder-server:8080/api/v2/templates/{id} \
320316
-H 'Accept: application/json' \
321317
-H 'Coder-Session-Token: API_KEY'
322-
323318
```
324319

325320
`DELETE /templates/{id}`

docs/api/workspaces.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
curl -X POST http://coder-server:8080/api/v2/organizations/{organization}/members/{user}/workspaces \
1212
-H 'Accept: application/json' \
1313
-H 'Coder-Session-Token: API_KEY'
14-
1514
```
1615

1716
`POST /organizations/{organization}/members/{user}/workspaces`
@@ -175,7 +174,6 @@ To perform this operation, you must be authenticated by means of one of the foll
175174
curl -X GET http://coder-server:8080/api/v2/users/{user}/workspace/{workspacename} \
176175
-H 'Accept: application/json' \
177176
-H 'Coder-Session-Token: API_KEY'
178-
179177
```
180178

181179
`GET /users/{user}/workspace/{workspacename}`
@@ -340,7 +338,6 @@ To perform this operation, you must be authenticated by means of one of the foll
340338
curl -X GET http://coder-server:8080/api/v2/workspaces \
341339
-H 'Accept: application/json' \
342340
-H 'Coder-Session-Token: API_KEY'
343-
344341
```
345342

346343
`GET /workspaces`
@@ -526,7 +523,6 @@ To perform this operation, you must be authenticated by means of one of the foll
526523
curl -X GET http://coder-server:8080/api/v2/workspaces/{id} \
527524
-H 'Accept: application/json' \
528525
-H 'Coder-Session-Token: API_KEY'
529-
530526
```
531527

532528
`GET /workspaces/{id}`
@@ -690,7 +686,6 @@ To perform this operation, you must be authenticated by means of one of the foll
690686
curl -X PATCH http://coder-server:8080/api/v2/workspaces/{workspace} \
691687
-H 'Content-Type: application/json' \
692688
-H 'Coder-Session-Token: API_KEY'
693-
694689
```
695690

696691
`PATCH /workspaces/{workspace}`
@@ -727,7 +722,6 @@ To perform this operation, you must be authenticated by means of one of the foll
727722
curl -X PUT http://coder-server:8080/api/v2/workspaces/{workspace}/autostart \
728723
-H 'Content-Type: application/json' \
729724
-H 'Coder-Session-Token: API_KEY'
730-
731725
```
732726

733727
`PUT /workspaces/{workspace}/autostart`
@@ -765,7 +759,6 @@ curl -X PUT http://coder-server:8080/api/v2/workspaces/{workspace}/extend \
765759
-H 'Content-Type: application/json' \
766760
-H 'Accept: application/json' \
767761
-H 'Coder-Session-Token: API_KEY'
768-
769762
```
770763

771764
`PUT /workspaces/{workspace}/extend`
@@ -819,7 +812,6 @@ To perform this operation, you must be authenticated by means of one of the foll
819812
curl -X PUT http://coder-server:8080/api/v2/workspaces/{workspace}/ttl \
820813
-H 'Content-Type: application/json' \
821814
-H 'Coder-Session-Token: API_KEY'
822-
823815
```
824816

825817
`PUT /workspaces/{workspace}/ttl`
@@ -856,7 +848,6 @@ To perform this operation, you must be authenticated by means of one of the foll
856848
curl -X GET http://coder-server:8080/api/v2/workspaces/{workspace}/watch \
857849
-H 'Accept: text/event-stream' \
858850
-H 'Coder-Session-Token: API_KEY'
859-
860851
```
861852

862853
`GET /workspaces/{workspace}/watch`
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Example request using curl
22
curl -X {{=data.methodUpper}} http://coder-server:8080{{=data.url}}{{=data.requiredQueryString}}{{?data.allHeaders.length}} \{{?}}
3-
{{~data.allHeaders :p:index}} -H '{{=p.name}}: {{=p.exampleValues.object}}'{{?index < data.allHeaders.length-1}} \{{?}}
4-
{{~}}
3+
{{~data.allHeaders :p:index}} -H '{{=p.name}}: {{=p.exampleValues.object}}'{{?index < data.allHeaders.length-1}} \
4+
{{?}}{{~}}

scripts/apidocgen/markdown-template/operation.dot

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
{{
2+
function renderCodeSample(data) {
3+
const originalCodeSample = data.utils.getCodeSamples(data);
4+
return originalCodeSample.replace("\n```\n", "```\n")
5+
}
6+
}}
17
{{= data.tags.section }}
28

39
## {{= data.operationUniqueName}}
@@ -14,7 +20,7 @@
1420
{{? data.options.codeSamples || data.operation["x-code-samples"] }}
1521
### Code samples
1622

17-
{{= data.utils.getCodeSamples(data)}}
23+
{{=renderCodeSample(data)}}
1824
{{?}}
1925

2026
`{{= data.methodUpper}} {{=data.method.path}}`

0 commit comments

Comments
 (0)