Skip to content

Commit 25f411a

Browse files
committed
docs one page
1 parent 627046f commit 25f411a

File tree

4 files changed

+64
-0
lines changed

4 files changed

+64
-0
lines changed

content/features/full.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: All Docs as One Page
3+
layout: full
4+
description: one page to rule them all
5+
---

layouts/_default/full.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{{ define "main" }}
2+
{{- range .Site.Pages}}
3+
<div id="articleContent" class="p-4 text-black">
4+
{{ .Content }}
5+
</div>
6+
{{- end}}
7+
{{ end }}

layouts/partials/api/schema.html

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{{$schema := .schema}}
2+
{{$schemas := .schemas}}
3+
{{- with $schema }}
4+
<p class="font-bold">{{.type}}</p>
5+
<ul class="space-y-2">
6+
{{- range $key, $schema := .properties }}
7+
<li class="space-y-1">
8+
{{$context := dict "key" $key "schema" $schema "schemas" $schemas }}
9+
{{ template "nestedSchemaDetails" $context }}
10+
{{- range $i, $item := .items }}
11+
{{- if reflect.IsMap $item }}
12+
<!-- Handle case where $item is a map of $refs -->
13+
{{- $itemRef := index $item "$ref"}}
14+
{{ $path := strings.TrimPrefix "#/components/schemas/" $itemRef }}
15+
{{$context := dict "key" $key "schema" $item "schemas" $schemas}}
16+
{{- else if reflect.IsSlice $item}}
17+
xxxxx {{.}} <!-- example output: [map[$ref:#/components/schemas/saved_credit_card_view] map[$ref:#/components/schemas/saved_paypal_account_view]]-->
18+
{{range . }}
19+
{{- $itemRef := index . "$ref"}}
20+
{{$itemRef}}
21+
{{end}}
22+
{{- else }}
23+
123456 <div class="bg-red-100">{{.}}</div> <!-- example output: #/components/schemas/webhooks_type -->
24+
{{- end }}
25+
{{- end }}
26+
</li>
27+
{{- end }}
28+
</ul>
29+
{{- end }}
30+
{{- define "nestedSchemaDetails"}}
31+
<span class="font-medium">{{.key}}</span>
32+
{{- with .schema }}
33+
{{- with .type}}
34+
<span class="font-thin">{{.}}</span>
35+
{{- end}}
36+
{{- with .format}}
37+
<span class="font-thin">({{.}})</span>
38+
{{- end}}
39+
<div class="pl-2 space-y-1">
40+
{{with .description}}
41+
<p class="text-sm">{{. | markdownify }}</p>
42+
{{end}}
43+
{{- with .example}}
44+
<p class="text-xs"><span class="font-bold">Examples:</span> {{.}}</p>
45+
{{- end}}
46+
{{- with .enum}}
47+
<p class="text-xs"><span class="font-bold">Enums:</span> {{.}}</p>
48+
{{- end}}
49+
</div>
50+
{{- end }}
51+
{{- end }}
52+

layouts/partials/api/schemas.html

Whitespace-only changes.

0 commit comments

Comments
 (0)