Skip to content

Commit

Permalink
Update ReSpec configuration to latest best practices.
Browse files Browse the repository at this point in the history
  • Loading branch information
msporny committed Sep 22, 2024
1 parent 93c8725 commit d44b929
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 167 deletions.
184 changes: 51 additions & 133 deletions common.js
Original file line number Diff line number Diff line change
@@ -1,140 +1,26 @@
/* globals omitTerms, respecConfig, $, require */
/* exported linkCrossReferences, restrictReferences, fixIncludes */

var ccg = {
// Add as the respecConfig localBiblio variable
// Extend or override global respec references
localBiblio: {
'REST': {
title: 'Architectural Styles and the Design of Network-based Software Architectures',
date: '2000',
href: 'http://www.ics.uci.edu/~fielding/pubs/dissertation/',
authors: [
'Roy Thomas Fielding'
],
publisher: 'University of California, Irvine.'
},
'VC-EXTENSION-REGISTRY': {
title: 'Verifiable Credentials Extension Registry',
href: 'https://w3c-ccg.github.io/vc-extension-registry/',
authors: [
'Manu Sporny'
],
status: 'CG-DRAFT',
publisher: 'Credentials Community Group'
},
'STRING-META': {
title: 'Strings on the Web: Language and Direction Metadata',
href: 'https://www.w3.org/TR/string-meta/',
authors: [
'Addison Phillips',
'Richard Ishida'
],
status: 'WD',
publisher: 'Internationalization Working Group'
},
'LD-PROOFS': {
title: 'Linked Data Proofs',
href: 'https://w3c-dvcg.github.io/ld-proofs/',
authors: [
'Manu Sporny',
'Dave Longley'
],
status: 'CG-DRAFT',
publisher: 'Digital Verification Community Group'
},
'LD-SIGNATURES': {
title: 'Linked Data Signatures',
href: 'https://w3c-dvcg.github.io/ld-signatures/',
authors: [
'Manu Sporny',
'Dave Longley'
],
status: 'CG-DRAFT',
publisher: 'Digital Verification Community Group'
},
'LDS-RSA2018': {
title: 'The 2018 RSA Linked Data Signature Suite',
href: 'https://w3c-dvcg.github.io/lds-rsa2018/',
authors: [
'Manu Sporny',
'Dave Longley'
],
status: 'CG-DRAFT',
publisher: 'Digital Verification Community Group'
},
'MULTIBASE': {
title: 'Multibase',
href: 'https://tools.ietf.org/html/draft-multiformats-multibase',
authors: [
'Juan Benet',
'Manu Sporny'
],
status: 'Independent Draft',
publisher: 'IETF'
},
'MULTICODEC': {
title: 'Multibase',
href: 'https://github.com/multiformats/multicodec/blob/master/README.md',
authors: [
'Juan Benet',
'Manu Sporny'
],
status: 'Independent Draft',
publisher: 'IETF'
},
// aliases to known references
'HTTP-SIGNATURES': {
aliasOf: 'http-signatures'
},
'DEMOGRAPHICS': {
title: 'Simple Demographics Often Identify People Uniquely',
href: 'http://dataprivacylab.org/projects/identifiability/paper1.pdf',
authors: [
'Latanya Sweeney'
],
publisher: 'Data Privacy Lab'
},
'HASHLINK': {
title: 'Cryptographic Hyperlinks',
href: 'https://tools.ietf.org/html/draft-sporny-hashlink',
authors: [
'Manu Sporny'
],
status: 'Internet-Draft',
publisher: 'Internet Engineering Task Force (IETF)'
},
'IPFS': {
title: 'InterPlanetary File System (IPFS)',
href: 'https://en.wikipedia.org/wiki/InterPlanetary_File_System',
publisher: 'Wikipedia'
},
'JSON-SCHEMA-2018': {
title: 'JSON Schema: A Media Type for Describing JSON Documents',
href: 'https://tools.ietf.org/html/draft-handrews-json-schema',
authors: [
'Austin Wright',
'Henry Andrews'
],
status: 'Internet-Draft',
publisher: 'Internet Engineering Task Force (IETF)'
},
'JSON-LD': {
title: 'JSON-LD 1.1: A JSON-based Serialization for Linked Data',
href: 'https://www.w3.org/TR/json-ld11/',
authors: [
'Gregg Kellogg',
'Manu Sporny',
'Dave Longley',
'Markus Lanthaler',
'Pierre-Antoine Champin',
'Niklas Lindström'
],
status: 'WD',
publisher: 'W3C JSON-LD 1.1 Working Group'
require(["core/pubsubhub"], (respecEvents) => {
"use strict";

respecEvents.sub('end-all', (message) => {
// remove data-cite on where the citation is to ourselves.
const selfDfns = document.querySelectorAll("dfn[data-cite^='" + respecConfig.shortName.toUpperCase() + "#']");
for (const dfn of selfDfns) {
delete dfn.dataset.cite;
}

// Update data-cite references to ourselves.
const selfRefs = document.querySelectorAll("a[data-cite^='" + respecConfig.shortName.toUpperCase() + "#']");
for (const anchor of selfRefs) {
anchor.href= anchor.dataset.cite.replace(/^.*#/,"#");
delete anchor.dataset.cite;
}
}
};

});

});

// Removes dfns that aren't referenced anywhere in the spec.
// To ensure a definition appears in the Terminology section, use
Expand Down Expand Up @@ -192,3 +78,35 @@ function restrictRefs(config, document){

}

function _esc(s) {
return s.replace(/&/g,'&')
.replace(/>/g,'>')
.replace(/"/g,'"')
.replace(/</g,'&lt;');
}

function reindent(text) {
// TODO: use trimEnd when Edge supports it
const lines = text.trimRight().split("\n");
while (lines.length && !lines[0].trim()) {
lines.shift();
}
const indents = lines.filter(s => s.trim()).map(s => s.search(/[^\s]/));
const leastIndent = Math.min(...indents);
return lines.map(s => s.slice(leastIndent)).join("\n");
}

function updateExample(doc, content) {
// perform transformations to make it render and prettier
return _esc(reindent(unComment(doc, content)));
}

function unComment(doc, content) {
// perform transformations to make it render and prettier
return content
.replace(/<!--/, '')
.replace(/-->/, '')
.replace(/< !\s*-\s*-/g, '<!--')
.replace(/-\s*- >/g, '-->')
.replace(/-\s*-\s*&gt;/g, '--&gt;');
}
82 changes: 72 additions & 10 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<title>Verifiable Presentation Request v0.2</title>
<title>Verifiable Presentation Request v2024</title>
<meta http-equiv='Content-Type' content='text/html;charset=utf-8'/>
<!--
=== NOTA BENE ===
Expand All @@ -19,7 +19,7 @@
shortName: "vp-request-spec",

// subtitle for the spec
subtitle: "",
subtitle: "A data model for requesting presenations of verifiable credentials",

// if you wish the publication date to be other than today, set this
//publishDate: "",
Expand All @@ -33,7 +33,6 @@
// previousMaturity: "WD",

// extend the bibliography entries
localBiblio: ccg.localBiblio,
doJsonLd: true,

github: "https://github.com/w3c-ccg/vp-request-spec/",
Expand All @@ -58,8 +57,7 @@
// authors, add as many as you like.
// This is optional, uncomment if you have authors as well as editors.
// only "name" is required. Same format as editors.
authors:
[
authors: [
// { name: "Dave Longley", url: "https://digitalbazaar.com/",
// company: "Digital Bazaar", companyURL: "https://digitalbazaar.com/"},
// { name: "Manu Sporny", url: "https://digitalbazaar.com/",
Expand All @@ -78,6 +76,24 @@
lint: {"no-unused-dfns": false},
postProcess: [restrictRefs],

xref: ["INFRA", "MIMESNIFF", "VC-DATA-MODEL-2.0"],
otherLinks: [{
key: "Related Specifications",
data: [{
value: "The Verifiable Credentials Data Model v2.0",
href: "https://www.w3.org/TR/VC-DATA-MODEL-2.0/"
}, {
value: "The Edwards Digital Signature Algorithm Cryptosuites v1.0",
href: "https://www.w3.org/TR/vc-di-eddsa/"
}, {
value: "The Elliptic Curve Digital Signature Algorithm Cryptosuites v1.0",
href: "https://www.w3.org/TR/vc-di-ecdsa/"
}, {
value: "The BBS Digital Signature Algorithm Cryptosuites v1.0",
href: "https://www.w3.org/TR/vc-di-bbs/"
}]
}],

// URI of the patent status for this WG, for Rec-track documents
// !!!! IMPORTANT !!!!
// This is important for Rec-track documents, do not copy a patent URI from a random
Expand All @@ -89,6 +105,14 @@
};
</script>
<style>
code {
color: rgb(199, 73, 0);
font-weight: bold;
}
pre {
overflow-x: auto;
white-space: pre-wrap;
}
pre .highlight {
font-weight: bold;
color: Green;
Expand All @@ -109,9 +133,35 @@
-ms-user-select: none;
user-select: none;
}
.color-text {
font-weight: bold;
text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;
ol.algorithm { counter-reset:numsection; list-style-type: none; }
ol.algorithm li { margin: 0.5em 0; }
ol.algorithm li:before { font-weight: bold; counter-increment: numsection; content: counters(numsection, ".") ") "; }

table.simple {
border-collapse: collapse;
margin: 25px 0;
min-width: 400px;
border: 1px solid #dddddd;
}
table.simple thead tr {
background-color: #005a9c;
color: #ffffff;
text-align: left;
}
table.simple th,
table.simple td {
padding: 12px 15px;
vertical-align: top;
text-align: left;
}
table.simple tbody tr {
border-bottom: 1px solid #dddddd;
}
table.simple tbody tr:nth-of-type(even) {
background-color: #00000008;
}
table.simple tbody tr:last-of-type {
border-bottom: 2px solid #005a9c;
}
</style>
</head>
Expand Down Expand Up @@ -191,10 +241,22 @@ <h2>Overview</h2>
<section id="conformance">
</section>

<section class="informative">
<section>
<h2>Terminology</h2>

<div data-include="https://raw.githubusercontent.com/w3c/vc-data-model/v2.0/terms.html"></div>
<p>
This specification relies on terminology defined in [[[VC-DATA-MODEL-2.0]]].
This section defines additional terms used in this specification. A link to
these terms is included whenever they appear in this specification.
</p>

<dl class="termlist definitions" data-sort="ascending">
<dt><dfn class="export">presentation request</dfn></dt>
<dd>
A request made by a [=verifier=] for a [=presentation=] by the [=holder=].
</dd>


</section>
</section>

Expand Down
24 changes: 0 additions & 24 deletions terms.html

This file was deleted.

0 comments on commit d44b929

Please sign in to comment.