// Turns the roadmap README into a topic tree with descriptions, resources and cross-links. // Pure module: no DOM access, so it runs in the browser and under `node --test`. export const TYPES = { book: { icon: '📘', label: 'Book' }, video: { icon: '🎞️', label: 'Video' }, article: { icon: '📝', label: 'Article' }, link: { icon: '🔗', label: 'Link' }, audio: { icon: '🎧', label: 'Audio book' }, }; const TYPE_BY_SYMBOL = { '📘': 'book', '🎞': 'video', '📝': 'article', '🔗': 'link', '🎧': 'audio' }; // Heading prefixes the README uses only to mark the heading level. const LEVEL_MARKERS = new Set(['✳', '🔵', '🔶', '🔸']); const SYMBOLS = /^[\p{Extended_Pictographic}\uFE0F\u200D\u200C\u20E3\s]+/u; const INVISIBLE = /[\uFE0F\u200D\u200C\u20E3\s]/u; const URL_PART = String.raw`https?:\/\/[^\s()]+(?:\([^\s()]*\)[^\s()]*)*`; const HEADING = /^(#{1,6})\s+(.+)$/; const RESOURCE = new RegExp(String.raw`^\s*[-*]\s+\[(.+)\]\((${URL_PART})\)(.*)$`, 'u'); const HEADING_LINK = new RegExp(String.raw`^\[(.+)\]\((${URL_PART})\)$`, 'u'); const BULLET = /^\s*[-*]\s+(.+)$/; const SKIP = /^(\s*>|