Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@ insert_final_newline = true

[*.{java,kt,kts,gradle}]
indent_style = tab
tab_width = 4
tab_width = 4

[*.{ts,js,css}]
indent_style = tab
tab_width = 2
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Gradle CI
name: Build and Test

on:
push:
Expand All @@ -10,7 +10,7 @@ on:
- '.gitignore'
- '.editorconfig'
- 'CHANGELOG.md'
- 'docs'
- 'docs/**'
pull_request:

permissions:
Expand Down
72 changes: 72 additions & 0 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Publish Docs
on:
push:
branches:
- 'main'
paths:
- 'docs/**'
- .github/workflows/publish-docs.yml
pull_request:
paths:
- 'docs/**'
- .github/workflows/publish-docs.yml

permissions:
contents: read
pull-requests: write

jobs:
release:
runs-on: ubuntu-latest

defaults:
run:
working-directory: ./docs

if: >
github.event_name == 'push' ||
github.event.pull_request.head.repo.full_name == github.repository

steps:
- uses: actions/checkout@v7
- uses: oven-sh/setup-bun@v2

- run: bun install --frozen-lockfile

- name: Deploy Production Docs
if: github.event_name == 'push'
run: bun wrangler deploy
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}

- name: Deploy Preview Docs
if: github.event_name == 'pull_request'
run: bun wrangler versions upload --preview-alias pr-${{ github.event.pull_request.number }}
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}

- name: Find preview comment
if: success() && github.event_name == 'pull_request'
id: find-preview-comment
uses: peter-evans/find-comment@v4
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: '<!-- controlify-docs-preview -->'

- name: Comment preview URL
if: success() && github.event_name == 'pull_request'
uses: peter-evans/create-or-update-comment@v5
with:
issue-number: ${{ github.event.pull_request.number }}
comment-id: ${{ steps.find-preview-comment.outputs.comment-id }}
edit-mode: replace
body: |
<!-- controlify-docs-preview -->
## 📖 Documentation preview

Preview: https://pr-${{ github.event.pull_request.number }}-controlify.isxander.workers.dev

Updated for `${{ github.event.pull_request.head.sha }}`
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release
name: Publish Mod
on: [workflow_dispatch]

permissions:
Expand Down Expand Up @@ -67,3 +67,12 @@ jobs:

git tag --annotate "$VERSION" --message "Release $VERSION"
git push origin "refs/tags/$VERSION"

- name: Write changelog to docs
run: ./gradlew writeChangelogToDocs

- name: Commit and push changelog
uses: stefanzweifel/git-auto-commit-action@v7
with:
file_pattern: 'docs/content/changelog/*'
commit_message: "chore: add changelog"
2 changes: 1 addition & 1 deletion .github/README.md → README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Controlify Splitscreen is a **separate mod in development** that adds splitscree

## [Wiki](https://moddedmc.wiki/project/controlify)

