Files
brk/website_next/explore/block/pane.js
T
2026-07-05 14:08:57 +02:00

20 lines
454 B
JavaScript

/** @param {string} title */
function groupName(title) {
return title.toLowerCase().replace(/[^a-z0-9]+/g, "-");
}
/**
* @param {HTMLElement} parent
* @param {string} title
* @param {Node[]} children
*/
export function appendPane(parent, title, children) {
if (!children.length) return;
const section = document.createElement("section");
section.dataset.group = groupName(title);
section.append(...children);
parent.append(section);
}