|
| 1 | +<!doctype html> |
| 2 | +<html> |
| 3 | +<head> |
| 4 | + <meta charset="utf-8" /> |
| 5 | + |
| 6 | + <script |
| 7 | + src=" https://cdn.jsdelivr.net/npm/@scalar/[email protected]/dist/browser/standalone.js" |
| 8 | + integrity="sha256-6/qUfYX/AQu0WFPRVWGXdoDc7eKERmgweLT8mEjm89U=" |
| 9 | + crossorigin="anonymous" |
| 10 | + ></script> |
| 11 | + |
| 12 | + <style> |
| 13 | + /* Big performance improvement */ |
| 14 | + .section-container { |
| 15 | + contain: paint layout; |
| 16 | + content-visibility: auto; |
| 17 | + contain-intrinsic-size: 100px 600px; |
| 18 | + } |
| 19 | + .sidebar-indent-nested { |
| 20 | + contain: paint layout; |
| 21 | + content-visibility: auto; |
| 22 | + contain-intrinsic-size: 100px 32px; |
| 23 | + } |
| 24 | + .hljs > span { |
| 25 | + contain: paint layout; |
| 26 | + content-visibility: auto; |
| 27 | + contain-intrinsic-size: 16px 16px; |
| 28 | + } |
| 29 | + .scalar-code-block { |
| 30 | + contain: paint layout; |
| 31 | + content-visibility: auto; |
| 32 | + contain-intrinsic-size: 100px 600px; |
| 33 | + } |
| 34 | + |
| 35 | + /* Clutters "Test Request" UI */ |
| 36 | + .request-section-content-headers, .request-section-content-cookies { |
| 37 | + display: none; |
| 38 | + } |
| 39 | + </style> |
| 40 | +</head> |
| 41 | +<body> |
| 42 | + <div id="app"></div> |
| 43 | + |
| 44 | + <script> |
| 45 | + (async () => { |
| 46 | + const spec = await (await fetch('./v1.yaml')).text() |
| 47 | + Scalar.createApiReference('#app', { |
| 48 | + content: spec, |
| 49 | + proxyUrl: undefined, |
| 50 | + withDefaultFonts: false, |
| 51 | + telemetry: false, |
| 52 | + hideModels: true, // It clutters sidebar |
| 53 | + defaultHttpClient: { |
| 54 | + targetKey: 'js', |
| 55 | + clientKey: 'fetch', |
| 56 | + }, |
| 57 | + // Don't want to show these clients first on the list, but can not |
| 58 | + // merely move them lower. Have to disable them. |
| 59 | + hiddenClients: { |
| 60 | + ruby: ['native'], |
| 61 | + php: ['curl', 'guzzle'], |
| 62 | + node: ['undici'], |
| 63 | + }, |
| 64 | + }) |
| 65 | + })() |
| 66 | + </script> |
| 67 | +</body> |
| 68 | +</html> |
0 commit comments