Skip to content

Commit

Permalink
mkdocs base
Browse files Browse the repository at this point in the history
  • Loading branch information
Furrior committed Nov 21, 2023
1 parent b5aedf5 commit 1e194eb
Show file tree
Hide file tree
Showing 16 changed files with 177 additions and 157 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/version-and-changelog-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
dateFormat: "%d.%m.%Y"
output: "CHANGELOG.md"
output: "docs/CHANGELOG.md"
issueLineLabels: "ALL"
breakingLabels: "backwards-incompatible,breaking,rework,refactor"
futureRelease: ${{ env.FUTURE_RELEASE }}
Expand Down Expand Up @@ -250,7 +250,7 @@ jobs:
git pull origin ${{ github.base_ref }}
git config --local user.email "[email protected]"
git config --local user.name "github-actions"
git add CHANGELOG.md
git add docs/CHANGELOG.md
git commit -m "Updated CHANGELOG.md in https://github.com/${{github.repository}}/pull/${{github.event.number}}"
git push origin ${{ github.base_ref }}
else
Expand Down
72 changes: 1 addition & 71 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@

[![latest release](https://img.shields.io/github/v/release/ismoh/noitamp?include_prereleases&label=latest%20release&style=for-the-badge)](https://github.com/Ismoh/NoitaMP/releases)

### Table of Contents
## Table of Contents

- [TL:DR](#tldr)
- [Documentation](#documentation)
- [Our awesome and valuable Contributors](#our-awesome-and-valuable-contributors)
- [Credits, Supporter and special thanks](#credits-supporter-and-special-thanks)
- [Used libraries, frameworks and other stuff](#used-libraries-frameworks-and-other-stuff)
- [Roadmap](#roadmap)

## TL;DR
Expand Down Expand Up @@ -61,73 +58,6 @@ Let's see, if I can do so?! I am new to Lua and modding, but someone said to me:

Installation, configuration and support can be found on the [docs](https://ismoh.github.io/NoitaMP/).

## Our awesome and valuable Contributors

<a href="https://github.com/Ismoh/NoitaMP/graphs/contributors">
<img src="https://contrib.rocks/image?repo=Ismoh/NoitaMP" />
</a>

## Credits, Supporter and special thanks

I wouldn't be able to create this mod without the help by

- [@EvaisaGiac](https://github.com/EvaisaGiac/)
- [@TheHorscht](https://github.com/TheHorscht/)
- [@Pyry](https://github.com/probable-basilisk)
- [@DevonX](https://github.com/DevonX)
- [@shebpamm](https://github.com/shebpamm)
- @Coxas/Thighs
- [@dextercd](https://github.com/dextercd)
- [@BlueAmulet](https://github.com/BlueAmulet)
- [@Shaw](https://github.com/ShawSumma)
- [@Ramiels](https://github.com/Ramiels)
- [@bruham](https://steamcommunity.com/id/bruham/myworkshopfiles/?appid=881100)
- [@ofoxsmith](https://github.com/ofoxsmith)
- [@Myzumi](https://github.com/Myzumi)

I also want to say thank you to the sponsors of this project on

- [GitHub](https://github.com/sponsors/Ismoh)
- [Patreon](https://www.patreon.com/ismoh)
- [Discord](https://donatebot.io/checkout/747169041457872917)

| Name | Amount | Type | Start |
|:-------------------------------------------:|:--------:|:----------:|:--------------:|
| [stefnotch](https://github.com/stefnotch) | 20$ | one-time | Nov 18, 2022 |
| [den3606](https://github.com/den3606) | 1$ | monthly | Feb 8, 2023 |
| [clragon](https://github.com/clragon) | 25$ | one-time | Feb 17, 2023 |
| [stefnotch](https://github.com/stefnotch) | 20$ | one-time | Jul 13, 2023 |
| [conga lyne](https://github.com/Conga0) | 25$ | monthly | Jul 13, 2023 |
| [clragon](https://github.com/clragon) | 20$ | one-time | Jul 13, 2023 |

If you spot anything I should mention, feel free to create an issue or get in touch with [me](https://github.com/Ismoh)!

### Used libraries, frameworks and other stuff

Also, special thanks to the people, who share their libraries, frameworks and other stuff. See below!

- custom lua51.dll provided by Noita
- [luaJIT-2.0.4](https://github.com/LuaJIT/LuaJIT/releases/tag/v2.0.4) used by Noita
- [eNet](http://enet.bespin.org/) for network communication
- [lua-enet](https://github.com/leafo/lua-enet) for being able to use eNet in Lua
- [sock.lua](https://github.com/camchenry/sock.lua) for 'easy' to use lua-enet and eNet in Lua
- ~~[bitser.lua](https://github.com/gvx/bitser) for old serializing and deserializing data~~
- [pprint.lua](https://github.com/jagt/pprint.lua) for debugging with pretty prints
- ~~[json.lua](https://github.com/rxi/json.lua) for serializing and deserializing data in json format~~
- [nxml.lua](https://github.com/zatherz/luanxml) for editing xml files used by Noita
- ~~[EZGUI.lua](https://github.com/TheHorscht/EZGUI) for the GUI, but unfortunately it isn't maintained anymore~~
- [lua-watcher.lua](https://github.com/EvandroLG/lua-watcher) for getting the correct save path for Noita
- [lfs-ffi.lua](https://github.com/sonoro1234/luafilesystem) for lua file system
- [deepcopy.lua](https://gist.github.com/Deco/3985043) for being able to copy tables
- [libzstd.dll](https://github.com/facebook/zstd) for being able to compress and decompress data
- [zstd.lua](https://github.com/sjnam/luajit-zstd) for easy to use libzstd.dll in Lua
- [lua-MessagePack](https://framagit.org/fperrad/lua-MessagePack/-/tree/0.5.2) for serializing and deserializing data
- [plotly.lua](https://github.com/kenloen/plotly.lua) for plotting profiled data
- [dkjson.lua](https://github.com/LuaDist/dkjson) needed by plotly.lua

I had to build the network library by my own, because Noita provides its own lua51.dll. I struggled to build it, if you are interested in,
I've added all the necessary build files inside of .building/dll_building.7z and here you can see the [stackoverflow question](https://stackoverflow.com/questions/70048918/lua-5-1-package-loadlib-and-require-gcc-building-windows-dll) I've created.

## Roadmap

```mermaid
Expand Down
1 change: 0 additions & 1 deletion SUPPORT.md

This file was deleted.

File renamed without changes.
3 changes: 0 additions & 3 deletions docs/_config.yml

This file was deleted.

File renamed without changes.
66 changes: 66 additions & 0 deletions docs/about/credits.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Credits

## Our awesome and valuable Contributors

[![Contributors](https://contrib.rocks/image?repo=Ismoh/NoitaMP)](https://github.com/Ismoh/NoitaMP/graphs/contributors)

## Credits, Supporter and special thanks

I wouldn't be able to create this mod without the help by

- [@EvaisaGiac](https://github.com/EvaisaGiac/)
- [@TheHorscht](https://github.com/TheHorscht/)
- [@Pyry](https://github.com/probable-basilisk)
- [@DevonX](https://github.com/DevonX)
- [@shebpamm](https://github.com/shebpamm)
- @Coxas/Thighs
- [@dextercd](https://github.com/dextercd)
- [@BlueAmulet](https://github.com/BlueAmulet)
- [@Shaw](https://github.com/ShawSumma)
- [@Ramiels](https://github.com/Ramiels)
- [@bruham](https://steamcommunity.com/id/bruham/myworkshopfiles/?appid=881100)
- [@ofoxsmith](https://github.com/ofoxsmith)
- [@Myzumi](https://github.com/Myzumi)

I also want to say thank you to the sponsors of this project on

- [GitHub](https://github.com/sponsors/Ismoh)
- [Patreon](https://www.patreon.com/ismoh)
- [Discord](https://donatebot.io/checkout/747169041457872917)

| Name | Amount | Type | Start |
|:-------------------------------------------:|:--------:|:----------:|:--------------:|
| [stefnotch](https://github.com/stefnotch) | 20$ | one-time | Nov 18, 2022 |
| [den3606](https://github.com/den3606) | 1$ | monthly | Feb 8, 2023 |
| [clragon](https://github.com/clragon) | 25$ | one-time | Feb 17, 2023 |
| [stefnotch](https://github.com/stefnotch) | 20$ | one-time | Jul 13, 2023 |
| [conga lyne](https://github.com/Conga0) | 25$ | monthly | Jul 13, 2023 |
| [clragon](https://github.com/clragon) | 20$ | one-time | Jul 13, 2023 |

If you spot anything I should mention, feel free to create an issue or get in touch with [me](https://github.com/Ismoh)!

### Used libraries, frameworks and other stuff

Also, special thanks to the people, who share their libraries, frameworks and other stuff. See below!

- custom lua51.dll provided by Noita
- [luaJIT-2.0.4](https://github.com/LuaJIT/LuaJIT/releases/tag/v2.0.4) used by Noita
- [eNet](http://enet.bespin.org/) for network communication
- [lua-enet](https://github.com/leafo/lua-enet) for being able to use eNet in Lua
- [sock.lua](https://github.com/camchenry/sock.lua) for 'easy' to use lua-enet and eNet in Lua
- ~~[bitser.lua](https://github.com/gvx/bitser) for old serializing and deserializing data~~
- [pprint.lua](https://github.com/jagt/pprint.lua) for debugging with pretty prints
- ~~[json.lua](https://github.com/rxi/json.lua) for serializing and deserializing data in json format~~
- [nxml.lua](https://github.com/zatherz/luanxml) for editing xml files used by Noita
- ~~[EZGUI.lua](https://github.com/TheHorscht/EZGUI) for the GUI, but unfortunately it isn't maintained anymore~~
- [lua-watcher.lua](https://github.com/EvandroLG/lua-watcher) for getting the correct save path for Noita
- [lfs-ffi.lua](https://github.com/sonoro1234/luafilesystem) for lua file system
- [deepcopy.lua](https://gist.github.com/Deco/3985043) for being able to copy tables
- [libzstd.dll](https://github.com/facebook/zstd) for being able to compress and decompress data
- [zstd.lua](https://github.com/sjnam/luajit-zstd) for easy to use libzstd.dll in Lua
- [lua-MessagePack](https://framagit.org/fperrad/lua-MessagePack/-/tree/0.5.2) for serializing and deserializing data
- [plotly.lua](https://github.com/kenloen/plotly.lua) for plotting profiled data
- [dkjson.lua](https://github.com/LuaDist/dkjson) needed by plotly.lua

I had to build the network library by my own, because Noita provides its own lua51.dll. I struggled to build it, if you are interested in,
I've added all the necessary build files inside of .building/dll_building.7z and here you can see the [stackoverflow question](https://stackoverflow.com/questions/70048918/lua-5-1-package-loadlib-and-require-gcc-building-windows-dll) I've created.
File renamed without changes.
48 changes: 24 additions & 24 deletions CONTRIBUTING.md → docs/contributing/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Contributing to NoitaMP

I am happy to accept contributions to NoitaMP.\
Please follow these guidelines when contributing,\
I am happy to accept contributions to NoitaMP.
Please follow these guidelines when contributing,
but first off, thanks for taking the time to contribute!

## Table of Contents
Expand All @@ -21,7 +21,7 @@ but first off, thanks for taking the time to contribute!
- [ ] I have experience in Lua.
- [ ] I have experience in Noita modding.

To be honest, I am sure that you have experience in Lua and Noita modding and if you read this, you will probably be able to contribute to NoitaMP.\
To be honest, I am sure that you have experience in Lua and Noita modding and if you read this, you will probably be able to contribute to NoitaMP.
Everything will be explained here and if there are still questions, you can ask them in the [Discord server](https://discord.gg/DhMurdcw4k).

## Contributing
Expand All @@ -33,7 +33,7 @@ This is to avoid duplicate work.

## How does NoitaMP work?

NoitaMP is a mod that uses the [Noita API](https://noita.wiki.gg/wiki/Modding), but there is something that you need to know about the API.\
NoitaMP is a mod that uses the [Noita API](https://noita.wiki.gg/wiki/Modding), but there is something that you need to know about the API.
The API is a Lua library that is used to interact with the game.\
The API is not a mod, it is a library that is used to create mods.

Expand All @@ -45,19 +45,19 @@ There are different Lua contexts in Noita, but the most important one is the `in

Let me try to explain it with an example:
![NoitaMP](miscs/contributing-md/lua-contexts.png)
In the diagram above you can see the default Noita modding structure.\
In the diagram above you can see the default Noita modding structure.
There are different Lua contexts:

- One for `init.lua`
- This is the 'main' context that is used to interact with NoitaMP, because unrestricted Lua code (unrestricted mod mode) is only available in the `init.lua` context.
- and contexts for `LuaComponents`
- How contexts for LuaComponents are defined, depends on the value of `vm_type`.\
SHARED_BY_MANY_COMPONENTS means that for that script path, it uses a single Lua context.\
ONE_PER_COMPONENT_INSTANCE means that even with the same script path, every LuaComponent has its own Lua context.
The path of the entity XML file is irrelevant as far as I can tell.\
SHARED_BY_MANY_COMPONENTS is the default, see [wiki](https://noita.wiki.gg/wiki/Documentation:_LuaComponent)
- How contexts for LuaComponents are defined, depends on the value of `vm_type`.
`SHARED_BY_MANY_COMPONENTS` means that for that script path, it uses a single Lua context.
`ONE_PER_COMPONENT_INSTANCE` means that even with the same script path, every LuaComponent has its own Lua context.
The path of the entity XML file is irrelevant as far as I can tell.
`SHARED_BY_MANY_COMPONENTS` is the default, see [wiki](https://noita.wiki.gg/wiki/Documentation:_LuaComponent)

_Credits to dextercd_
_Credits to dextercd_

**You are able to use Noita API functions in each context, but you are not able to use functions from other contexts.**
There is no way to access the `init.lua` context from a LuaComponent context and vice versa, **but there are workarounds**!
Expand All @@ -70,13 +70,13 @@ There are different ways to communicate between contexts:
- VariableStorageComponents
- Using `init.lua` context only

Assume we need a value in NoitaMP, which can only be fetched in LuaComponents. So in different Lua contexts!\
Assume we need a value in NoitaMP, which can only be fetched in LuaComponents. So in different Lua contexts!
We can solve this problem by the examples below:

#### GlobalsSetValue and GlobalsGetValue

Then we would set a global "foo" variable in the `LuaComponent` context _(see 1 and 2 in the diagram below)_
and afterwards we would use the `init.lua` context to fetch the value of the global "foo" variable _(see 3 and 4 in the diagram below)_.\
and afterwards we would use the `init.lua` context to fetch the value of the global "foo" variable _(see 3 and 4 in the diagram below)_.
In addition, please note that `GlobalsSetValue` and `GlobalsGetValue` has nothing to do with Lua globals `_G`.
See diagram below for a better understanding:
![NoitaMP](miscs/contributing-md/lua-contexts-workaround.png)
Expand Down Expand Up @@ -113,7 +113,7 @@ end

#### Using init.lua context only

If you are able to use the `init.lua` context only, then you can use the NoitaMP functions directly.\
If you are able to use the `init.lua` context only, then you can use the NoitaMP functions directly.
For example, if you want to get local player/Minä, then you can use the NoitaMP function `MinaUtils.getLocalMinaInformation()`:

```lua
Expand All @@ -132,7 +132,7 @@ end

## 'Classes' in NoitaMP

Most of NoitaMPs functions are in 'class' tables, available in Luas globals `_G`.\
Most of NoitaMPs functions are in 'class' tables, available in Luas globals `_G`.
I tried to create topics for each class table, so you can find the global classes per topic:

- Mostly everything regarding Entities: `EntityUtils.lua`
Expand All @@ -142,16 +142,16 @@ I tried to create topics for each class table, so you can find the global classe
- Just some utilise functions: `util.lua`
- and so on...

I try to use KISS (Keep It Simple Stupid) and DRY (Don't Repeat Yourself) as much as possible.\
So before you want to add a new function, please try to use existing functions and classes, if possible.\
I try to use KISS (Keep It Simple Stupid) and DRY (Don't Repeat Yourself) as much as possible.
So before you want to add a new function, please try to use existing functions and classes, if possible.
If there are no existing functions or classes you could use, then take in mind:

- to create a new class with functions
- or to add functions to existing classes
- and add the `CustomProfiler` per new function.

`CustomProfiler` is a class that is used to measure the execution time of a function, because we had terrible performance issues and memory leaks in the past.\
Therefore it is important to measure the time of each function, so we can find the functions that are causing performance issues.\
`CustomProfiler` is a class that is used to measure the execution time of a function, because we had terrible performance issues and memory leaks in the past.
Therefore it is important to measure the time of each function, so we can find the functions that are causing performance issues.
To add the CustomProfiler to a function, you can use the following example:

```lua
Expand All @@ -177,11 +177,11 @@ end

## TTD - Test Driven Development

Please! Please! Please, make sure to write tests for your functions!\
I know it is not easy to write tests, but it is very important to do so.\
If you are not able to write tests, then please ask for help in the Discord server.\
I will help you to write tests for your functions.\
I will not accept any pull requests without tests, sorry.\
Please! Please! Please, make sure to write tests for your functions!
I know it is not easy to write tests, but it is very important to do so.
If you are not able to write tests, then please ask for help in the Discord server.
I will help you to write tests for your functions.
I will not accept any pull requests without tests, sorry.

### Location of tests

Expand Down
Loading

0 comments on commit 1e194eb

Please sign in to comment.