Read up on the [Controlify Wiki](https://moddedmc.wiki/project/controlify) for more information on how to use Controlify, how to configure it, and how to develop for it.
Read up on the [Controlify Wiki](https://controlify.isxander.dev) for more information on how to use Controlify, how to configure it, and how to develop for it.

## What is Controlify?

Expand Down
685 changes: 0 additions & 685 deletions TESTING_REPORT.md

This file was deleted.

Binary file added assets/icon-256-bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icon-256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file removed docs/.assets/controlify/images/container_guide.png
Binary file not shown.
Binary file removed docs/.assets/controlify/images/in_game_guide.png
Binary file not shown.
Binary file not shown.
36 changes: 36 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# dependencies (bun install)
node_modules

# output
out
dist
*.tgz

# code coverage
coverage
*.lcov

# logs
logs
_.log
report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# caches
.eslintcache
.cache
*.tsbuildinfo
.vitepress/cache
.wrangler

# IntelliJ based IDEs
.idea

# Finder (MacOS) folder config
.DS_Store
139 changes: 139 additions & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
import { defineConfig } from 'vitepress'
import { readdirSync } from "node:fs";
import { basename, extname } from "node:path";
import type { LanguageInput } from '@shikijs/types'
import mcfunctionGrammar from './grammars/mcfunction.tmLanguage.json' with { type: 'json' }

const changelogEntries = readdirSync("./content/changelog")
.filter(fileName => extname(fileName) === ".md")
.filter(fileName => fileName !== "index.md")
.sort((first, second) =>
second.localeCompare(first, undefined, { numeric: true })
)
.map(fileName => {
const version = basename(fileName, ".md");

return {
text: version,
link: `/changelog/${version}`,
};
});

export default defineConfig({
srcDir: 'content',
vite: { publicDir: '../public' },
title: 'Controlify',
description: 'Complete controller support for Minecraft: Java Edition.',
cleanUrls: true,
lastUpdated: true,
markdown: {
languages: [
'java',
'json',
'json5',
{
...mcfunctionGrammar,
name: 'mcfunction',
aliases: ['mcfunc']
} as unknown as LanguageInput
]
},
head: [
['link', { rel: 'icon', type: 'image/png', sizes: '256x256', href: '/icon-256-bg.png' }],
['meta', { name: 'theme-color', content: '#fafd9e' }],
['meta', { property: 'og:image', content: '/icon-256-bg.png' }]
],
themeConfig: {
logo: '/icon-256-bg.png',
siteTitle: 'Controlify',
search: { provider: 'local' },
nav: [
{ text: 'Players', link: '/users/controller-support' },
{ text: 'Resource Packs', link: '/resource-packs/custom-controller-identification' },
{ text: 'Developers', link: '/developers/getting-started' },
{ text: 'Reference', link: '/reference/builtin-bindings' },
{
text: 'Download',
items: [
{ text: 'Modrinth', link: 'https://modrinth.com/mod/controlify' },
{ text: 'CurseForge', link: 'https://www.curseforge.com/minecraft/mc-mods/controlify' }
]
}
],
sidebar: [
{
text: 'Players',
collapsed: false,
items: [
{
text: 'Controller Support',
link: '/users/controller-support',
items: [
{ text: "Playstation Controllers", link: '/users/controller-support/playstation-controllers' },
{ text: 'Valve Hardware', link: '/users/controller-support/valve-hardware' }
]
},
{ text: 'Mod Comparison', link: '/users/mod-comparison' }
]
},
{
text: 'Resource Packs',
collapsed: false,
items: [
{ text: 'Controller Identification', link: '/resource-packs/custom-controller-identification' },
{ text: 'Default Binds', link: '/resource-packs/default-binds' },
{ text: 'Input Glyphs', link: '/resource-packs/input-glyphs' },
{ text: 'Button Guides', link: '/resource-packs/guides' },
{ text: 'Keyboard Layouts', link: '/resource-packs/keyboard-layouts' },
{ text: 'Radial Menu Icons', link: '/resource-packs/radial-icons' },
{ text: 'Adaptive Trigger Effects', link: '/resource-packs/adaptive-trigger-effects' }
]
},
{
text: 'Developers',
collapsed: false,
items: [
{ text: 'Getting Started', link: '/developers/getting-started' },
{ text: 'Controlify Entrypoint', link: '/developers/controlify-entrypoint' },
{ text: 'Bindings API', link: '/developers/bindings-api' },
{ text: 'Screen Operation API', link: '/developers/screen-operation-api' },
{ text: 'Guides API', link: '/developers/guide-api' },
{ text: 'Adaptive Trigger API', link: '/developers/adaptive-trigger-api' }
]
},
{
text: 'Changelog',
collapsed: true,
items: changelogEntries
},
{
text: 'Reference',
collapsed: false,
items: [
{ text: 'Built-in Bindings', link: '/reference/builtin-bindings' },
{ text: 'Built-in Inputs', link: '/reference/builtin-inputs' },
{ text: 'Controller Namespaces', link: '/reference/builtin-controller-namespaces' }
]
},
{
text: 'Architecture',
items: [{ text: 'Controllers', link: '/architecture/controllers' }]
}
],
outline: { level: [2, 3], label: 'On this page' },
editLink: {
pattern: 'https://github.com/isXander/Controlify/edit/multiversion/dev/docs/content/:path',
text: 'Edit this page on GitHub'
},
socialLinks: [
{ icon: 'github', link: 'https://github.com/isXander/Controlify' },
{ icon: 'discord', link: 'https://short.isxander.dev/discord' }
],
footer: {
message: 'Controlify is an open-source Minecraft mod.',
copyright: 'Made with care by isXander and contributors.'
},
lastUpdated: { text: 'Updated' },
docFooter: { prev: 'Previous', next: 'Next' }
}
})
Loading
Loading