Tweaking docs

This commit is contained in:
thepaperpilot 2022-07-14 21:59:46 -05:00
parent 58c9523565
commit 32d527edeb
6 changed files with 37 additions and 35 deletions

View file

@ -25,7 +25,7 @@ module.exports = {
}, },
nav: [ nav: [
{ text: "Guide", link: "/guide/", activeMatch: "^/guide/" }, { text: "Guide", link: "/guide/", activeMatch: "^/guide/" },
{ text: "API", link: "/api/", activeMatch: "^/api/" }, { text: "API", link: "/api/overview", activeMatch: "^/api/" },
{ text: "Forums", link: "https://forums.moddingtree.com" } { text: "Forums", link: "https://forums.moddingtree.com" }
], ],
socialLinks: [ socialLinks: [

View file

@ -1,7 +1,7 @@
<template> <template>
<Layout> <Layout>
<template #home-hero-before> <template #home-hero-before>
<Profectus v-if="showLogo" style="height: 30vmin; margin: auto; display: block" /> <Profectus v-if="showLogo" style="height: 30vmin; margin: auto; display: block; margin-top: 10px;" />
<div v-else style="height: 30vmin; margin: auto; display: block" /> <div v-else style="height: 30vmin; margin: auto; display: block" />
</template> </template>
</Layout> </Layout>

View file

@ -26,20 +26,15 @@ body {
border: 1px solid var(--vp-c-divider-light); border: 1px solid var(--vp-c-divider-light);
} }
.vp-doc h1:first-child {
position: sticky;
top: 16px;
z-index: 20;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.content, .content,
.VPNav.no-sidebar { .VPNav.no-sidebar {
background: var(--vp-c-bg) !important; background: var(--vp-c-bg) !important;
} }
.VPNavBar {
border-bottom: 0 !important;
}
.vp-doc :not(pre) > code { .vp-doc :not(pre) > code {
color: var(--vp-c-text-light-1); color: var(--vp-c-text-light-1);
background-color: var(--vp-code-block-bg); background-color: var(--vp-code-block-bg);

View file

@ -9,6 +9,7 @@
--vp-c-divider-light: #4C566A; --vp-c-divider-light: #4C566A;
--vp-c-brand: #5E81AC; --vp-c-brand: #5E81AC;
--vp-c-brand-light: #81A1C1; --vp-c-brand-light: #81A1C1;
--vp-c-brand-dark: #81A1C1;
--vp-button-brand-border: #81A1C1; --vp-button-brand-border: #81A1C1;
--vp-button-brand-text: #ECEFF4; --vp-button-brand-text: #ECEFF4;
--vp-button-brand-hover-text: #ECEFF4; --vp-button-brand-hover-text: #ECEFF4;

3
overview.md Normal file
View file

@ -0,0 +1,3 @@
# Profectus API
This section of the docs is generated via the doc comments inside the Profectus source code. It can be used as a reference while developing, but should also appear in your preferred IDE as appropriate.

View file

@ -14,7 +14,10 @@ function walk(dir, cb) {
})); }));
} }
walk("./components", (dir, file, resolve) => { (async () => {
fs.copyFileSync("./overview.md", "./docs/api/overview.md");
fs.unlinkSync("./docs/api/index.md");
await walk("./components", (dir, file, resolve) => {
const relPath = path.relative("./components", dir); const relPath = path.relative("./components", dir);
let dest = path.resolve("./docs/api", relPath); let dest = path.resolve("./docs/api", relPath);
if (relPath.includes("features")) { if (relPath.includes("features")) {
@ -37,9 +40,9 @@ walk("./components", (dir, file, resolve) => {
} }
resolve(); resolve();
}); });
}).then(() => { });
const frontmatter = Buffer.from("---\neditLink: false\n---\n"); const frontmatter = Buffer.from("---\neditLink: false\n---\n");
walk("./docs/api", function addFrontmatter(dir, file, resolve) { await walk("./docs/api", function addFrontmatter(dir, file, resolve) {
if (path.extname(file) !== ".md") return; if (path.extname(file) !== ".md") return;
const filePath = path.resolve(dir, file); const filePath = path.resolve(dir, file);
if (dir.endsWith("interfaces")) { if (dir.endsWith("interfaces")) {
@ -67,4 +70,4 @@ walk("./components", (dir, file, resolve) => {
fs.closeSync(fd); fs.closeSync(fd);
resolve(); resolve();
}); });
}); })();