aboutsummaryrefslogtreecommitdiff
path: root/phttps___opencores.org_projects.json
blob: 3168a6d9db61161e08300628cc620a05edec9d80 (about) (plain)
1
[{"sopencores":{"url":"","hash":"","text":"/**\n * Copyright 2021 Wojtek Kosior\n *\n * Available under the terms of Creative Commons Zero.\n */\n\nlet data = JSON.parse(document.getElementById(\"__NEXT_DATA__\").textContent);\nlet sections = {};\nfor (let h1 of document.getElementsByClassName(\"cMJCrc\")) {\n    let ul = document.createElement(\"ul\");\n    if (h1.nextElementSibling !== null)\n\th1.parentNode.insertBefore(ul, h1.nextElementSibling);\n    else\n\th1.parentNode.appendChild(ul);\n\n    sections[h1.children[1].firstChild.textContent] = ul;\n}\n\nfor (let prop of data.props.pageProps.list) {\n    let ul = sections[prop.category];\n    if (ul === undefined) {\n\tconsole.log(`unknown category \"${prop.category}\" for project \"${prop.title}\"`);\n\tcontinue;\n    }\n\n    let li = document.createElement(\"li\");\n    let a = document.createElement(\"a\");\n    a.setAttribute(\"href\", \"/projects/\" + prop.slug);\n    a.textContent = prop.title;\n\n    li.appendChild(a);\n    ul.appendChild(li);\n}\n"}},{"phttps://opencores.org/projects":{"components":["s","opencores"]}}]