Extracts the examples from the Authorization Capabilities (zcap) spec (or any ReSpec document) and prints them as NDJSON, so every example can be checked and built on. This page extracts them live, in your browser: each example below is its own section.
Snapshot examples · Diff versions · API docs · Repository · Usage
This page documents the zcap-spec-examples library; it is not a specification.
Copyright © Benjamin Goering. zcap-spec-examples is available under the MIT License.
curl -sS https://w3c-ccg.github.io/zcap-spec/v0.4.0-draft/ | npx zcap-spec-examples
The library is hosted here as ES modules, so any page can import it with no install and no build step. Paste this into an HTML file and open the console:
<script type="module">
import { extractExamples } from "https://gobengo.github.io/zcap-spec-examples/lib/examples.js";
const response = await fetch("https://w3c-ccg.github.io/zcap-spec/v0.4.0-draft/");
for await (const example of extractExamples(response)) {
console.log(example.name, example);
}
</script>