diff --git a/docs/api/reference/v1-x-x.md b/docs/api/reference/v1-x-x.md index e69de29..748bfe4 100644 --- a/docs/api/reference/v1-x-x.md +++ b/docs/api/reference/v1-x-x.md @@ -0,0 +1 @@ +This is the reference for the version [`v1.x.x`]() of the API. \ No newline at end of file diff --git a/docs/api/usage.md b/docs/api/usage/index.md similarity index 56% rename from docs/api/usage.md rename to docs/api/usage/index.md index db5b6fc..dc5db96 100644 --- a/docs/api/usage.md +++ b/docs/api/usage/index.md @@ -1,25 +1,25 @@ -## Intro Qui aliqua commodo laborum ad consequat pariatur. Amet consequat pariatur ex et nostrud sint laborum duis aute. Cillum consequat amet occaecat id sint. Aliquip consequat do incididunt enim cillum elit reprehenderit incididunt ut in eu qui culpa. ## Versioning The API uses [Semantic Versioning](https://semver.org). This means that any non-backward compatible change will result in an increment of the major version (`1.x.x` --> `2.x.x`). You can be confident that your integration will remain stable across updates, as long as the major version does not change. -Versions correspond to the [API Reference](reference/index.md). +Versions correspond to the [API Reference](../reference/index.md). ### Changelogs -* Version `1.x.x` represents the initial release of the API. +* Version [`v1.x.x`](../reference/v1-x-x.md) represents the initial release of the API. --- ## Quick Start Guide * Adding the api to your project -* Irure qui aliquip fugiat consectetur quis. +* Initializing the API +* Amet ex quis magna ullamco amet. +* Ad id quis proident dolore irure nostrud minim labore laboris anim sint. -## Adding the api to your project +### Adding the api to your project 1. Download the [Api file](). 2. Put in your project directory, under `/lua/api`. 3. Do not rename it, or you will need to change `#!lua require("api/BeamPermsAPI")`! - If you did everything correctly, your project should look something like this: ```hl_lines="2-3" my_plugin/ @@ -27,4 +27,29 @@ my_plugin/ │ └── api/ │ └── BeamPermsAPI.lua └── main.lua -``` \ No newline at end of file +``` + +### Initializing the API +1. Requiring the API file +```lua +BP = require("api/BeamPermsAPI") +``` +2. Checking if the API is available +```lua +if BP.isDisabled() then + ... -- The API is not available, functions will not be registered! +end +``` + +Which gives us the final code for the API: +```lua linenums="1" +BP = require("api/BeamPermsAPI") + +... + +if BP.isDisabled() then + print("BeamPermsAPI is disabled, ...") +end +``` + +**:tada: You can now use the API** \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index d2dd9b8..e83a771 100644 --- a/docs/index.md +++ b/docs/index.md @@ -13,4 +13,4 @@ You own a [BeamMP](https://beammp.com) server, and want to install the plugin? T ## For **Developers** -You are making a [BeamMP](https://beammp.com) plugin and want to make it compatible with **BeamPerms**? Our [Api Usage Guide](api/usage.md) is made for you! \ No newline at end of file +You are making a [BeamMP](https://beammp.com) plugin and want to make it compatible with **BeamPerms**? Our [Api Usage Guide](api/usage/index.md) is made for you! \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index ffd615b..3fb8211 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -92,7 +92,8 @@ nav: - Groups: features/groups.md - API: - - Usage: api/usage.md + - Usage: + - Usage: api/usage/index.md - Reference: - API Reference: api/reference/index.md - API v1.x.x: api/reference/v1-x-x.md \ No newline at end of file