diff --git a/scripts/cargo-subcommands.js b/scripts/cargo-subcommands.js deleted file mode 100644 index 6f38b388..00000000 --- a/scripts/cargo-subcommands.js +++ /dev/null @@ -1,18 +0,0 @@ -// https://github.com/rust-lang/cargo/wiki/Third-party-cargo-subcommands -let subcommands = []; -let subcommandIndex = document.querySelectorAll('.markdown-body>ul>li'); -for (let node of subcommandIndex) { - let a = node.firstElementChild; - let text = node.textContent.split(' - '); - text.shift(); - subcommands.push([prefixCargoSubcommandName(a.textContent), a.href, text.join()]); -} - -function prefixCargoSubcommandName(name) { - if (!name.startsWith("cargo")) { - return `cargo-${name}`; - } - return name; -} - -console.log(JSON.stringify(subcommands)); \ No newline at end of file diff --git a/scripts/rust-attributes.js b/scripts/rust-attributes.js deleted file mode 100644 index 11c7f810..00000000 --- a/scripts/rust-attributes.js +++ /dev/null @@ -1,33 +0,0 @@ -// https://doc.rust-lang.org/reference/attributes.html -// https://doc.rust-lang.org/nightly/reference/attributes.html -const attributeMap = { - doc: [ - "- Specifies documentation.", - "https://doc.rust-lang.org/rustdoc/the-doc-attribute.html", - ], - features: [ - "- Used to enable unstable or experimental compiler features.", - "https://doc.rust-lang.org/unstable-book/index.html", - ], -}; -let attributeIndex = document.querySelectorAll("main>ul:last-child>li"); -for (let node of attributeIndex) { - let title = node.firstChild; - if (["documentation", "features"].includes(title.textContent.toLowerCase().trim())) - continue; - let attributes = node.lastElementChild.querySelectorAll("ul>li"); - attributes.forEach(attribute => { - let description = ""; - - attribute.childNodes.forEach(childNode => { - if (childNode.nodeName !== "A" && childNode.textContent.trim().length > 1) { - description += childNode.textContent; - } - }); - attribute.querySelectorAll("a").forEach(a => { - attributeMap[a.firstChild.textContent] = [description.trim(), a.getAttribute("href")]; - }); - }); -} - -console.log(JSON.stringify(attributeMap)); \ No newline at end of file