-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfix-docs.js
19 lines (18 loc) · 1.22 KB
/
fix-docs.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
const fs = require("fs");
const path = require("path");
const files = fs.readdirSync(__dirname, { recursive: true }).filter(x => x.endsWith(".html")).map(x => path.join(__dirname, x));
for (const file of files) {
const content = fs.readFileSync(file, "utf8");
fs.writeFileSync(file, content
.replace(/<MoreIcons\.hpp>/g, "<hiimjustin000.more_icons/include/MoreIcons.hpp>")
.replace(/(\/classes\/[^'"]+)/g, "https://docs.geode-sdk.org$1")
.replace(/https:\/\/docs\.geode-sdk\.org\/classes\/IconInfo/g, "/classes/IconInfo")
.replace(/https:\/\/docs\.geode-sdk\.org\/classes\/MoreIcons/g, "/classes/MoreIcons")
.replace(/\/en\.cppreference\.com/g, "https://en.cppreference.com")
.replace(/\/w\/cpp\/vector\/vector/g, "/w/cpp/container/vector")
.replace(/\/w\/cpp\/xstring\/string/g, "/w/cpp/string/basic_string")
.replace(/\/w\/cpp\/string\.h\/string/g, "/w/cpp/string/basic_string")
.replace(/\/w\/cpp\/xstring\/string_view/g, "/w/cpp/string/basic_string_view")
.replace(/\/w\/cpp\/__msvc_string_view\.hpp\/string_view/g, "/w/cpp/string/basic_string_view")
.replace(/\/w\/cpp\/string_view\.h\/string_view/g, "/w/cpp/string/basic_string_view"));
}