Commit fdc3c84
serve: docling.rs page shell for the playground, and an OpenAPI description
The playground looked nothing like the wasm demo page — a bare 🦆 heading, no
logo, no way back to the project — and the API had no machine-readable
description at all, so pointing Swagger UI, Redoc or a client generator at a
running server was impossible.
- index.html adopts the demo page's shell verbatim: docling's deep-blue bar
(#003778) with the logo, the name/tagline block, and buttons to the OpenAPI
document and GitHub on the right, over a centered main column. The palette
variables keep the existing light/dark handling.
- New GET /openapi.yaml: an OpenAPI 3.1 description of the real API — both
request bodies (multipart upload, JSON URL), every ConvertOptions field with
its enum/default, the four response shapes, and the error statuses. Linked
from the header, the lede, the endpoint table and the curl examples.
- New GET /logo.svg, the same logo the demo page uses. Both assets are
include_str!'d into the binary, so a server still needs no static-file
directory.
- Test: both routes answer with the right content types, and the spec
mentions every route the router serves and every option ConvertOptions
accepts — the drift that would otherwise go unnoticed.
- README: the serve section mentions /openapi.yaml, and its screenshot is
regenerated on the new design (a real picture_classification.pdf run
through the form, gallery included).
Verified against a running server: /, /logo.svg, /openapi.yaml and
/v1/config answer 200 with the expected content types, the served spec
parses as YAML (5 paths), and uploads still convert to Markdown and JSON.
Signed-off-by: artiz <artem.kustikov@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EY5KAiquN4YpVf2PXEQkVT1 parent 3e23b49 commit fdc3c84
7 files changed
Lines changed: 568 additions & 10 deletions
File tree
- crates/docling-serve
- src
- tests
- docs/assets
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
121 | 123 | | |
122 | 124 | | |
123 | 125 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
9 | 17 | | |
10 | | - | |
| 18 | + | |
11 | 19 | | |
12 | 20 | | |
13 | | - | |
14 | | - | |
15 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
16 | 38 | | |
17 | 39 | | |
18 | 40 | | |
| |||
27 | 49 | | |
28 | 50 | | |
29 | 51 | | |
| 52 | + | |
30 | 53 | | |
31 | 54 | | |
32 | 55 | | |
| |||
39 | 62 | | |
40 | 63 | | |
41 | 64 | | |
42 | | - | |
43 | | - | |
44 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
45 | 80 | | |
46 | 81 | | |
47 | 82 | | |
| |||
95 | 130 | | |
96 | 131 | | |
97 | 132 | | |
| 133 | + | |
| 134 | + | |
98 | 135 | | |
99 | 136 | | |
100 | 137 | | |
| |||
117 | 154 | | |
118 | 155 | | |
119 | 156 | | |
120 | | - | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
121 | 161 | | |
122 | 162 | | |
123 | 163 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
131 | 133 | | |
132 | 134 | | |
133 | 135 | | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
134 | 156 | | |
135 | 157 | | |
136 | 158 | | |
| |||
0 commit comments