Skip to content

Commit 7a18b0c

Browse files
committed
Initial commit (pre-release just setup)
0 parents  commit 7a18b0c

File tree

11 files changed

+2638
-0
lines changed

11 files changed

+2638
-0
lines changed

.github/workflows/vitepress.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Sample workflow for building and deploying a VitePress site to GitHub Pages
2+
#
3+
name: Deploy VitePress site to Pages
4+
5+
on:
6+
# Runs on pushes targeting the `main` branch. Change this to `master` if you're
7+
# using the `master` branch as the default branch.
8+
push:
9+
branches: [main]
10+
11+
# Allows you to run this workflow manually from the Actions tab
12+
workflow_dispatch:
13+
14+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
15+
permissions:
16+
contents: read
17+
pages: write
18+
id-token: write
19+
20+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
21+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
22+
concurrency:
23+
group: pages
24+
cancel-in-progress: false
25+
26+
jobs:
27+
# Build job
28+
build:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v4
33+
with:
34+
fetch-depth: 0 # Not needed if lastUpdated is not enabled
35+
# - uses: pnpm/action-setup@v3 # Uncomment this block if you're using pnpm
36+
# with:
37+
# version: 9 # Not needed if you've set "packageManager" in package.json
38+
# - uses: oven-sh/setup-bun@v1 # Uncomment this if you're using Bun
39+
- name: Setup Node
40+
uses: actions/setup-node@v4
41+
with:
42+
node-version: 22
43+
cache: npm # or pnpm / yarn
44+
- name: Setup Pages
45+
uses: actions/configure-pages@v4
46+
- name: Install dependencies
47+
run: npm ci # or pnpm install / yarn install / bun install
48+
- name: Build with VitePress
49+
run: npm run docs:build # or pnpm docs:build / yarn docs:build / bun run docs:build
50+
- name: Upload artifact
51+
uses: actions/upload-pages-artifact@v3
52+
with:
53+
path: .vitepress/dist
54+
55+
# Deployment job
56+
deploy:
57+
environment:
58+
name: github-pages
59+
url: ${{ steps.deployment.outputs.page_url }}
60+
needs: build
61+
runs-on: ubuntu-latest
62+
name: Deploy
63+
steps:
64+
- name: Deploy to GitHub Pages
65+
id: deployment
66+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.vitepress/dist
2+
.vitepress/cache
3+
node_modules/

