Skip to content

Commit b28fc00

Browse files
author
Robin Berjon
committed
authors
1 parent a0308c7 commit b28fc00

File tree

4 files changed

+69
-30
lines changed

4 files changed

+69
-30
lines changed

bdasl.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@
1717

1818
<meta charset="utf-8">
1919
<meta name="viewport" content="width=device-width, initial-scale=1.0">
20+
2021
<title>Big DASL (BDASL)</title>
2122
<link rel="stylesheet" href="spec.css"><link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><rect x=%220%22 y=%220%22 width=%22100%22 height=%22100%22 fill=%22%2300ff75%22></rect></svg>"><meta name="twitter:card" content="summary_large_image"><meta name="twitter:title" property="og:title" content="DASL: Big DASL (BDASL)"><meta name="twitter:description" property="og:description" content="BDASL extends DASL CIDs with a new hash type that works better for large files but isn't available by default in browsers, and therefore not an appropriate option in most situations."><meta name="twitter:image" property="og:image" content="https://dasl.ing/bdasl.png"><meta name="twitter:image:alt" content="Very colourful stripes, so colourful it hurts"><meta name="twitter:url" property="og:url" content="https://dasl.ing/"><meta property="og:site_name" content="DASL"><meta property="og:locale" content="en"><meta name="theme-color" content="#00ff75"></head>
22-
<body><div class="nav-back">A specification of the <a href="/">DASL Project</a>.</div><main><header><h1>Big DASL (BDASL)</h1><table><tbody><tr><th>date</th><td>2026-01-23</td></tr><tr><th>editors</th><td><a href="https://berjon.com/">Robin Berjon</a> &lt;<a href="mailto:[email protected]">[email protected]</a>&gt;<br><a href="https://bumblefudge.com/">Juan Caballero</a> &lt;<a href="mailto:[email protected]">[email protected]</a>&gt;</td></tr><tr><th>issues</th><td><a href="https://github.com/darobin/dasl.ing/issues">list</a>, <a href="https://github.com/darobin/dasl.ing/issues/new">new</a></td></tr><tr><th>abstract</th><td><div id="abstract">
23+
<body><div class="nav-back">A specification of the <a href="/">DASL Project</a>.</div><main><header><h1>Big DASL (BDASL)</h1><table><tbody><tr><th>date</th><td>2026-01-23</td></tr><tr><th>editors</th><td><a href="https://berjon.com/">Robin Berjon</a> &lt;<a href="mailto:[email protected]">[email protected]</a>&gt;<br><a href="https://n0.computer/">Brendan O'Brien</a> &lt;<a href="mailto:[email protected]">[email protected]</a>&gt;<br><a href="https://bumblefudge.com/">Juan Caballero</a> &lt;<a href="mailto:[email protected]">[email protected]</a>&gt;</td></tr><tr><th>issues</th><td><a href="https://github.com/darobin/dasl.ing/issues">list</a>, <a href="https://github.com/darobin/dasl.ing/issues/new">new</a></td></tr><tr><th>abstract</th><td><div id="abstract">
2324
<p>
2425
BDASL extends DASL CIDs with a new hash type that works better for large files but isn't
2526
available by default in browsers, and therefore not an appropriate option in most

bdasl.src.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<head>
44
<meta charset="utf-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<meta name="authors" content="robin, b5, bumblefudge">
67
<title>Big DASL (BDASL)</title>
78
</head>
89
<body>

people.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"b5": {
3+
"name": "Brendan O'Brien",
4+
"site": "https://n0.computer/",
5+
"email": "[email protected]"
6+
},
7+
"bumblefudge": {
8+
"name": "Juan Caballero",
9+
"site": "https://bumblefudge.com/",
10+
"email": "[email protected]"
11+
},
12+
"robin": {
13+
"name": "Robin Berjon",
14+
"site": "https://berjon.com/",
15+
"email": "[email protected]"
16+
}
17+
}

sisl.js

