Skip to content

Commit 435e5a5

Browse files
committed
docs: Add docs generator
1 parent 93a1837 commit 435e5a5

14 files changed

Lines changed: 316 additions & 9 deletions

File tree

.github/workflows/docs.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Publish Documentation
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- master
8+
paths:
9+
- 'docs/**'
10+
- .github/workflows/docs.yml
11+
12+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
jobs:
19+
build:
20+
name: Build docs
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- uses: MineInAbyss/publish-action@v3
26+
with:
27+
publish-github-release: false
28+
build-tasks: 'docsGenerate'
29+
30+
- name: Update HTML links for GitHub Pages subdomain
31+
run: |
32+
find out -name "*.html" -exec sed -i 's#href="/#href="/guiy-compose/#g; s#src="/#src="/guiy-compose/#g; s#"/assets#"/guiy-compose/assets#g' {} \;
33+
34+
- name: Upload artifact
35+
uses: actions/upload-pages-artifact@v3
36+
with:
37+
path: out
38+
39+
deploy:
40+
environment:
41+
name: github-pages
42+
url: ${{ steps.deployment.outputs.page_url }}
43+
runs-on: ubuntu-latest
44+
needs: build
45+
steps:
46+
- name: Deploy to GitHub Pages
47+
id: deployment
48+
uses: actions/deploy-pages@v4

.github/workflows/gradle-ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: Java CI with Gradle
33
on:
44
pull_request:
55
paths-ignore:
6+
- docs
67
- '**.md'
78

89
concurrency:

.github/workflows/publish-packages.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
- master
77
- develop
88
paths-ignore:
9+
- docs
910
- '**.md'
1011

1112
jobs:

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Guiy
44

55
[![Maven](https://img.shields.io/maven-metadata/v?metadataUrl=https://repo.mineinabyss.com/releases/com/mineinabyss/guiy-compose/maven-metadata.xml)](https://repo.mineinabyss.com/#/releases/com/mineinabyss/guiy-compose)
6-
[![Contribute](https://shields.io/badge/Contribute-e57be5?logo=github%20sponsors&style=flat&logoColor=white)](https://wiki.mineinabyss.com/contribute/)
6+
[![Contribute](https://shields.io/badge/Contribute-e57be5?logo=github%20sponsors&style=flat&logoColor=white)](https://mineinabyss.com/contributing)
77
</div>
88

99
A Minecraft UI library for PaperMC, built on the Compose compiler.
@@ -35,7 +35,7 @@ guiy(player) {
3535
@Composable
3636
fun ExampleMenu() {
3737
// Guiy will dynamically update players, title, or height if you use a state.
38-
Chest(title = "Example", height = 4, onClose = { exit() /*reopen()*/ }) {
38+
Chest(title = "Example", modifier = Modifier.height(4), onClose = { exit() /*back()*/ }) {
3939
ToggleButton()
4040
}
4141
}
@@ -143,8 +143,9 @@ our [main project](https://github.com/MineInAbyss/MineInAbyss/tree/master/minein
143143

144144
```kotlin
145145
plugins {
146-
// Match version in guiy's build.gradle.kts
147-
id("org.jetbrains.compose") version "1.x.x"
146+
// Try to match version in guiy's build.gradle.kts
147+
id("org.jetbrains.kotlin.plugin.compose") version "<kotlin-version>"
148+
id("org.jetbrains.compose") version "<compose-version>"
148149
}
149150

150151
repositories {

build.gradle.kts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ plugins {
55
alias(idofrontLibs.plugins.mia.copyjar)
66
alias(idofrontLibs.plugins.mia.publication)
77
alias(idofrontLibs.plugins.mia.autoversion)
8+
alias(idofrontLibs.plugins.mia.docs)
89
alias(idofrontLibs.plugins.jetbrainsCompose)
910
alias(idofrontLibs.plugins.compose.compiler)
1011
}
@@ -42,3 +43,7 @@ dependencies {
4243
implementation(idofrontLibs.bundles.idofront.core)
4344
implementation(idofrontLibs.idofront.nms)
4445
}
46+
47+
idofront {
48+
docsVersion = "0.0.4"
49+
}

docs/SUMMARY.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
- [Home](/)
2+
- [Changelog](/changelog)
3+
- [Examples](/examples)
4+
5+
# Usage
6+
7+
- [Android Architecture](/usage/architecture)
8+
- [:barrier-block: Coming soon](/usage/inventories)

docs/TOPBAR.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[:brand-github: GitHub](https://github.com/MineInAbyss/guiy-compose)

docs/changelog.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6+
This project does NOT adhere to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [0.14.0] - Unreleased
9+
10+
### Added
11+
- New navigation system inspired by jetpack compose
12+
- Support for different inventory types like Anvil, and the ability to swap between them. See anvil gui example.
13+
- InventoryHolder system which manages switching between different inventories and manages viewers
14+
- Added some composables we created under MineInAbyss/MineInAbyss (ex. PlayerHead)
15+
- Back handler that pops navigation stack, or exits when empty by default
16+
- A basic `GuiyViewModel` class, and ability to register them with `viewModel { ... }`, and get them with `viewModel<MyViewModel>()`
17+
- These also provide a `viewModelScope` for correctly collecting state in sync with UI updates.
18+
- In the future, we plan to integrate with something like Koin for proper DI. Please note that currently ViewModels are tied to the composition as a whole, with an API for registering them per-screen coming later.
19+
- NOTE: Android's ViewModels do a lot under the hood, our goal is not to match behaviour perfectly but to provide enough functionality to follow architecture best practices.
20+
- Some new composition locals, including `LocalGuiyOwner` and `CurrentPlayer` getter for getting the first viewer for a running guiy instance.
21+
22+
### Changed
23+
- `onClose` doesn't require a `reopen` call anymore, instead reopening on its own. Call `exit` explicitly to exit (the default behaviour.)
24+
- Updates some composables to use nicer callbacks, ex. Paginated/Scrollable
25+
- Players are now passed once on gui creation, not per Inventory screen
26+
- Major internal cleanup and refactoring, unfortunately this leads to some package names changing
27+
28+
### Fixed
29+
- Flickering GUIs when switching screens
30+
- Mouse cursor resetting when switching screens of the same height
31+
- Use an immediate-style Dispatcher to let compose correctly finish recompositions in one loop
32+
- Double clicks being sent as well as two single click events with the default `clickable` modifier. This lead to unexpected extra clicks by default which are now fixed.

docs/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
name: Guiy

docs/examples.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Examples
2+
3+
We provide usage examples under `guiy-examples` in the project repo.
4+
These show both how to include guiy in gradle and depend on it as a paper plugin, and contain different menus showcasing
5+
guiy's features.
6+
7+
## Real-world examples
8+
9+
These are notable projects using guiy-compose that you can use as a reference.
10+
Most are used internally at Mine in Abyss, however feel free to reach out to us on Discord if you'd like to add your own open source project here.
11+
12+
| Reference | Description |
13+
|-----------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
14+
| [Mine in Abyss plugin](https://github.com/MineInAbyss/MineInAbyss/tree/master/mineinabyss-features/src/main/kotlin/com/mineinabyss/features/guilds/menus) | Uses guiy for most of our menus, the largest of which is our guild system. We are working to rewrite this using android architecture standards, please only use this as a general reference for composables, not state management. |
15+
| | |
16+

0 commit comments

Comments
 (0)