1{{--
2 Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0.
3 See the LICENCE file in the repository root for full licence text.
4--}}
5@php
6 $mdFiles = [
7 resource_path('views/docs/_using_chat.md'),
8 resource_path('views/docs/_websocket.md'),
9 resource_path('views/docs/_websocket_events.md'),
10 resource_path('views/docs/_websocket_commands.md'),
11 resource_path('views/docs/_structures.md'),
12 ...glob(resource_path('views/docs/_structures/*.md')),
13 ];
14 $parser = Parsedown::instance();
15@endphp
16<!doctype html>
17<html lang="en">
18<head>
19 <meta charset="utf-8">
20 <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
21 <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
22 <title>{!! $metadata['title'] !!}</title>
23
24 <link href="https://fonts.googleapis.com/css?family=Open+Sans&display=swap" rel="stylesheet">
25
26 <link rel="stylesheet" href="{{ unmix('css/docs.css') }}">
27
28 <style>
29 @foreach($metadata['example_languages'] as $lang)
30 body .content .{{ $lang }}-example code {
31 display: none;
32 }
33 body[data-language={{ $lang }}] .content .{{ $lang }}-example code {
34 display: block;
35 }
36 body[data-language={{ $lang }}] .lang-button[data-language-name={{ $lang }}] {
37 --bg: var(--bg-active);
38 }
39 @endforeach
40 </style>
41
42 <script src="{{ unmix('js/runtime.js') }}"></script>
43 <script src="{{ unmix('js/vendor.js') }}"></script>
44 <script src="{{ unmix('js/commons.js') }}"></script>
45 <script src="{{ unmix('js/docs.js') }}"></script>
46</head>
47
48<body data-languages="{{ json_encode($metadata['example_languages'] ?? []) }}">
49
50@include("docs.sidebar")
51
52<div class="page-wrapper">
53 <div class="dark-box"></div>
54 <div class="content">
55 @include('docs.info')
56 @include('docs.auth')
57 @include("docs.groups")
58
59 @foreach ($mdFiles as $file)
60 {!! $parser->text(file_get_contents($file)) !!}
61 @endforeach
62 </div>
63 <div class="dark-box">
64 <div class="lang-selector">
65 @foreach($metadata['example_languages'] as $lang)
66 <button type="button" class="lang-button js-set-language" data-language-name="{{ $lang }}">{{ $lang }}</button>
67 @endforeach
68 </div>
69 </div>
70</div>
71</body>
72</html>