Lines changed: 49 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class SISL {
2323
// For reasons that baffle me, chokidar's ignored option doesn't work correctly. So
2424
// we filter ourselves.
2525
const buildIfMatch = (path) => {
26-
if (basename(path) !== 'bibliography.json' && !path.endsWith('.src.html')) return;
26+
if (basename(path) !== 'bibliography.json' && basename(path) !== 'people.json' && !path.endsWith('.src.html')) return;
2727
this.build();
2828
};
2929
const removeIfMatch = (path) => {
@@ -42,38 +42,36 @@ class SISL {
4242
;
4343
}
4444
async build () {
45-
// load the bibliography
46-
let bibliography;
47-
try {
48-
bibliography = JSON.parse(await readFile(join(this.baseDir, 'bibliography.json')));
49-
}
50-
catch (err) {
51-
this.die(err.message);
52-
}
45+
// load data
46+
const bibliography = await loadJSON(this.baseDir, 'bibliography');
47+
const people = await loadJSON(this.baseDir, 'people');
5348
// list specs
5449
const specs = {};
5550
const specList = (await readdir(this.baseDir)).filter(f => /\.src\.html$/.test(f));
5651
for (const s of specList) {
5752
const dom = new JSDOM(await readFile(s, 'utf8'));
5853
const { window: { document: doc } } = dom;
59-
specs[basename(s).replace(/\.src\.html$/, '')] = { dom, doc };
54+
const meta = doc.querySelector('meta[name="authors"]');
55+
const authors = meta?.getAttribute('content')?.split(/\s*,\s*/) || ['robin', 'bumblefudge'];
56+
if (meta) meta.remove();
57+
specs[basename(s).replace(/\.src\.html$/, '')] = { dom, doc, authors };
6058
}
6159
// extract metadata from all src and add to biblio
6260
Object.keys(specs).forEach(shortname => {
6361
bibliography[shortname] = this.htmlifyReference({
64-
author: 'Robin Berjon & Juan Caballero',
62+
author: joinList(specs[shortname].authors.map(au => people[au].name)),
6563
title: specs[shortname].doc.title,
6664
date: today(),
6765
url: `https://dasl.ing/${shortname}.html`,
6866
});
6967
});
7068
for (const shortname of Object.keys(specs)) {
71-
const { dom, doc } = specs[shortname];
69+
const { dom, doc, authors } = specs[shortname];
7270
const el = makeEl(doc);
7371
console.warn(`--- Processing ${shortname} "${doc.title}" (${doc.body.innerHTML.length}) ---`);
7472
// css
7573
const abstract = doc.querySelector('#abstract');
76-
if (!abstract) this.err(`Missing abstract in ${doc.title}`);
74+
if (!abstract) err(`Missing abstract in ${doc.title}`);
7775
const head = doc.querySelector('head');
7876
const cmt = doc.createComment(`
7977
@@ -104,6 +102,14 @@ class SISL {
104102
// main & header
105103
const main = doc.createElement('main');
106104
const header = el('header', {}, [el('h1', {}, [doc.title])], main);
105+
const attribution = [];
106+
authors
107+
.map(au => people[au])
108+
.forEach(({ site, name, email }, idx) => {
109+
if (idx) attribution.push(el('br'));
110+
attribution.push(el('a', { href: site }, [name]),
111+
' <', el('a', { href: `mailto:${email}` }, [email]), '>');
112+
})
107113
el(
108114
'table',
109115
{},
@@ -114,13 +120,7 @@ class SISL {
114120
]),
115121
el('tr', {}, [
116122
el('th', {}, ['editors']),
117-
el('td', {}, [
118-
el('a', { href: 'https://berjon.com/' }, ['Robin Berjon']),
119-
' <', el('a', { href: 'mailto:[email protected]' }, ['[email protected]']), '>',
120-
el('br'),
121-
el('a', { href: 'https://bumblefudge.com/' }, ['Juan Caballero']),
122-
' <', el('a', { href: 'mailto:[email protected]' }, ['[email protected]']), '>',
123-
]),
123+
el('td', {}, attribution),
124124
]),
125125
el('tr', {}, [
126126
el('th', {}, ['issues']),
@@ -158,7 +158,7 @@ class SISL {
158158
a.className = 'dfn-ref';
159159
}
160160
else {
161-
this.err(`Empty link "${a.textContent}" (#${id}) has no matching dfn.`);
161+
err(`Empty link "${a.textContent}" (#${id}) has no matching dfn.`);
162162
}
163163
});
164164
// references
@@ -167,7 +167,7 @@ class SISL {
167167
/\[\[([\w-]+)\]\]/g,
168168
(_, ref) => {
169169
if (!bibliography[ref]) {
170-
this.err(`No "${ref}" entry in the bibliography.`);
170+
err(`No "${ref}" entry in the bibliography.`);
171171
return `[[${ref}]]`;
172172
}
173173
refs[ref] = bibliography[ref];
@@ -196,15 +196,17 @@ class SISL {
196196
srcToSpec (path) {
197197
return path.replace(/\.src\.html$/, '.html');
198198
}
199-
err (str) {
200-
console.error(chalk.red(str));
201-
}
202-
die (str) {
203-
this.err(str);
204-
exit(1);
205-
}
206199
}
207200

201+
function err (str) {
202+
console.error(chalk.red(str));
203+
}
204+
function die (str) {
205+
err(str);
206+
exit(1);
207+
}
208+
209+
208210
function makeEl (doc) {
209211
return (n, attr, kids, parent) => {
210212
const el = doc.createElement(n);
@@ -252,3 +254,21 @@ const isWatch = argv[2] === '--watch';
252254
const sisl = new SISL(dirname(new URL(import.meta.url).toString().replace(/^file:\/\//, '')));
253255
if (isWatch) sisl.watch();
254256
else sisl.build();
257+
258+
async function loadJSON (baseDir, base) {
259+
try {
260+
return JSON.parse(await readFile(join(baseDir, `${base}.json`)));
261+
}
262+
catch (e) {
263+
die(e.message);
264+
}
265+
}
266+
267+
function joinList (authors) {
268+
if (authors.length === 1) return authors[0];
269+
if (authors.length === 2) return authors.join(' & ');
270+
return authors.map((au, idx) => {
271+
if (idx === (authors.length - 1)) return `& ${au}`;
272+
return au;
273+
}).join(', ');
274+
}

0 commit comments

Comments
 (0)