diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 00000000..c89864b4 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,9 @@ +{ + "printWidth": 120, + "singleQuote": true, + "useTabs": false, + "tabWidth": 2, + "semi": true, + "bracketSpacing": true, + "trailingComma": "es5" + } \ No newline at end of file diff --git a/docs/ox_lib/Callbacks/Client/index.md b/docs/ox_lib/Callbacks/Client/index.md new file mode 100644 index 00000000..e69de29b diff --git a/docs/ox_lib/Callbacks/Server/index.md b/docs/ox_lib/Callbacks/Server/index.md new file mode 100644 index 00000000..e69de29b diff --git a/docs/ox_lib/Commands/Server/index.md b/docs/ox_lib/Commands/Server/index.md new file mode 100644 index 00000000..3560fcbc --- /dev/null +++ b/docs/ox_lib/Commands/Server/index.md @@ -0,0 +1,17 @@ +```lua +-- principal: string or false +-- command: string +-- callback: function +-- parameters: table (optional) +-- help: string (optional) +lib.commands(principal, command, callback, parameters, help) +``` + +```lua +lib.commands('group.admin', {'additem', 'giveitem'}, function(source, args) + args.item = Items(args.item) + if args.item and args.count > 0 then + Inventory.AddItem(args.target, args.item.name, args.count, args.metatype) + end +end, {'target:number', 'item:string', 'count:number', 'metatype:?string'}) +``` diff --git a/docs/OxMySQL/Installation/index.md b/docs/oxmysql/Installation/index.md similarity index 100% rename from docs/OxMySQL/Installation/index.md rename to docs/oxmysql/Installation/index.md diff --git a/docusaurus.config.js b/docusaurus.config.js index ddce7f3d..af4af3cd 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -16,6 +16,8 @@ const config = { organizationName: 'overextended', // Usually your GitHub org/user name. projectName: 'overextended.github.io', // Usually your repo name. +// plugins: ['@docusaurus/'], + presets: [ [ 'classic', @@ -38,7 +40,7 @@ const config = { ({ colorMode: { defaultMode: 'dark', - disableSwitch: true + disableSwitch: true, }, navbar: { title: 'Overextended', @@ -50,14 +52,14 @@ const config = { }, items: [ { - href: "https://www.github.com/overextended", + href: 'https://www.github.com/overextended', label: 'GitHub', - position: 'left' + position: 'left', }, { - href: "https://www.discord.gg/overextended", + href: 'https://www.discord.gg/overextended', label: 'Discord', - position: 'left' + position: 'left', }, { to: 'docs/', @@ -67,8 +69,8 @@ const config = { { // Still have to add the actual search :( type: 'search', - position: 'right' - } + position: 'right', + }, ], }, footer: { @@ -78,6 +80,7 @@ const config = { prism: { theme: lightCodeTheme, darkTheme: darkCodeTheme, + additionalLanguages: ['lua'] }, }), }; diff --git a/sidebars.js b/sidebars.js index 67cb4c2c..79315e7a 100644 --- a/sidebars.js +++ b/sidebars.js @@ -25,7 +25,27 @@ const sidebars = { }, { type: 'category', - label: "ox_inventory", + label: 'MySQL', + items: [ + { + type: 'autogenerated', + dirName: 'oxmysql' + } + ] + }, + { + type: 'category', + label: 'Library', + items: [ + { + type: 'autogenerated', + dirName: 'ox_lib' + } + ] + }, + { + type: 'category', + label: "Inventory", items: [ { type: 'autogenerated', @@ -33,23 +53,6 @@ const sidebars = { } ] }, - { - type: 'category', - label: 'OxMySQL', - items: [ - { - type: 'autogenerated', - dirName: 'OxMySQL' - } - ] - } - // "ox_inventory": [ - // { - // type: 'category', - // label: 'Internal', - // items: ['ox_inventory/Internal/Client/', 'ox_inventory/Internal/Server/'] - // } - // ] ] }; diff --git a/src/theme/prism-include-languages.js b/src/theme/prism-include-languages.js new file mode 100644 index 00000000..1e666654 --- /dev/null +++ b/src/theme/prism-include-languages.js @@ -0,0 +1,25 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import siteConfig from '@generated/docusaurus.config'; +export default function prismIncludeLanguages(PrismObject) { + const { + themeConfig: {prism}, + } = siteConfig; + const {additionalLanguages} = prism; // Prism components work on the Prism instance on the window, while prism- + // react-renderer uses its own Prism instance. We temporarily mount the + // instance onto window, import components to enhance it, then remove it to + // avoid polluting global namespace. + // You can mutate PrismObject: registering plugins, deleting languages... As + // long as you don't re-assign it + + globalThis.Prism = PrismObject; + additionalLanguages.forEach((lang) => { + // eslint-disable-next-line global-require, import/no-dynamic-require + require(`prismjs/components/prism-${lang}`); + }); + delete globalThis.Prism; +}