Skip to content

Commit

Permalink
docs: cutstom styling (#2)
Browse files Browse the repository at this point in the history
* add: custom styling

- yellow
- duck
- stolen header from overextended docs

* chore: md formatting
  • Loading branch information
izmystic authored Sep 24, 2023
1 parent 6f305e3 commit ea0873c
Show file tree
Hide file tree
Showing 16 changed files with 236 additions and 176 deletions.
6 changes: 6 additions & 0 deletions pages/_app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import '../style.css'

// This default export is required in a new `pages/_app.js` file.
export default function MyApp({ Component, pageProps }) {
return <Component {...pageProps} />
}
96 changes: 45 additions & 51 deletions pages/contributors.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ First of all, thank you for taking the time to contribute!
These guidelines will help you help us in the best way possible regardless of your skill level. We ask that you try to read everything related to the way you'd like to contribute and try and use your best judgement for anything not covered.

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in
[RFC 2119](https://datatracker.ietf.org/doc/html/rfc2119).

Expand All @@ -16,17 +16,17 @@ NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
[I don't want to read this whole thing, I just have a question!!!](#i-dont-want-to-read-this-whole-thing-i-just-have-a-question)

[How Can I Contribute?](#how-can-i-contribute)
* [Reporting Bugs](#reporting-bugs)
* [Suggesting Features / Enhancements](#suggesting-features--enhancements)
* [Your First Code Contribution](#your-first-code-contribution)
* [Pull Requests](#pull-requests)

[Styleguides](#styleguides)
* [Git Commit Messages](#git-commit-messages)
* [Lua Styleguide](#lua-styleguide)
* [JavaScript Styleguide](#javascript-styleguide)
- [Reporting Bugs](#reporting-bugs)
- [Suggesting Features / Enhancements](#suggesting-features--enhancements)
- [Your First Code Contribution](#your-first-code-contribution)
- [Pull Requests](#pull-requests)

[Styleguides](#styleguides)

- [Git Commit Messages](#git-commit-messages)
- [Lua Styleguide](#lua-styleguide)
- [JavaScript Styleguide](#javascript-styleguide)

## Code of Conduct

Expand All @@ -42,8 +42,7 @@ NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and

> **Note:** Please don't file an issue to ask a question. You'll get faster results by using the resources below.
* [Qbox Discord](https://discord.gg/Z6Whda5hHA)

- [Qbox Discord](https://discord.gg/Z6Whda5hHA)

## How Can I Contribute?

Expand All @@ -57,41 +56,39 @@ Before creating bug reports, please check [this list](#before-submitting-a-bug-r
#### Before Submitting A Bug Report

* **Check the docs** There's a chance what you see as a bug might just work differently than you expect and if you think it could work better consider a feature enhancement report instead.
* **Search the [discord](https://discord.gg/Z6Whda5hHA)** to see if anyone else has run into the issue and see if it was solved through user error or code changes. (if the code change isn't pending a PR and you know what you're doing consider submitting one following [Pull Requests](#pull-requests) )
* **Determine which resource the problem should be reported in**. If the bug is related to the inventory for example report this bug under qb-inventory rather than under qb-core or some other resource.
* **Perform a [cursory search](https://github.com/search?q=is%3Aissue+user%3Aqbox-project)** to see if the problem has already been reported. If it has **and the issue is still open**, add a comment to the existing issue instead of opening a new one.
- **Check the docs** There's a chance what you see as a bug might just work differently than you expect and if you think it could work better consider a feature enhancement report instead.
- **Search the [discord](https://discord.gg/Z6Whda5hHA)** to see if anyone else has run into the issue and see if it was solved through user error or code changes. (if the code change isn't pending a PR and you know what you're doing consider submitting one following [Pull Requests](#pull-requests) )
- **Determine which resource the problem should be reported in**. If the bug is related to the inventory for example report this bug under qb-inventory rather than under qb-core or some other resource.
- **Perform a [cursory search](https://github.com/search?q=is%3Aissue+user%3Aqbox-project)** to see if the problem has already been reported. If it has **and the issue is still open**, add a comment to the existing issue instead of opening a new one.

#### How Do I Submit A (Good) Bug Report?

Bugs are tracked as [GitHub issues](https://guides.github.com/features/issues/). After you've determined which resource your bug is related to, create an issue on that repository and provide the following information by filling in bug-report template.

Explain the problem and include additional details to help maintainers reproduce the problem:

* **Use a clear and descriptive title** for the issue to identify the problem.
* **Describe the exact steps which reproduce the problem** in as many details as possible.
* **Provide specific examples to demonstrate the steps**. If something happened with only a specific group or single item but not others, specify that.
* **Describe the behavior you observed after following the steps** and point out what exactly is the problem with that behavior.
* **Explain which behavior you expected to see instead and why.**
* **Include screenshots** which show the specific bug in action or before and after.
* **If the problem wasn't triggered by a specific action**, describe what you were doing before the problem happened and share more information using the guidelines below.
- **Use a clear and descriptive title** for the issue to identify the problem.
- **Describe the exact steps which reproduce the problem** in as many details as possible.
- **Provide specific examples to demonstrate the steps**. If something happened with only a specific group or single item but not others, specify that.
- **Describe the behavior you observed after following the steps** and point out what exactly is the problem with that behavior.
- **Explain which behavior you expected to see instead and why.**
- **Include screenshots** which show the specific bug in action or before and after.
- **If the problem wasn't triggered by a specific action**, describe what you were doing before the problem happened and share more information using the guidelines below.

Provide more context by answering these questions if possible:

* **Did the problem start happening recently** (e.g. after updating to a new version of Qbox?) or was this always a problem?
* If the problem started happening recently, **can you reproduce the problem in an older version of Qbox?** What's the most recent commit in which the problem doesn't happen?
* **Can you reliably reproduce the issue?** If not, provide details about how often the problem happens and under which conditions it normally happens.
- **Did the problem start happening recently** (e.g. after updating to a new version of Qbox?) or was this always a problem?
- If the problem started happening recently, **can you reproduce the problem in an older version of Qbox?** What's the most recent commit in which the problem doesn't happen?
- **Can you reliably reproduce the issue?** If not, provide details about how often the problem happens and under which conditions it normally happens.

Include details about your setup:

* **When was your Qbox last updated?**
* **What OS is the server running on**?
* **Which *extra* resources do you have installed?**

- **When was your Qbox last updated?**
- **What OS is the server running on**?
- **Which _extra_ resources do you have installed?**

---


### Suggesting Features / Enhancements

This section guides you through submitting an enhancement suggestion for Qbox, including completely new features and minor improvements to existing functionality. Following these guidelines helps maintainers and the community understand your suggestion.
Expand All @@ -100,37 +97,31 @@ Before creating enhancement suggestions, please check [this list](#before-submit

#### Before Submitting An Enhancement Suggestion

* **Make sure it doesn't already exist.** Sounds silly, but there's a lot of features built in to Qbox that people don't realize so take a look through the docs and stuff to make sure it's not already there.
* **Check if there's already PR which provides that enhancement.**
* **Determine which resource the enhancement should be suggested in.** Whichever resource the suggestion is about, is where it should go. If the suggestion is about Qbox as a whole, make the suggestion in the qbx-core repository.
* **Perform a [cursory search](https://github.com/search?q=is%3Aissue+user%3Aqbox-project++&type=issues&state=open)** to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one.
- **Make sure it doesn't already exist.** Sounds silly, but there's a lot of features built in to Qbox that people don't realize so take a look through the docs and stuff to make sure it's not already there.
- **Check if there's already PR which provides that enhancement.**
- **Determine which resource the enhancement should be suggested in.** Whichever resource the suggestion is about, is where it should go. If the suggestion is about Qbox as a whole, make the suggestion in the qbx-core repository.
- **Perform a [cursory search](https://github.com/search?q=is%3Aissue+user%3Aqbox-project++&type=issues&state=open)** to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one.

#### How Do I Submit A (Good) Enhancement Suggestion?

Enhancement suggestions are tracked as [GitHub issues](https://guides.github.com/features/issues/). After you've determined which resource your enhancement suggestion is related to, create an issue on that repository and provide the following information:

* **Use a clear and descriptive title** for the issue to identify the suggestion.
* **Provide a step-by-step description of the suggested enhancement** in as many details as possible.
* **Provide specific examples to demonstrate the steps**. Include copy/pasteable snippets which you use in those examples, as [Markdown code blocks](https://help.github.com/articles/markdown-basics/#multiple-lines).
* **Describe the current behavior** and **explain which behavior you expected to see instead** and why.
* **Include screenshots and animated GIFs** which help you demonstrate the steps or point out the part of Qbox which the suggestion is related to.
* **Explain why this enhancement would be useful.**
* **Be creative and unique.** Stealing ideas from popular servers 1:1 detail isn't going to get accepted.

- **Use a clear and descriptive title** for the issue to identify the suggestion.
- **Provide a step-by-step description of the suggested enhancement** in as many details as possible.
- **Provide specific examples to demonstrate the steps**. Include copy/pasteable snippets which you use in those examples, as [Markdown code blocks](https://help.github.com/articles/markdown-basics/#multiple-lines).
- **Describe the current behavior** and **explain which behavior you expected to see instead** and why.
- **Include screenshots and animated GIFs** which help you demonstrate the steps or point out the part of Qbox which the suggestion is related to.
- **Explain why this enhancement would be useful.**
- **Be creative and unique.** Stealing ideas from popular servers 1:1 detail isn't going to get accepted.

---



### Your First Code Contribution

Unsure where to begin contributing to Qbox? You can start by looking through open [issues](https://github.com/orgs/Qbox-project/projects/4) for ones marked `beginner` or `help-wanted`.



---


### Pull Requests

The process described here has several goals:
Expand All @@ -149,27 +140,29 @@ Please follow these steps to have your contribution considered by the maintainer

While the prerequisites above SHOULD be satisfied prior to having your pull request reviewed, the reviewer(s) MAY ask you to complete additional design work, tests, or other changes before your pull request can be ultimately accepted.


---

## Styleguides

### Git Commit Messages

* Limit the first line to 72 characters or less.
* Reference issues and pull requests liberally after the first line.
* PR titles MUST follow https://www.conventionalcommits.org/en/v1.0.0/
- Limit the first line to 72 characters or less.
- Reference issues and pull requests liberally after the first line.
- PR titles MUST follow https://www.conventionalcommits.org/en/v1.0.0/

### Lua Styleguide

All lua code SHOULD be done using all the best practices of proper lua using the easiest to read yet fastest/most optimized methods of execution.

#### Naming

- Use `camelCase` for local variables, and functions
- Use `PascalCase` for global variables and functions
- Avoid acronyms, as they can be confusing and context dependent
- Be descriptive. Booleans can be prefixed with "is" or "has". Arrays SHOULD be named plural. Make it easy for the reader.

#### Everything Else

- All exported functions MUST include a properly annotated language server header. See https://github.com/sumneko/lua-language-server/wiki/Annotations
- Use 4 Space indentation
- Utilize [ox_lib](https://overextended.dev/ox_lib) to make your life easier. Prefer lib calls over native ones.
Expand All @@ -187,4 +180,5 @@ All lua code SHOULD be done using all the best practices of proper lua using the
- Instead of `table.insert(ages, "bob", 30)` use `ages["bob"] = 30`

### TypeScript/JavaScript Styleguide

- Consider following the [Google JavaScript Style Guide](https://google.github.io/styleguide/jsguide.html) and [Google TypeScript Style Guide](https://google.github.io/styleguide/tsguide.html)
2 changes: 1 addition & 1 deletion pages/converting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
1. Check your job grades in `qbx-core/shared/jobs.lua`. In Qbox, job grades are numbers without quotations, whereas in Qb they are strings.
2. Configure ox_inventory and convert your database. Back it up first! https://overextended.dev/ox_inventory/Frameworks/qb
3. For security, by default Qbox sets entity lock down mode to relaxed, which prevents clients from spawning networked entities. If you need to change this setting to support scripts that do this, set convar qbx:bucketlockdownmode to 'inactive'
4. Qbox has multicharacter built-in to core. If you want to keep using your own multicharacter resource, disable core's via core config. Otherwise delete your multicharacter resource.
4. Qbox has multicharacter built-in to core. If you want to keep using your own multicharacter resource, disable core's via core config. Otherwise delete your multicharacter resource.
3 changes: 3 additions & 0 deletions pages/developers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ This guide is intended for those creating scripts using qbx-core. Following thes
script to break in future Qbox updates.

## Do not access database tables owned by core

Doing this will break your script if the database schema changes in the future. If the data you need can't be read or written using a core function,
create a GitHub issue so we can rectify the problem for everyone.

## Do not modify core code

Doing this will make it difficult for you to update core and make it difficult to debug issues that may be due to custom changes. We've attempted to design things with flexibility in mind.
However, if you really think you need to modify core, file a GitHub issue first, and we'll see if we can trigger an event for you, surface a config value, or re-design something for the flexibility you need.

## Do not use deprecated functions/events

These are likely to be removed in future updates.
8 changes: 6 additions & 2 deletions pages/faq.mdx
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
# Frequently Asked Questions

## What are the differences between Qb and Qbox?

While originally forked from Qb, many Qbox resources have been refactored to improve code quality, enhance security, lower performance overhead, and integrate with [overextended](https://overextended.dev) resources.
Where appropriate Qbox also integrates directly with other open source projects, rather than maintain subpar resources in-house.
Qbox maintains high quality standards, with a strong community of regular contributors. As time goes on, expect greater differences in player facing features.
Qbox maintains high quality standards, with a strong community of regular contributors. As time goes on, expect greater differences in player facing features.

## Will Qb compatible scripts work with Qbox?

Most will as we've attempted to maintain backwards compatibility wherever possible. However, some scripts may require slight modifications to be compatible with Qbox.

## When will Qbox get a stable release?

Expect individual resources to get versioned releases over the coming months as they get stabilized and tested.

## Who should use Qbox?
Qbox is still effectively in an open beta. Users interested in contributing or helping to test and report bugs who don't need a stable framework should use Qbox.

Qbox is still effectively in an open beta. Users interested in contributing or helping to test and report bugs who don't need a stable framework should use Qbox.
2 changes: 1 addition & 1 deletion pages/resources/core.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Core

This is the main resource, the framework itself.
This is the main resource, the framework itself.
19 changes: 9 additions & 10 deletions pages/resources/core/events/client.mdx
Original file line number Diff line number Diff line change
@@ -1,69 +1,68 @@
import { Callout } from 'nextra/components';
import { Callout } from "nextra/components";

# Client

<Callout type="warning">
These events **MUST NOT** be triggered by any other scripts.
</Callout>


## Non-Networked Events


### QBCore:Client:OnPlayerLoaded

Player finishes spawning

```lua
AddEventHandler('QBCore:Client:OnPlayerLoaded', function() end)
```


## Networked Events

### QBCore:Client:SetDuty

Player's duty changes

```lua
---@param boolean onDuty
RegisterNetEvent('QBCore:Client:SetDuty', function(onDuty) end)
```


### QBCore:Client:OnPermissionUpdate

Player's permissions are updated. Only works for permissions set by qbx

```lua
RegisterNetEvent('QBCore:Client:OnPermissionUpdate', function() end)
```


### qbx-core:client:playerLoggedOut

Player logs out and no longer exists in core memory

```lua
RegisterNetEvent('qbx-core:client:playerLoggedOut', function() end)
```


### QBCore:Client:OnJobUpdate

Player's job is changed

```lua
---@param job Job
RegisterNetEvent('QBCore:Client:OnJobUpdate', function(job) end)
```


### QBCore:Client:OnGangUpdate

Player's gang is changed

```lua
---@param gang Gang
RegisterNetEvent('QBCore:Client:OnGangUpdate', function(gang) end)
```


### QBCore:Client:OnMoneyChange

Player's cash/bank balance is updated

```lua
Expand All @@ -72,4 +71,4 @@ Player's cash/bank balance is updated
---@param operation 'add' | 'remove' | 'set'
---@param reason string
RegisterNetEvent('QBCore:Client:OnMoneyChange', function(moneytype, amount, operation, reason) end)
```
```
Loading

0 comments on commit ea0873c

Please sign in to comment.