Skip to content

Commit 7bbf547

Browse files
committed
Use xmlrfc <sourcecode> for HTTP messages / ABNF / XML
1 parent bf0e832 commit 7bbf547

File tree

2 files changed

+32
-26
lines changed

2 files changed

+32
-26
lines changed

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22
mkdir -p build
3-
kramdown-rfc2629 webdav-push.mkd >build/webdav-push.xml && (cd build; xml2rfc --html webdav-push.xml && xml2rfc --text webdav-push.xml)
3+
kramdown-rfc2629 -3 webdav-push.mkd >build/webdav-push.xml && (cd build; xml2rfc --html webdav-push.xml && xml2rfc --text webdav-push.xml)
44

55
echo To view in a browser, run: xdg-open build/webdav-push.html
66

content.mkd

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,10 @@ A server that supports WebDAV-Push MUST include "webdav-push" in the `DAV` heade
121121

122122
Example:
123123

124-
~~~
124+
~~~http-message
125125
OPTIONS /calendars/
126126
Host: caldav.example.com
127-
127+
128128
HTTP/1.1 200 OK
129129
Allow: OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, COPY, MOVE
130130
Allow: PROPFIND, PROPPATCH, LOCK, UNLOCK, REPORT, ACL
@@ -152,7 +152,7 @@ Clients can use WebDAV `PROPFIND` to retrieve these properties. WebDAV-Push SHOU
152152

153153
Example:
154154

155-
~~~
155+
~~~http-message
156156
PROPFIND https://example.com/webdav/collection/
157157
<?xml version="1.0" encoding="utf-8" ?>
158158
<propfind xmlns="DAV:" xmlns:P="https://bitfire.at/webdav-push">
@@ -253,7 +253,7 @@ The server MUST return a HTTP `Expires` header (as defined in {{Section 5.3 of R
253253

254254
Example 1 (successful registration):
255255

256-
~~~
256+
~~~http-message
257257
POST https://example.com/webdav/collection/
258258
Content-Type: application/xml; charset="utf-8"
259259
@@ -291,7 +291,7 @@ Allowed response codes:
291291

292292
Sample request:
293293

294-
~~~
294+
~~~http-message
295295
DELETE https://example.com/webdav/subscriptions/io6Efei4ooph
296296
297297
HTTP/1.1 204 Unregistered
@@ -334,7 +334,7 @@ The `property-update` element of a push message is usually empty (except for VAP
334334

335335
Example:
336336

337-
~~~
337+
~~~xml
338338
{::include xml/sample-push-message.xml}
339339
~~~
340340

@@ -348,10 +348,12 @@ A client may not want to receive push notifications for a change that it induces
348348
Header name: "Push-Dont-Notify"(((Push-Dont-Notify)))
349349
Value syntax in ABNF with #rule extension as defined in {{Section 5.6.1 of RFC9110}}:
350350

351-
Push-Dont-Notify = 1#(quoted-registration-url) / "*"
351+
~~~abnf-rfc9110
352+
Push-Dont-Notify = 1#(quoted-registration-url) / "*"
352353
353-
quoted-registration-url = quoted-string
354-
; absolute push registration URL
354+
quoted-registration-url = quoted-string
355+
; absolute push registration URL
356+
~~~
355357

356358
A server SHOULD NOT send push notifications that are triggered by the requested operation to the subscriptions of the `Push-Dont-Notify` header.
357359

@@ -363,25 +365,29 @@ Multiple values can be provided as a list and/or using multiple lines as describ
363365

364366
Example 1:
365367

366-
PUT /file.txt HTTP/1.1
367-
Host: www.example.com
368-
Push-Dont-Notify: "https://example.com/webdav/subscriptions/io6Efei4ooph"
369-
370-
[…]
371-
372-
HTTP/1.1 201 Created
368+
~~~http-message
369+
PUT /file.txt HTTP/1.1
370+
Host: www.example.com
371+
Push-Dont-Notify: "https://example.com/webdav/subscriptions/io6Efei4ooph"
372+
373+
[…]
374+
375+
HTTP/1.1 201 Created
376+
~~~
373377

374378
In this example, the client requests that the server doesn't send a push notification for the change in `file.txt` to the mentioned subscription.
375379

376380
Example 2:
377381

378-
DELETE /file.txt HTTP/1.1
379-
Host: www.example.com
380-
Push-Dont-Notify: *
381-
382-
[…]
383-
384-
HTTP/1.1 204 No Content
382+
~~~http-message
383+
DELETE /file.txt HTTP/1.1
384+
Host: www.example.com
385+
Push-Dont-Notify: *
386+
387+
[…]
388+
389+
HTTP/1.1 204 No Content
390+
~~~
385391

386392
Here the client requests that the server doesn't send any push notification in the context of the deletion.
387393

@@ -532,7 +538,7 @@ When a server that changes its VAPID key is able to notify clients with the old
532538

533539
A key rotation push message is a push message that only contains a `property-update` that includes a `{DAV:}prop` property with the `transports` property like this:
534540

535-
~~~
541+
~~~xml
536542
{::include xml/push-message-vapid-key.xml}
537543
~~~
538544

@@ -582,6 +588,6 @@ To reference element names in another namespace, the `{ns}element` syntax is use
582588

583589
The XML schema formally defines the XML elements used by this document and is expressed in {{RELAXNG}}.
584590

585-
~~~
591+
~~~xml
586592
{::include xml/webdav-push.rng}
587593
~~~

0 commit comments

Comments
 (0)