]> BookStack Code Mirror - bookstack/blob - resources/views/api-docs/index.blade.php
Added a view for the API docs
[bookstack] / resources / views / api-docs / index.blade.php
1 @extends('simple-layout')
2
3 @section('body')
4
5     <div class="container pt-xl">
6
7         <div class="grid right-focus reverse-collapse">
8
9             <div>
10                 @foreach($docs as $model => $endpoints)
11                     <p class="text-uppercase text-muted mb-xm mt-l"><strong>{{ $model }}</strong></p>
12
13                     @foreach($endpoints as $endpoint)
14                         <div class="mb-xs">
15                             <a href="#{{ $endpoint['name'] }}" class="text-mono">
16                                 <span class="api-method" data-method="{{ $endpoint['method'] }}">{{ $endpoint['method'] }}</span>
17                                 /{{ $endpoint['uri'] }}
18                             </a>
19                         </div>
20                     @endforeach
21                 @endforeach
22             </div>
23
24             <div>
25                 @foreach($docs as $model => $endpoints)
26                     <section class="card content-wrap auto-height">
27                         <h1 class="list-heading text-capitals">{{ $model }}</h1>
28
29                         @foreach($endpoints as $endpoint)
30                             <h5 id="{{ $endpoint['name'] }}" class="text-mono mb-m">
31                                 <span class="api-method" data-method="{{ $endpoint['method'] }}">{{ $endpoint['method'] }}</span>
32                                 {{ url($endpoint['uri']) }}
33                             </h5>
34                             <p class="mb-m">{{ $endpoint['description'] ?? '' }}</p>
35                             @if($endpoint['example_response'] ?? false)
36                                 <details details-highlighter>
37                                     <summary class="text-muted">Example Response</summary>
38                                     <pre><code class="language-json">{{ $endpoint['example_response'] }}</code></pre>
39                                 </details>
40                                 <hr class="mt-m">
41                             @endif
42                         @endforeach
43                     </section>
44                 @endforeach
45             </div>
46
47         </div>
48
49
50     </div>
51 @stop