.vitepress/config.mjs

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
import { readdirSync, readFileSync, writeFileSync, existsSync, mkdirSync } from 'fs';
2+
import { resolve, join, dirname } from 'path';
3+
import { defineConfig } from 'vitepress'
4+
5+
// Paths
6+
const docsDir = resolve(__dirname, '..', 'docs');
7+
8+
// Marker used in generated proxy files so we can detect and skip them when auto-generating the sidebar
9+
const PROXY_MARKER = '<!-- generated-proxy -->';
10+
11+
// Helper: recursively list files in a directory (non-hidden entries)
12+
function listMarkdownFiles(dir) {
13+
const entries = readdirSync(dir, { withFileTypes: true });
14+
let files = [];
15+
for (const e of entries) {
16+
if (e.name.startsWith('.')) continue;
17+
const full = join(dir, e.name);
18+
if (e.isDirectory()) {
19+
files = files.concat(listMarkdownFiles(full));
20+
} else if (e.isFile() && e.name.endsWith('.md')) {
21+
files.push(full);
22+
}
23+
}
24+
return files;
25+
}
26+
27+
// Generate lightweight proxy .md files for any *.hidden.md so they are accessible at the normal path.
28+
// The proxy imports the hidden md as a Vue component and renders it, preserving the normal URL.
29+
function generateHiddenProxies() {
30+
const allMd = listMarkdownFiles(docsDir);
31+
for (const path of allMd) {
32+
if (path.endsWith('.hidden.md')) {
33+
const target = path.replace(/\.hidden\.md$/, '.md');
34+
// Do not overwrite existing non-proxy files
35+
if (existsSync(target)) {
36+
try {
37+
const content = readFileSync(target, 'utf8');
38+
if (content.includes(PROXY_MARKER)) continue;
39+
continue;
40+
} catch (e) {
41+
continue;
42+
}
43+
}
44+
45+
// Ensure directory exists (should already)
46+
const td = dirname(target);
47+
if (!existsSync(td)) mkdirSync(td, { recursive: true });
48+
49+
// Compute relative import path from target to hidden file
50+
const importPath = './' + path.slice(td.length + 1).replace(/\\/g, '/');
51+
// Build proxy content
52+
const proxyContent = `${PROXY_MARKER}\n<script setup>\nimport Content from '${importPath}'\n</script>\n\n<Content/>\n`;
53+
writeFileSync(target, proxyContent, 'utf8');
54+
}
55+
}
56+
}
57+
58+
// Run generator synchronously so proxies exist before VitePress reads files
59+
try {
60+
generateHiddenProxies();
61+
} catch (e) {
62+
// Fail silently — generation is best-effort
63+
console.error('generateHiddenProxies error:', e);
64+
}
65+
66+
// Build the sidebar auto-dynamically by top-level folders in `docs`
67+
function buildSidebar() {
68+
const entries = readdirSync(docsDir, { withFileTypes: true });
69+
const sidebar = [];
70+
71+
// Include top-level pages (root .md files other than index.md)
72+
const rootFiles = entries
73+
.filter(e => e.isFile() && e.name.endsWith('.md'))
74+
.map(e => join(docsDir, e.name));
75+
76+
const rootItems = rootFiles
77+
.map(full => {
78+
// Exclude .hidden.md and generated proxies
79+
if (full.endsWith('.hidden.md')) return null;
80+
try {
81+
const content = readFileSync(full, 'utf8');
82+
if (content.includes(PROXY_MARKER)) return null;
83+
} catch (e) {}
84+
const name = basenameWithoutExt(full);
85+
// Skip index.md (home) unless it's desired
86+
if (name === 'index') return null;
87+
return { text: name, link: `/${name}` };
88+
})
89+
.filter(Boolean);
90+
91+
if (rootItems.length) {
92+
sidebar.push({ text: 'root', items: rootItems });
93+
}
94+
95+
// For each top-level folder, collect its markdown files (non-hidden, non-proxy)
96+
for (const e of entries) {
97+
if (!e.isDirectory()) continue;
98+
const folderPath = join(docsDir, e.name);
99+
const files = readdirSync(folderPath, { withFileTypes: true })
100+
.filter(f => f.isFile() && f.name.endsWith('.md'))
101+
.map(f => join(folderPath, f.name))
102+
.filter(full => {
103+
if (full.endsWith('.hidden.md')) return false;
104+
try {
105+
const content = readFileSync(full, 'utf8');
106+
if (content.includes(PROXY_MARKER)) return false;
107+
} catch (err) {}
108+
return true;
109+
});
110+
111+
if (!files.length) continue;
112+
const items = files.map(full => {
113+
const name = basenameWithoutExt(full);
114+
// link should be /folder/name (strip any index specialness)
115+
const linkName = name === 'index' ? `/${e.name}/` : `/${e.name}/${name}`;
116+
return { text: name, link: linkName };
117+
});
118+
119+
sidebar.push({ text: e.name, items });
120+
}
121+
122+
// Prepend a home link
123+
sidebar.unshift({ text: 'home', link: '/azimuth' });
124+
return sidebar;
125+
}
126+
127+
function basenameWithoutExt(fullPath) {
128+
const base = fullPath.split(/\\|\//).pop();
129+
return base.replace(/\.hidden\.md$|\.md$/i, '');
130+
}
131+
132+
const sidebar = buildSidebar();
133+
134+
export default defineConfig({
135+
title: "Azimuth Docs",
136+
description: "Documentation of the Azimuth library",
137+
themeConfig: {
138+
nav: [
139+
{ text: 'home', link: '/azimuth' },
140+
],
141+
142+
sidebar: sidebar,
143+
144+
socialLinks: [
145+
{ icon: 'github', link: 'https://github.com/vuejs/vitepress' }
146+
]
147+
},
148+
srcDir: 'docs',
149+
})

docs/azimuth.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
outline: deep
3+
---
4+
5+
# Azimuth API Docs
6+
7+
This is the documentation for Azimuth, a minecraft mod library designed to extend the accessibility and capability of create's systems. Primarially for use with mods developed by Aztech group, but this documentation has been left as a public reference for anyone to use.
8+
9+
## Systems
10+
11+
Azimuth provides the following sytems:
12+
- Super Block Entity Behaviours
13+
-

docs/index.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
# https://vitepress.dev/reference/default-theme-home-page
3+
layout: home
4+
5+
hero:
6+
name: "Ferret Docs"
7+
text: "Documentation of ferret"
8+
tagline: My great project tagline
9+
actions:
10+
- theme: brand
11+
text: Markdown Examples
12+
link: /markdown-examples
13+
- theme: alt
14+
text: API Examples
15+
link: /api-examples
16+
17+
features:
18+
- title: Super Block Entity Behaviours
19+
details: Add new systems with full compatability with other mods
20+
- title: Feature B
21+
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
22+
- title: Feature C
23+
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
24+
---
25+

docs/markdown-examples.hidden.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Markdown Extension Examples
2+
3+
This page demonstrates some of the built-in markdown extensions provided by VitePress.
4+
5+
## Syntax Highlighting
6+
7+
VitePress provides Syntax Highlighting powered by [Shiki](https://github.com/shikijs/shiki), with additional features like line-highlighting:
8+
9+
**Input**
10+
11+
````md
12+
```js{4}
13+
export default {
14+
data () {
15+
return {
16+
msg: 'Highlighted!'
17+
}
18+
}
19+
}
20+
```
21+
````
22+
23+
**Output**
24+
25+
```js{4}
26+
export default {
27+
data () {
28+
return {
29+
msg: 'Highlighted!'
30+
}
31+
}
32+
}
33+
```
34+
35+
## Custom Containers
36+
37+
**Input**
38+
39+
```md
40+
::: info
41+
This is an info box.
42+
:::
43+
44+
::: tip
45+
This is a tip.
46+
:::
47+
48+
::: warning
49+
This is a warning.
50+
:::
51+
52+
::: danger
53+
This is a dangerous warning.
54+
:::
55+
56+
::: details
57+
This is a details block.
58+
:::
59+
```
60+
61+
**Output**
62+
63+
::: info
64+
This is an info box.
65+
:::
66+
67+
::: tip
68+
This is a tip.
69+
:::
70+
71+
::: warning
72+
This is a warning.
73+
:::
74+
75+
::: danger
76+
This is a dangerous warning.
77+
:::
78+
79+
::: details
80+
This is a details block.
81+
:::
82+
83+
## More
84+
85+
Check out the documentation for the [full list of markdown extensions](https://vitepress.dev/guide/markdown).

docs/markdown-examples.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<!-- generated-proxy -->
2+
<script setup>
3+
import Content from './markdown-examples.hidden.md'
4+
</script>
5+
6+
<Content/>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Super Block Entity Behaviour Extension Reference
2+
3+
This page serves as a reference for the Super Block Entity Behaviour system, and the various extensions that can be used with it. This is not an exhaustive reference, but rather a general overview of the system and its capabilities. For more detailed information on how to use the system, please refer to the [Super Block Entity Behaviours documentation](./super-behaviours.md).
4+
5+
| Extension | Description |
6+
| --- | --- |
7+
| `KineticBehaviourExtension` | Allows the behaviour to interact with kinetic block entities, such as providing additional propagation and connection logic. |
8+
| `RenderedBehaviourExtension` | Allows the behaviour to extend the blocks rendering, to allow for custom models to be overlaid on top of the blocks normal model. |
9+
| `ItemRequirementBehaviourExtension` | Allows the behaviour to specify item requirements for construction. |
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Super Block Entity Behaviours
2+
3+
## What are they?
4+
5+
Super Block Entity Behaviours are extended versions of block entity behaviours, but with the intention of full block entity level control. This means that they can add feature complete systems to blocks, without extensive mixins or direct control. The primary example of this is the Cogwheel Chain Drives from Bits 'n' Bobs, which are able to apply the behaviour to any coghwel block, regardless of the mod that added it.
6+
7+
## How do they work?
8+
9+
Super Block Entity Behaviours are simply an extension of traditional block entity behaviours, but with the addition of a few extra methods. These methods are mostly to help with accessing typical block entity data, such as the block state, position, and level.
10+
11+
The main power of the Super Block Entity Behaviours is the ability to use Extensions. Extensions are interfaces that mark additional capabilities that the behaviour requires. For example, the Cogwheel Chain Drive behaviour, among others, requires the `KineticBehaviourExtension`, where when applied to a `KineticBlockEntity`, it can provide additional propagation and connection logic, without needing to directly modify the `KineticBlockEntity` class.
12+
13+
The most powerful extension is the `RenderedBehaviourExtension`, which allows the behaviour to extend the blocks rendering, to allow for custom models to be overlaid on top of the blocks normal model. This is also used by the Cogwheel Chain Drive behaviour, to render the chain on top of the normal cog model.

0 commit comments

Comments
 (0)