Compare commits
9 commits
feat/board
...
main
Author | SHA1 | Date | |
---|---|---|---|
4c04207151 | |||
d47b5ae07f | |||
476974346d | |||
5068e4ffd3 | |||
b96c4157e5 | |||
9894c6c810 | |||
ba06b79ef1 | |||
d6844a8bf5 | |||
bac570e78f |
4 changed files with 9 additions and 5 deletions
|
@ -5,8 +5,10 @@ on:
|
|||
- 'main'
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
if: github.repository == 'profectus-engine/profectus-docs'
|
||||
if: github.repository == 'profectus/profectus-docs'
|
||||
runs-on: docker
|
||||
container:
|
||||
image: node:21-bullseye
|
||||
steps:
|
||||
- name: Setup RSync
|
||||
run: |
|
||||
|
@ -27,5 +29,5 @@ jobs:
|
|||
- name: Deploy 🚀
|
||||
uses: https://github.com/JamesIves/github-pages-deploy-action@v4.2.5
|
||||
with:
|
||||
branch: pages # The branch the action should deploy to.
|
||||
branch: gh-pages # The branch the action should deploy to.
|
||||
folder: docs/.vitepress/dist # The folder the action should deploy.
|
||||
|
|
|
@ -28,6 +28,7 @@ module.exports = {
|
|||
{ text: "API", link: "/api", activeMatch: "^/api/" },
|
||||
{ text: "Forums", link: "https://forums.moddingtree.com" }
|
||||
],
|
||||
outline: [2, 3],
|
||||
socialLinks: [
|
||||
{ icon: "discord", link: "https://discord.gg/yJ4fjnjU54" },
|
||||
{ icon: { svg: '<svg id="erAGSmQsg5F1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 334.73599 164" shape-rendering="geometricPrecision" text-rendering="geometricPrecision"><g transform="translate(-1.000199-.435301)"><path d="M271.24983,105.65061q-.36,4.08-.31,8.47.05,4.56-4.49,8.19-9.11,7.28-17.84-.35c-5.3-4.65-3.99-10.34-4.42-16.25-11.33-3.3-21.65-12.470005-22.8-24.590005q-.53-5.59-.95-11.21-.04-.52-.53-.64c-4.87-1.23-7.99-2.08-10.29-6.94-3.9-8.23.79-15.35,8.92-18.12.175893-.059771.287747-.229624.27-.41-.74-8.02-1.4-15.08,1.56-22.79c3.11-8.09,9.57-14.26,17.53-17.62q4.11-1.73,10.44-2.07q8.68-.46,17.4-.26q16.85.37,26.28,13.59c6.43,9.02,5.96,18.48,5.03,29.16q-.05.51.45.64c13.7,3.61,12.56,22.82-1.42,24.78-.330958.046125-.58496.316783-.61.65-.38,5.39-.17,11.34-2.1,16.46q-5.7,15.160005-22.12,19.310005Z" fill="#6b438b"/><path d="M142.39,41.700605l-31,11.57c-.187231.072269-.39801.046259-.563762-.069568s-.265293-.306667-.266238-.510432l.01-19.31q0-.55.51-.74q23.03-8.68,46.02-17.25c2.57-.96,4.78-.76,7.42-.75.129956,0,.254589.051625.346482.143518s.143518.216526.143518.346482v132.320005c.000017.211265-.084586.413735-.23491.56218s-.353842.230494-.56509.22782l-19.99-.01q-1.17,0-1.17-1.16v-104.910005c.000142-.1604-.078229-.310715-.209821-.40243s-.299742-.113219-.450179-.05757Z" fill="#eceff4"/><path d="M59.21,74.480605h33.95c.222782,0,.436439.0885.59397.24603s.24603.371188.24603.59397l-.01,18.96c0,.222782-.0885.436439-.24603.59397s-.371188.24603-.59397.24603l-33.88.03c-.222782,0-.436439.0885-.59397.24603s-.24603.371188-.24603.59397l-.08,38.580005c0,.222782-.0885.436439-.24603.59397s-.371188.24603-.59397.24603l-20.11-.01c-.222782,0-.436439-.0885-.59397-.24603s-.24603-.371188-.24603-.59397l-.01-38.580005c0-.222782-.0885-.436439-.24603-.59397s-.371188-.24603-.59397-.24603h-33.87c-.222782,0-.436439-.0885-.59397-.24603s-.24603-.371188-.24603-.59397l.02-19.02c0-.222782.0885-.436439.24603-.59397s.371188-.24603.59397-.24603l33.86.02c.222782,0,.436439-.0885.59397-.24603s.24603-.371188.24603-.59397v-35.79c0-.222782.0885-.436439.24603-.59397s.371188-.24603.59397-.24603l20.13-.02c.222782,0,.436439.0885.59397.24603s.24603.371188.24603.59397v35.83c0,.222782.0885.436439.24603.59397s.371188.24603.59397.24603Z" fill="#eceff4"/><path d="M244.18983,105.71061c.43,5.91-.88,11.6,4.42,16.25q8.73,7.63,17.84.35q4.54-3.63,4.49-8.19-.05-4.39.31-8.47q24.6,4,42.34,20.72l-.18,37.49-110.93.01-.09-37.61q17.53-16.43,41.8-20.55Z" fill="#533566"/><path d="M202.38983,126.26061l.09,37.61-21.38-.49c-.35821-.009824-.690529-.18897-.89563-.482816s-.258668-.667556-.14437-1.007184q7.21-21.29,22.33-35.63Z" fill="#6b438b"/><path d="M313.58983,126.37061q12.71,12.03,19.9,29.52q1.79,4.36,2.23,6.86.11.61-.51.62l-21.8.49.18-37.49Z" fill="#6b438b"/></g></svg>' }, link: "https://code.incremental.social/profectus/Profectus" }
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Boards
|
||||
|
||||
The Board component allows you to make a pannable and zoomable "board" of components, called nodes. Instead of laying things out using the DOM, everything inside a board should be absolutely positioned. There are various utilities included in [board.tsx](/api/game/boards/board) to assist with implementing common behaviors with boards. Also, most of these code snippets are modified from [the demo project](https://code.incremental.social/profectus/Profectus-Demo/src/branch/main/src/data/layers/board.tsx), which may make a useful reference while implementing your own boards.
|
||||
The Board component allows you to make a pannable and zoomable "board" of components, called nodes. Instead of laying things out using the DOM, everything inside a board should be absolutely positioned. There are various utilities included in [board.tsx](/api/game/boards/board/) to assist with implementing common behaviors with boards. Also, most of these code snippets are modified from [the demo project](https://code.incremental.social/profectus/Profectus-Demo/src/branch/main/src/data/layers/board.tsx), which may make a useful reference while implementing your own boards.
|
||||
|
||||
To get started with a board, with a node that's just an upgrade locked to a specific location, it would look like this:
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@ function sort(a, b) {
|
|||
// Update sidebar file
|
||||
const sidebarText = fs.readFileSync("./docs/api/typedoc-sidebar.json")
|
||||
.toString()
|
||||
.replaceAll(/"[^"]*\/docs\/api\//g, '"/api/')
|
||||
.replaceAll('{"text":"Functions","collapsed":true', '{"text":"Functions","collapsed":false')
|
||||
.replaceAll('{"text":"Interfaces","collapsed":true', '{"text":"Interfaces","collapsed":false')
|
||||
.replaceAll('{"text":"Type Aliases","collapsed":true', '{"text":"Type Aliases","collapsed":false')
|
||||
|
@ -54,7 +55,7 @@ function sort(a, b) {
|
|||
}
|
||||
currentSidebar = nextSidebar.items;
|
||||
});
|
||||
currentSidebar.push({ text: path.basename(file).replace(".md", ""), link: `/..\\docs\\api/${relPath.replace("\\", "/")}/${path.basename(file)}` });
|
||||
currentSidebar.push({ text: path.basename(file).replace(".md", ""), link: `/api/${relPath.replace("\\", "/")}/${path.basename(file)}` });
|
||||
currentSidebar.sort(sort);
|
||||
const filePath = path.resolve(dir, file);
|
||||
const stream = fs.createReadStream(filePath);
|
||||
|
@ -94,7 +95,7 @@ function sort(a, b) {
|
|||
const fd = fs.openSync(filePath, "w+");
|
||||
fs.writeSync(fd, frontmatter);
|
||||
if (dir.includes("components")) {
|
||||
fs.writeSync(fd, `[Profectus](../../../index.md) / ${relPath.replaceAll("\\", "/").replaceAll("/components", "")} / ${path.basename(file).replace(".md", "")}\n\n`)
|
||||
fs.writeSync(fd, `[Profectus](${path.relative(dir, "./docs/api").replaceAll("\\", "/") + "/index.md"}) / ${relPath.replaceAll("\\", "/").replaceAll("/components", "")} / ${path.basename(file).replace(".md", "")}\n\n`)
|
||||
}
|
||||
fs.writeSync(fd, data);
|
||||
fs.closeSync(fd);
|
||||
|
|
Loading…
Add table
Reference in a new issue