Skip to content

Commit 82d29d1

Browse files
authored
Merge pull request #31 from RappyTV/master
Several improvements
2 parents cb49fde + cab9459 commit 82d29d1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+336
-173
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
name: ci
2+
23
on:
34
push:
45
branches:
56
- master
7+
68
jobs:
79
deploy:
810
runs-on: ubuntu-latest
@@ -11,6 +13,7 @@ jobs:
1113
- uses: actions/setup-python@v2
1214
with:
1315
python-version: 3.x
14-
- run: pip install mkdocs-material
15-
- run: pip install mkdocs-include-dir-to-nav
16-
- run: mkdocs gh-deploy --force
16+
- name: Install dependencies
17+
run: pip install -r requirements.txt
18+
- name: Deploy docs
19+
run: mkdocs gh-deploy --force

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
*.iml
22
.idea/*
33
.vscode/*
4+
.venv
45
site/*

README.md

Lines changed: 52 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,55 @@
1-
# LabyMod4 API Wiki
1+
# LabyMod 4 API Wiki
22

3-
This is the official wiki for the LabyMod 4 API.
3+
This is the official wiki for the **LabyMod 4 API**.
4+
It contains guides, documentation, and examples on how to use and extend the API.
45

5-
Have you found something missing from this wiki that you think is important, or are you unhappy with something?
6-
Please fork this repository, add/improve it and create a pull request.
6+
## Contributing
77

8-
The live build can be found <a href="https://dev.labymod.net" target="_blank">here</a>.
8+
Have you found something missing from this wiki that you think is important, or are you unhappy with something?
9+
We welcome contributions! Simply fork this repository, add or improve the content, and then open a pull request.
10+
11+
Please make sure your changes are clear, well-formatted, and accurate before submitting.
12+
13+
## Live Build
14+
15+
The live version of this wiki can be found [here](https://dev.labymod.net).
16+
17+
## Preview Locally
18+
19+
To run the wiki locally, follow these steps:
20+
21+
### Requirements
22+
- [Python](https://www.python.org/downloads/) (3.8 or higher recommended)
23+
- [pip](https://pip.pypa.io/en/stable/)
24+
25+
### Setup
26+
27+
1. **Create a virtual environment**
28+
29+
```bash
30+
python -m venv .venv
31+
```
32+
33+
2. **Activate the virtual environment**
34+
35+
```bash
36+
# Windows (cmd)
37+
.venv\Scripts\activate.bat
38+
39+
# macOS / Linux
40+
source .venv/bin/activate
41+
```
42+
43+
3. **Install dependencies**
44+
45+
```bash
46+
pip install -r requirements.txt
47+
```
48+
49+
4. **Start the development server**
50+
51+
```bash
52+
mkdocs serve
53+
```
54+
55+
The wiki will now be available at http://127.0.0.1:8000.
2.8 MB
Loading

docs/pages/addon/activities/activity.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Only if you want to display something truly custom, knowing OpenGL could be bene
33

44
In the following pages, we will explain how to create custom activities, create and use widgets in your Activities, and theme them with LSS. It can be a bit much to take in at first, but it's worth it.
55

6-
Examples are shown on every page; you will find a link to the section with the example on every page within the first paragraphs. Click <a href="#bare-activity-example">here</a> to see the first example.
6+
Examples are shown on every page; you will find a link to the section with the example on every page within the first paragraphs. Click [here](#bare-activity-result) to see the first example.
77

88
???+ warning "Important Note"
99

@@ -50,4 +50,4 @@ Looking back at what we just wrote, this is what the code and result would look
5050
```
5151

5252
=== ":octicons-file-media-24: Result"
53-
![Config-Result](/assets/files/screenshots/bare-activity-example.png)
53+
![Config-Result](../../../assets/files/screenshots/bare-activity-example.png)

docs/pages/addon/activities/custom-widgets.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,4 +177,4 @@ you can do it in the Activity.
177177
```
178178

179179
=== ":octicons-file-media-24: Result"
180-
![Custom-Widget-Result](/assets/files/screenshots/lss-custom-widget-example.png)
180+
![Custom-Widget-Result](../../../assets/files/screenshots/lss-custom-widget-example.png)

docs/pages/addon/activities/lss.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ We have implemented LSS as a system to design and theme responsive GUIs (Screens
44
## LSS in a Nutshell
55

66
The main thing you need to know about LSS is that while you add LSS StyleSheets to your Activity, you can't manipulate Activities directly, only the Widgets inside of that Activity.
7-
A list of all Widgets delivered with the API can be found <a href="#FINAL-LINK-HERE">here</a>.
7+
A list of all Widgets delivered with the API can be found [here](widgets.md#all-widgets).
88

99
CSS and LSS have very similar syntax, but here are some of their differences:
1010

@@ -15,7 +15,7 @@ CSS and LSS have very similar syntax, but here are some of their differences:
1515

1616
## Creating Activities with LSS
1717

18-
Looking back at <a href="#FINAL-LINK-HERE">the last page</a>, we created an Activity with a ComponentWidget but without LSS.
18+
Looking back at [the last page](custom-widgets.md), we created an Activity with a ComponentWidget but without LSS.
1919
We'll again use the last page's result to make it work with LSS.
2020

2121
We start by deleting the `postStyleSheetLoad` method, which we used before to set the position of our Widget.
@@ -75,7 +75,7 @@ Like before, this is what the code we described above would look like:
7575
```
7676

7777
=== ":octicons-file-media-24: Result"
78-
![Config-Result](/assets/files/screenshots/lss-activity-example.png)
78+
![Config-Result](../../../assets/files/screenshots/lss-activity-example.png)
7979

8080

8181
## Injecting Blocks Into Other StyleSheets

docs/pages/addon/activities/themes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ simply taken from its parent.
3535
Besides any other file in your `assets/<my namespace>` folder there are also theme files located
3636
in `assets/<my namespace>/themes/<theme>` with the following structure:
3737

38-
![Theme-File-Tree](/assets/files/screenshots/theme-file-structure.png)
38+
![Theme-File-Tree](../../../assets/files/screenshots/theme-file-structure.png)
3939

4040
Usually you don't need to access these files directly because LabyMod handles it for stuff like LSS stylesheets,
4141
icons in the settings and hud widgets. If you still need to access a ThemeFile, it works like this:
@@ -49,7 +49,7 @@ public ResourceLocation getThemeResource() {
4949

5050
## Implement an existing theme in your addon
5151

52-
Coming from [Understand LSS](/pages/addon/activities/lss) you already know how to create LSS stylesheets for the
52+
Coming from [Understand LSS](lss.md) you already know how to create LSS stylesheets for the
5353
vanilla theme by putting them in `assets/example/themes/vanilla/lss/`. When implementing the fancy theme, you now want
5454
to put your new LSS stylesheets in `assets/example/themes/fancy/lss/` and name them exactly the same.
5555

docs/pages/addon/activities/widgets.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Widgets are a valuable and easy way to customize your Activities and are the bac
22

33
## Use Widgets in Activities
44

5-
This part will show you how to use and integrate Widgets into your Activity. Looking back at our bare Activity example, we rendered the text `"I am a bare rendered example text"`, so we'll be using a ComponentWidget just this time with the text `"I am an example text rendered with a ComponentWidget"`. We're building onto the code from the previous example so if you haven't already gone through it, we recommend taking a look at it <a href="/pages/addon/activities/activity/">here</a>.
5+
This part will show you how to use and integrate Widgets into your Activity. Looking back at our bare Activity example, we rendered the text `"I am a bare rendered example text"`, so we'll be using a ComponentWidget just this time with the text `"I am an example text rendered with a ComponentWidget"`. We're building onto the code from the previous example so if you haven't already gone through it, we recommend taking a look at it [here](activity.md).
66

77
???+ warning "Important Note"
88

@@ -56,13 +56,13 @@ Like with the bare Activity, this is what the code we described above would look
5656
```
5757

5858
=== ":octicons-file-media-24: Result"
59-
![Config-Result](/assets/files/screenshots/widget-activity-example.png)
59+
![Activity-Result](../../../assets/files/screenshots/widget-activity-example.png)
6060

6161
## All Widgets
6262

6363
Below listed are all Widgets for use. They can be extended and modified for a more specific use case. <br>
6464

65-
Every Widget also has the LSS Properties from <a href="#abstract-widget">`AbstractWidget`</a>
65+
Every Widget also has the LSS Properties from [`AbstractWidget`](#abstract-widget)
6666

6767
???+ warning "Important Note"
6868

@@ -78,8 +78,8 @@ The `ButtonWidget` is an Input-Widget that performs a specific action (set with
7878
It can be created with a String with `ButtonWidget.text` and a Component with `ButtonWidget.component`. <br>
7979
The Widget has the following LSS properties:
8080

81-
+ Everything from <a href="#FINAL-LINK-HERE">`HorizontalListWidget`</a> (because the Button can have an Icon)
82-
+ icon
81+
+ Everything from [`HorizontalListWidget`](#horizontal-list) (because the Button can have an Icon)
82+
+ icon
8383

8484
#### Check Box
8585

@@ -107,13 +107,13 @@ The Widget has no own LSS properties.
107107
The `KeybindWidget` is an Input-Widget that allows the user to set a specific Key.
108108
It also accepts mouse buttons when expressly set with `acceptMouseButtons(Boolean)`.
109109
It can be created via its constructor. <br>
110-
The Widget has the same LSS properties as <a href="#text-field">`TextFieldWidget`</a>.
110+
The Widget has the same LSS properties as [`TextFieldWidget`](#text-field).
111111

112112
#### Multi Keybind
113113

114114
The `MultiKeybindWidget` is an Input-Widget that allows users to set multiple keys simultaneously.
115115
It can be created via its constructor. <br>
116-
The Widget has the same LSS properties as <a href="#text-field">`TextFieldWidget`</a>.
116+
The Widget has the same LSS properties as [`TextFieldWidget`](#text-field).
117117

118118
#### Slider
119119

docs/pages/addon/features/commands.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
With LabyMod 4, you can easily create custom client-side commands. This page will show you how.
44

5+
???+ info "Command suggestions"
6+
Command suggestions are not yet supported. This means that commands will not appear as valid suggestions in the chat. However, you can still enter and execute them normally. Support for command suggestions may be added in the future.
7+
58
### The Super Method
69
The first parameter in the super constructor call is the prefix, see it as the name of your command. Every parameter after is an alias and thus optional.
710

@@ -11,7 +14,7 @@ The execute method contains the code that is executed if the player is using you
1114
Before you're able to use and test your command in-game, you'll need to register the command by calling `this.registerCommand(new ExampleCommand());` in your main class. You don't need to do anything else, after registering the command and restarting LabyMod you can submit "/notify" or "/alias" in the ingame-chat and your command will be executed.
1215

1316
### Subcommands
14-
You can also add subcommands to your command. To do so, you'll need to create a new class that inherits from `SubCommand` and add it to your command by calling `this.withSubCommand(new ExampleSubCommand());` in your command's constructor. You can set the sub command's name and aliases the same way you set the command's name with the <a href="#the-super-method">super</a> constructor call.
17+
You can also add subcommands to your command. To do so, you'll need to create a new class that inherits from `SubCommand` and add it to your command by calling `this.withSubCommand(new ExampleSubCommand());` in your command's constructor. You can set the sub command's name and aliases the same way you set the command's name with the [super](#the-super-method) constructor call.
1518

1619
=== ":octicons-file-code-16: ExampleCommand"
1720
```java

0 commit comments

Comments
 (0)