Skip to content

Commit

Permalink
add features pages + api reference base
Browse files Browse the repository at this point in the history
  • Loading branch information
Neptnium committed May 15, 2024
1 parent 54e438c commit 17e926f
Show file tree
Hide file tree
Showing 12 changed files with 88 additions and 20 deletions.
10 changes: 0 additions & 10 deletions docs/api/reference.md

This file was deleted.

55 changes: 55 additions & 0 deletions docs/api/reference/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
This page is dedicated to the reference of the API.
Here, you will find the all the events that are available with the API, what are their parameters and how to use them.

!!! Warning "Information"
Please keep in mind that this page is for Experienced users, it requires some technical knowledge. Here is what you need to know:

* **Lua**
* **BeamMP** (*Server scripting*)
* **General Programming Understanding**

## **Example of an API Event**

!!! abstract "API Example Event"

``` mermaid
sequenceDiagram
participant API as API Implementation
participant BP as BeamPerms

Note over BP,API: This is an example of an API call <br><br> arg1: string <br> arg2: number <br><br> result1: string <br> result2: number
API->>+BP: "eventName", arg1, arg2
Note over BP: Process
BP->>-API: result1,result2
```

## **API Initialization Sequence**
???+ abstract "API Initialization Sequence"

``` mermaid
sequenceDiagram
participant API as API Implementation
participant BP as BeamPerms

Note over BP,API: Check if BeamPerms is present <br> (If there is an endpoint for the API)
API->>+BP: "checkBpPresence"
alt
Note over BP: Endpoint Found
BP->>-API: true
else
activate BP
Note over BP: Endpoint NOT Found <br> (By default BeamMP will return false)
BP--x-API: false
end

Note over BP,API: Check if API version is compatible <br><br> API_VERSION: string (Example: "v1.0.0")
API->>+BP: "checkBpApiCompatibility", API_VERSION
alt
Note over BP: Compatibility check is successful
BP->>-API: true
else
activate BP
Note over BP: Compatibility check is NOT successful
BP->>-API: false
end
```
Empty file added docs/api/reference/v1-x-x.md
Empty file.
2 changes: 1 addition & 1 deletion docs/api/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Qui aliqua commodo laborum ad consequat pariatur. Amet consequat pariatur ex et

## 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.md).
Versions correspond to the [API Reference](reference/index.md).

### Changelogs
* Version `1.x.x` represents the initial release of the API.
Expand Down
3 changes: 3 additions & 0 deletions docs/features/groups.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
!!! failure "Feature not yet implemented!"

This feature is not yet implemented, but planned for future releases!
17 changes: 16 additions & 1 deletion docs/features/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,23 @@

<div class="grid cards" markdown>

- :fontawesome-solid-earth-americas: __[Context]__ – Context
> :fontawesome-solid-file-pen: __[Web Editor]__ – Context
- :fontawesome-solid-server: __[Context]__ – Context

- :fontawesome-solid-weight-hanging: __[Weight]__ – Context

- :fontawesome-solid-tags: __[Prefix, Suffix]__ – Context

- :fontawesome-solid-book: __[Meta]__ – Context

> :fontawesome-solid-user-group: __[Groups]__ – Context
</div>

[Web Editor]: webeditor.md
[Context]: context.md
[Weight]: weight.md
[Prefix, Suffix]: prefix-suffix.md
[Meta]: meta.md
[Groups]: groups.md
Empty file added docs/features/meta.md
Empty file.
Empty file added docs/features/prefix-suffix.md
Empty file.
3 changes: 3 additions & 0 deletions docs/features/webeditor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
!!! failure "Feature not yet implemented!"

This feature is not yet implemented, but planned for future releases!
Empty file added docs/features/weight.md
Empty file.
5 changes: 0 additions & 5 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
hide:
- navigation
---
???+ warning

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod
nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor
massa, nec semper lorem quam in massa.

# Welcome to **BeamPerms** Docs! :tada:

Expand Down
13 changes: 10 additions & 3 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ theme:
- content.action.view
- navigation.footer
- navigation.tabs
- navigation.sections
- navigation.expand
- navigation.path
- navigation.tracking
- navigation.indexes
- toc.follow
- navigation.top
icon:
repo: fontawesome/brands/github
palette:
Expand Down Expand Up @@ -82,9 +82,16 @@ nav:
- Storage Methods: getting-started/storage-methods.md

- Features:
- features/index.md
- Features: features/index.md
- Web Editor: features/webeditor.md
- Context: features/context.md
- Weight: features/weight.md
- Prefix, Suffix: features/prefix-suffix.md
- Meta: features/meta.md
- Groups: features/groups.md

- API:
- Usage: api/usage.md
- Reference: api/reference.md
- Reference:
- API Reference: api/reference/index.md
- API v1.x.x: api/reference/v1-x-x.md

0 comments on commit 17e926f

Please sign in to comment.