From 29643fe1d5b0cf60bc3c0de9e7bcc7eb9b894fd9 Mon Sep 17 00:00:00 2001 From: DarthMooMancer <107283522+DarthMooMancer@users.noreply.github.com> Date: Wed, 16 Apr 2025 03:38:34 -0400 Subject: [PATCH] Updated language docs --- docs/languages/c.md | 50 ++++++++++++++++++++++++++------ docs/languages/cpp.md | 61 ++++++++++++++++++++++++++++++++++++++++ docs/languages/java.md | 47 +++++++++++++++++++++++++++---- docs/languages/lua.md | 58 ++++++++++++++++++++++++++++++++------ docs/languages/python.md | 55 +++++++++++++++++++++++++++++------- 5 files changed, 238 insertions(+), 33 deletions(-) create mode 100644 docs/languages/cpp.md diff --git a/docs/languages/c.md b/docs/languages/c.md index 0354bf6..2a7bccd 100644 --- a/docs/languages/c.md +++ b/docs/languages/c.md @@ -1,19 +1,49 @@ -## Key Notes -* Currently with the way I have it work, the first time you build a project, it will error out no matter what. Just rerun the build and then if there are errors it is most likely a you issue more than a me issue. +### C Setup for Polydev ๐Ÿ› ๏ธ + +#### Key Notes โš ๏ธ +> **Important**: The first time you build a project, it might throw an error. This is expected behavior. Simply rerun the build, and if errors persist, it may be an issue with your project setup rather than the plugin. + +--- + +#### Keybinds ๐ŸŽฎ +You can customize keybinds for your C projects with Polydev. + +| Keybind | Action | +|---------------------|--------------------------------------------------| +| `pb` | Build all C files in the `src` directory | +| `pr` | Run `` in your build directory | +| `nh` | Create a new header file in the current projectโ€™s `src` folder | + +#### Configuration Example: -## Keybinds ```lua require("Polydev").c.setup({ keybinds = { - [""] = "CloseTerminal" -- Closes terminal, esc by default. - ["pb"] = "CBuild", -- Building all C Files in src directory in. - ["pr"] = "CRun", -- Runs in your build directory - ["nf"] = "NewCFile", -- Creates a new c file in the current project src folder - ["nh"] = "NewCHeaderFile", -- Creates a new header file in the current project src folder + ["pb"] = "CBuild", -- Build all C files in the src directory + ["pr"] = "CRun", -- Run in your build directory + ["nh"] = "NewCHeaderFile" -- Create a new header file in the current projectโ€™s src folder + } }) ``` -## File Structure +--- + +#### File Structure ๐Ÿ“‚ +This is the recommended file structure for your C projects using Polydev: + +| Directory/File Path | Description | +|----------------------------|------------------------------------------------------| +| `CMakeLists.txt` | Configuration file for your project build | +| `src/` | Folder containing source files for the project | +| `main.c` | Main C file for the project | +| `*.c` | Additional C source files | +| `build/` | Folder where the build artifacts will be generated | +| `.polydev` | Polydev metadata file (generated during build) | +| `include/` | Folder for header files | +| `*.h` | C header files | + +#### Example Structure: + ```md Projects/ โ””โ”€โ”€ C/ @@ -27,3 +57,5 @@ Projects/ โ””โ”€โ”€ include/ โ””โ”€โ”€ *.h ``` + +--- diff --git a/docs/languages/cpp.md b/docs/languages/cpp.md new file mode 100644 index 0000000..d66f366 --- /dev/null +++ b/docs/languages/cpp.md @@ -0,0 +1,61 @@ +### C Setup for Polydev ๐Ÿ› ๏ธ + +#### Key Notes โš ๏ธ +> **Important**: The first time you build a project, it might throw an error. This is expected behavior. Simply rerun the build, and if errors persist, it may be an issue with your project setup rather than the plugin. + +--- + +#### Keybinds ๐ŸŽฎ +You can customize keybinds for your C projects with Polydev. + +| Keybind | Action | +|---------------------|--------------------------------------------------| +| `pb` | Build all C files in the `src` directory | +| `pr` | Run `` in your build directory | +| `nh` | Create a new header file in the current projectโ€™s `src` folder | + +#### Configuration Example: + +```lua +require("Polydev").c.setup({ + keybinds = { + ["pb"] = "CppBuild", -- Build all C files in the src directory + ["pr"] = "CppRun", -- Run in your build directory + ["nh"] = "NewCppHeaderFile" -- Create a new header file in the current projectโ€™s src folder + } +}) +``` + +--- + +#### File Structure ๐Ÿ“‚ +This is the recommended file structure for your C projects using Polydev: + +| Directory/File Path | Description | +|----------------------------|------------------------------------------------------| +| `CMakeLists.txt` | Configuration file for your project build | +| `src/` | Folder containing source files for the project | +| `main.cpp` | Main Cpp file for the project | +| `*.cpp` | Additional Cpp source files | +| `build/` | Folder where the build artifacts will be generated | +| `.polydev` | Polydev metadata file (generated during build) | +| `include/` | Folder for header files | +| `*.hpp` | Cpp header files | + +#### Example Structure: + +```md +Projects/ +โ””โ”€โ”€ Cpp/ + โ””โ”€โ”€ Project_Name/ + โ”œโ”€โ”€ CMakeLists.txt + โ”œโ”€โ”€ src/ + โ”‚ โ”œโ”€โ”€ main.cpp + โ”‚ โ””โ”€โ”€ *.cpp + โ”œโ”€โ”€ build/ + โ”‚ โ””โ”€โ”€ .polydev + โ””โ”€โ”€ include/ + โ””โ”€โ”€ *.hpp +``` + +--- diff --git a/docs/languages/java.md b/docs/languages/java.md index 42b3d35..9c6cf38 100644 --- a/docs/languages/java.md +++ b/docs/languages/java.md @@ -1,16 +1,49 @@ -## Keybinds +### Java Setup for Polydev โ˜•๏ธ + +#### Keybinds ๐ŸŽฎ +You can customize the keybinds for your Java projects in Polydev. + +| Keybind | Action | +|---------------------|-----------------------------------------------------| +| `pb` | Build all Java files in the `src` directory | +| `pr` | Run `Main.java` from the `out` folder in your project | +| `nf` | Create a new Java file in the `src` folder | + +#### Configuration Example: + ```lua -- These are defaults, so no need to copy them require("Polydev").java.setup({ keybinds = { - [""] = "CloseTerminal" -- Closes terminal, esc by default. - ["pb"] = "JavaBuild" -- Building all Java Files in src directory in. - ["pr"] = "JavaRun" -- Runs Main.java in the out folder in your project_root - ["nf"] = "NewJavaFile" -- Creates a new Java file in the current project src folder + ["pb"] = "JavaBuild", -- Build all Java files in the src directory + ["pr"] = "JavaRun", -- Run Main.java in the out folder + ["nf"] = "NewJavaFile" -- Create a new Java file in the src folder } }) ``` -## File Structure + +--- + +#### Java Features โœจ + +* **Java Build and Run**: + Polydev allows you to build all Java files in the `src` directory with the press of a keybind. Once built, you can run the project from the `out` folder, with the `Main.java` file executed automatically. + +* **Project File Management**: + The plugin manages your Java project files efficiently, helping you quickly add new Java files to the `src` directory. It also ensures that your build and run processes are streamlined. + +--- + +#### File Structure ๐Ÿ“‚ +Hereโ€™s the recommended structure for your Java projects using Polydev: + +| Directory/File Path | Description | +|----------------------------|------------------------------------------------------| +| `src/` | Contains the source code files, including `Main.java` | +| `build/` | Contains compiled `.class` files | +| `Main.java` | The main entry point of your Java project | + +#### Example Structure: ```md Projects/ @@ -21,3 +54,5 @@ Projects/ โ””โ”€โ”€ build/ โ””โ”€โ”€ *.class ``` + +--- diff --git a/docs/languages/lua.md b/docs/languages/lua.md index b4520ca..b4b2422 100644 --- a/docs/languages/lua.md +++ b/docs/languages/lua.md @@ -1,22 +1,64 @@ -## Keybinds +### Lua Setup for Polydev ๐Ÿข + +#### Key Notes โš ๏ธ + +* Polydev provides seamless integration with Lua projects, allowing you to easily run and manage Lua code. +* You must include a `.polydev` file in your project root directory for Polydev to recognize the project. Missing this file will lead to errors. +* The file structure should be organized to ensure smooth execution and functionality. + +--- + +#### Keybinds ๐ŸŽฎ + +Below are the default keybinds for Lua projects using Polydev. You can adjust them to suit your personal preferences. + +| Keybind | Action | +|---------------------|-------------------------------------------------| +| `pr` | Run the Lua project | + +##### Configuration Example: + ```lua --- These are the defaults for lua +-- These are the defaults for Lua, adjust as needed require("Polydev").lua.setup({ keybinds = { - [""] = "CloseTerminal", - ["pr"] = "LuaRun", - ["nf"] = "NewLuaFile", + ["pr"] = "LuaRun", -- Run the Lua project } }) ``` -## File Structure +--- + +#### Lua Features โœจ + +* **Run Lua Projects**: + Easily run your Lua project from within your terminal using the `pr` keybind. This automatically runs your `init.lua` or the entry point of your Lua code. + +* **Create New Lua Files**: + With the `nf` keybind, you can quickly create new Lua files in the `src` directory, maintaining an organized project structure. + +--- + +#### File Structure ๐Ÿ“‚ + +Hereโ€™s the suggested directory structure for your Lua projects with Polydev: + +| Directory/File Path | Description | +|----------------------------|-----------------------------------------------------| +| `.polydev` | Project metadata file that Polydev uses for configuration | +| `lua/` | Directory containing the main Lua project files | +| `lua//init.lua` | The main entry point for your Lua project | + +##### Example File Structure: + ```md Projects/ โ””โ”€โ”€ Lua/ โ””โ”€โ”€ Project_Name/ - โ”œโ”€โ”€ .polydev + โ”œโ”€โ”€ .polydev -- Polydev configuration file โ””โ”€โ”€ lua/ โ””โ”€โ”€ Project_name/ - โ””โ”€โ”€ init.lua + โ””โ”€โ”€ init.lua -- Main Lua file ``` + +--- diff --git a/docs/languages/python.md b/docs/languages/python.md index a634913..7fbb7b8 100644 --- a/docs/languages/python.md +++ b/docs/languages/python.md @@ -1,20 +1,54 @@ -## Keybinds +### Python Setup for Polydev ๐Ÿ + +#### Keybinds ๐ŸŽฎ +You can easily customize the keybinds for your Python projects using Polydev. + +| Keybind | Action | +|---------------------|---------------------------------------------------| +| `pr` | Run the Python project in your active terminal | +| `pb` | Install dependencies using pip | + +#### Configuration Example: + ```lua require("Polydev").python.setup({ keybinds = { - [""] = "CloseTerminal", - ["pr"] = "PythonRun", - ["nf"] = "NewPythonFile", - ["pb"] = "PythonPip" + ["pr"] = "PythonRun", -- Run the Python project + ["pb"] = "PythonPip" -- Install dependencies using pip } }) ``` -## Python Features -* A feature that is added to the python language for this plugin is to be able to install dependencies with pip within the terminal. You can even update pip. Just type your dependency you want and boom it is installed or not depending on if python likes you. -* Each project with python creates a new virtual environment and automatically uses it so you dont have to worry, just install modules as you like. +--- + +#### Python Features ๐Ÿš€ + +Here are some cool features available for Python projects using Polydev: + +- **Automatic Virtual Environment Creation** ๐Ÿ”ง +Each Python project automatically sets up and uses a new virtual environment. You donโ€™t need to worry about environment management. Just install your dependencies with `pip` as needed. + +- **Dependency Management with Pip** ๐Ÿ“ฆ +Need to install Python modules? Simply type the name of the module in the terminal, and Polydev will take care of the installation using `pip`. You can even update `pip` if required, ensuring smooth installation. + +- **Effortless Dependency Handling** โšก +You no longer need to manually activate or deactivate virtual environments. With Polydev, the environment is set up and activated automatically, simplifying your workflow. + +--- + +#### File Structure ๐Ÿ“‚ +Hereโ€™s the recommended structure for your Python projects using Polydev: + +| Directory/File Path | Description | +|----------------------------|------------------------------------------------------| +| `requirements.txt` | File for listing project dependencies | +| `setup.py` | Python project setup file | +| `tests/` | Folder containing test files | +| `venv/` | Virtual environment folder | +| `main.py` | Main Python file for your project | + +#### Example Structure: -## File Structure ```md Projects/ โ””โ”€โ”€ Python/ @@ -24,5 +58,6 @@ Projects/ โ”œโ”€โ”€ setup.py โ”œโ”€โ”€ tests/ โ””โ”€โ”€ venv/ - ``` + +---