Skip to content

Commit bd53d3a

Browse files
authored
Merge pull request #44 from BetterDiscord/feat/typedoc-api
Use typedoc generated api reference
2 parents 055311d + a8bc2c1 commit bd53d3a

132 files changed

Lines changed: 13241 additions & 1621 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.vitepress/config.ts

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -113,16 +113,16 @@ const VITEPRESS_CONFIG: UserConfig<DefaultTheme.Config> = {
113113
const words = ["BdApi"];
114114
options.decorations ||= [];
115115
for (const word of words) {
116-
const indexes = findAllSubstringIndexes(code, word);
117-
for (const index of indexes) {
118-
options.decorations.push({
119-
start: index,
120-
end: index + word.length,
121-
properties: {
122-
"class": "global-bdapi",
123-
},
124-
});
125-
}
116+
const indexes = findAllSubstringIndexes(code, word);
117+
for (const index of indexes) {
118+
options.decorations.push({
119+
start: index,
120+
end: index + word.length,
121+
properties: {
122+
"class": "global-bdapi",
123+
},
124+
});
125+
}
126126
}
127127
},
128128
}
@@ -170,7 +170,14 @@ const VITEPRESS_CONFIG: UserConfig<DefaultTheme.Config> = {
170170
},
171171
})
172172
]
173-
}
173+
},
174+
transformPageData: (pageData) => {
175+
if (pageData.relativePath.startsWith("api/")) {
176+
pageData.frontmatter.outline = [2, 3];
177+
}
178+
179+
return pageData;
180+
},
174181
};
175182

176183

@@ -180,8 +187,11 @@ const SIDEBARS: VitePressSidebarOptions[] = [
180187
scanStartPath: "api",
181188
basePath: "/api/",
182189
resolvePath: "/api/",
183-
useTitleFromFileHeading: true,
190+
useTitleFromFrontmatter: true,
191+
// useTitleFromFileHeading: true,
184192
includeRootIndexFile: true,
193+
capitalizeEachWords: true,
194+
collapsed: false,
185195
sortFolderTo: "bottom",
186196
sortMenusByFrontmatterOrder: true,
187197
frontmatterOrderDefaultValue: 1,
@@ -254,7 +264,8 @@ const SIDEBARS: VitePressSidebarOptions[] = [
254264
sortMenusByFrontmatterOrder: true,
255265
frontmatterOrderDefaultValue: 1,
256266
manualSortFileNameByPriority: ["introduction", "basics", "intermediate", "advanced"],
257-
}
267+
},
258268
];
259269

260-
export default defineConfig(withSidebar(VITEPRESS_CONFIG, SIDEBARS));
270+
const userConfig: Partial<UserConfig> = withSidebar(VITEPRESS_CONFIG, SIDEBARS);
271+
export default defineConfig(userConfig);

bun.lock

Lines changed: 1077 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/api/addonapi.md

Lines changed: 0 additions & 81 deletions
This file was deleted.

0 commit comments

Comments
 (0)