feat(explorer): show embedded system definitions on the landing panel and as a topic

This commit is contained in:
Meysam Parvizi
2026-10-11 20:41:33 +02:00
parent 5b281a91e6
commit 2de24aea71
6 changed files with 108 additions and 7 deletions
+12 -1
View File
@@ -16,7 +16,7 @@ test('builds the topic tree from the README headings', () => {
assert.equal(find('1-Wire').parent.title, 'Basic Protocols');
assert.equal(find('High-Performance Computing (HPC)').parent.title, 'Multithreading & Parallel Processing');
assert.equal(find('History'), undefined);
assert.deepEqual(data.groups.map((g) => g.title), ["Don't Know Where to Start!", 'Learning Resources']);
assert.deepEqual(data.groups.map((g) => g.title), ['What is an Embedded System?', "Don't Know Where to Start!", 'Learning Resources']);
});
test('gives every topic a unique slug', () => {
@@ -38,6 +38,17 @@ test('keeps descriptions and the README introduction', () => {
assert.match(find('Microcontrollers').description[0].text, /^Microcontrollers are integrated circuits/);
});
test('parses sourced quotations as quote blocks and resources', () => {
const defs = find('Embedded System Definitions');
const quotes = defs.description.filter((b) => b.type === 'quote');
assert.equal(quotes.length, 5);
assert.equal(quotes[0].source, 'ISO/IEC/IEEE 24765 Standard');
assert.equal(quotes[0].paragraphs.length, 2);
assert.match(quotes[0].paragraphs[0], /rapid transit system\.$/, 'a lazy continuation line joins its paragraph');
assert.deepEqual(defs.resources.map((r) => r.title).slice(0, 2), ['ISO/IEC/IEEE 24765 Standard', '"Making Embedded Systems" Book']);
assert.equal(data.root.description.some((b) => b.type === 'quote'), false, 'README callouts are not quotations');
});
test('links topics that share a resource or mention each other', () => {
assert.ok(linked(find('Docker'), find('CI/CD Pipelines')).shared.length > 0);
assert.ok(linked(find('I2C'), find('Sensors')).mentions.length > 0);