From b668bdce6670f3e2af523dd99a756c700002c0ea Mon Sep 17 00:00:00 2001 From: YodaForce157 <69751882+YodaForce157@users.noreply.github.com> Date: Tue, 12 Aug 2025 21:56:39 +0100 Subject: [PATCH 1/7] Fix minor theming issues, and add search bar --- .gitignore | 3 ++- .vitepress/config.mts | 4 +++- .vitepress/theme/custom.css | 21 +++++++++++++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 .vitepress/theme/custom.css diff --git a/.gitignore b/.gitignore index fc15858..e19783e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ node_modules .vitepress/cache .vitepress/dist -.idea \ No newline at end of file +.idea +.vscode \ No newline at end of file diff --git a/.vitepress/config.mts b/.vitepress/config.mts index faa2d78..bca6204 100644 --- a/.vitepress/config.mts +++ b/.vitepress/config.mts @@ -24,7 +24,9 @@ export default defineConfig({ {text: 'Tutorials', link: '/tutorials/getting-started'}, {text: 'Plugins', link: '/plugins/'} ], - + search: { + provider: 'local' + }, sidebar: [ { text: 'Tutorials', diff --git a/.vitepress/theme/custom.css b/.vitepress/theme/custom.css new file mode 100644 index 0000000..33492b9 --- /dev/null +++ b/.vitepress/theme/custom.css @@ -0,0 +1,21 @@ +/* Light Mode */ + +:root { + --vp-button-alt-bg: #e3e6ed; /* Make secondary button background not blend in */ +} + +.VPNavBar { + border-bottom: 2px solid #d2d5dc; /* Border for navbar */ + background-color: #e6e9ef; /* Distinguish between nav bar and main page content */ +} + +/* Dark Mode */ + +.dark { + --vp-button-alt-bg: #353552; +} + +.dark .VPNavBar { + border-bottom: 2px solid #353552; + background-color: #26263a; +} \ No newline at end of file From 7c921ddc65de6c2a0bae581abd81be5f35a41262 Mon Sep 17 00:00:00 2001 From: YodaForce157 <69751882+YodaForce157@users.noreply.github.com> Date: Tue, 12 Aug 2025 23:55:51 +0100 Subject: [PATCH 2/7] Create CONTRIBUTING.md and README.md --- CONTRIBUTING.md | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 4 ++++ 2 files changed, 52 insertions(+) create mode 100644 CONTRIBUTING.md create mode 100644 README.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..9139b81 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,48 @@ +# Contributing to RailroadDocs + +By contributing code to the RailroadDocs repository, you: + +- Own all the rights to the code in your pull request + +Guidelines: + +- Every sentence must end in a full stop + +## How to start contributing + +### Use a personal fork, not an Organization + +We may modify your pull request for you, rather than requesting you to make the changes yourself, for efficiency purposes. However, if your fork is hosted on an Organization, we cannot make such changes, so we request that you use a personal fork in your pull requests. + +### Requirements + +To start adding your content to RailroadDocs, you will need the following software: + +- A nodejs version manager +- NPM + +Once you have those installed, install the required dependencies with `npm i`, then you may run the dev server by executing: `npm run dev` in the root of the project. +You will then be given a url to follow to view your locally hosted instance of RailroadDocs. + +### Pull Request Requirements + +We don't want to waste your or our time on pull requests that just can't be justified. Hence these guidelines each and every pull request must adhere to. + +- You must be able to justify the pull request. + + It must fulfill at least one of these requirements: + - Add undocumented feature(s) to the site, to aid developers who may want to learn about such feature(s). + - Fix errors or mistakes in existing files. + - Clarify or rewrite existing documents to provide an easier and clearer experience for any readers. + - Improve the experience of any reader. +- All additions must be written in English, alongside any other language you can provide accurate translations for. +- All modified files must adhere to our Formatting Guide. +- All content must be PG. +- Any and all content, including translations, must be created by a human. +- At the point of review, the pull request must be up to date with the latest version of the base branch. + +### Formatting Guidelines + +We want to make sure that all content added is of a same standard to any other piece, so please keep these guidelines in mind at all times. + +- Headers must be used in ascending order. diff --git a/README.md b/README.md new file mode 100644 index 0000000..a457f92 --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +# Railroad Docs +This is the repository that hosts the source code for the https://railroadide.dev website. + +If you want to contribute, please read our [Contributing Guide](CONTRIBUTING.md). \ No newline at end of file From 74f550a57c71cb5974d284200dc1f4d99676c7fb Mon Sep 17 00:00:00 2001 From: YodaForce157 <69751882+YodaForce157@users.noreply.github.com> Date: Wed, 13 Aug 2025 11:55:44 +0100 Subject: [PATCH 3/7] [ci skip] Add vitepress prettier plugin, and add badges to readme --- .prettierrc.json | 3 +++ CONTRIBUTING.md | 9 +++++---- README.md | 9 +++++++-- 3 files changed, 15 insertions(+), 6 deletions(-) create mode 100644 .prettierrc.json diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..1c326fd --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,3 @@ +{ + "plugins": ["prettier-plugin-vitepress"] +} \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9139b81..41dc232 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,10 +3,7 @@ By contributing code to the RailroadDocs repository, you: - Own all the rights to the code in your pull request - -Guidelines: - -- Every sentence must end in a full stop +- Consent to the publishing of your code publicly ## How to start contributing @@ -46,3 +43,7 @@ We don't want to waste your or our time on pull requests that just can't be just We want to make sure that all content added is of a same standard to any other piece, so please keep these guidelines in mind at all times. - Headers must be used in ascending order. +- All sentences must end in a full stop. +- Any references to class names or methods must be surrounded using "`". +- All code snippets must be in code blocks, which are created using "\`\`\`java --code here --\`\`\`" +- Any API feature page must have an accurate and descriptive example diff --git a/README.md b/README.md index a457f92..c69dea6 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,9 @@ # Railroad Docs -This is the repository that hosts the source code for the https://railroadide.dev website. -If you want to contribute, please read our [Contributing Guide](CONTRIBUTING.md). \ No newline at end of file +![Static Badge](https://img.shields.io/badge/nodejs-24.3.0-brightgreen?logo=nodedotjs&label=NodeJS) +![Static Badge](https://img.shields.io/badge/Vitepress-1.6.3-brightgreen?logo=vitepress&label=Vitepress) + +This is the repository that hosts the source code for the website. + +If you want to contribute, please read our [Contributing Guide](CONTRIBUTING.md). + From 4e5d3cab4aa1a4349703c7e30a3a3147dcaf259b Mon Sep 17 00:00:00 2001 From: YodaForce157 <69751882+YodaForce157@users.noreply.github.com> Date: Wed, 13 Aug 2025 13:38:20 +0100 Subject: [PATCH 4/7] Clean up existing files, and update readme and contributing --- .markdownlint.json | 4 ++++ .prettierrc.json | 13 ++++++++++- CONTRIBUTING.md | 1 + README.md | 1 - src/development/building-and-running.md | 5 +++++ src/plugins/api-reference/events.md | 6 ++--- src/plugins/api-reference/gson-locator.md | 4 +--- src/plugins/api-reference/index.md | 2 +- src/plugins/api-reference/localization.md | 8 +++---- src/plugins/api-reference/logger.md | 2 +- src/plugins/api-reference/plugin.md | 6 ++--- src/plugins/api-reference/registries.md | 4 ++-- src/plugins/api-reference/secure-storage.md | 2 +- src/plugins/api-reference/services.md | 2 +- src/plugins/api-reference/settings.md | 12 +++++----- src/plugins/api-reference/ui/browse-button.md | 10 ++++----- .../ui/forms/form-directory-chooser.md | 2 -- src/plugins/api-reference/ui/rr-card.md | 2 +- .../ui/rr-form-container-section.md | 2 +- src/plugins/api-reference/ui/rr-grid-pane.md | 2 +- src/plugins/api-reference/ui/rr-hbox-vbox.md | 2 +- src/plugins/guide/accessing-services.md | 2 +- src/plugins/guide/building-plugins.md | 12 ++++++---- src/plugins/guide/dependencies.md | 4 ++-- src/plugins/guide/getting-started.md | 4 ++-- src/plugins/guide/plugin-class.md | 2 +- src/plugins/guide/plugin-json.md | 22 +++++++++---------- src/plugins/guide/plugin-structure.md | 2 +- src/plugins/guide/project-setup.md | 4 ++-- src/plugins/guide/working-with-projects.md | 2 +- src/plugins/index.md | 2 +- src/tutorials/index.md | 3 ++- 32 files changed, 85 insertions(+), 66 deletions(-) create mode 100644 .markdownlint.json diff --git a/.markdownlint.json b/.markdownlint.json new file mode 100644 index 0000000..7def1e6 --- /dev/null +++ b/.markdownlint.json @@ -0,0 +1,4 @@ +{ + "MD024": false, + "MD013": false +} \ No newline at end of file diff --git a/.prettierrc.json b/.prettierrc.json index 1c326fd..03d8aed 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -1,3 +1,14 @@ { - "plugins": ["prettier-plugin-vitepress"] + "tabWidth": 2, + "useTabs": false, + "singleQuote": false, + "plugins": ["prettier-plugin-vitepress"], + "overrides": [ + { + "files": [".*md"], + "options": { + "parser": "markdown" + } + } + ] } \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 41dc232..1e86fbd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -41,6 +41,7 @@ We don't want to waste your or our time on pull requests that just can't be just ### Formatting Guidelines We want to make sure that all content added is of a same standard to any other piece, so please keep these guidelines in mind at all times. +We suggest installing the markdownlint plugin, as it comes with a good set of guidelines for formatting markdown files. - Headers must be used in ascending order. - All sentences must end in a full stop. diff --git a/README.md b/README.md index c69dea6..0250b0c 100644 --- a/README.md +++ b/README.md @@ -6,4 +6,3 @@ This is the repository that hosts the source code for the website. If you want to contribute, please read our [Contributing Guide](CONTRIBUTING.md). - diff --git a/src/development/building-and-running.md b/src/development/building-and-running.md index a5baef1..a08f354 100644 --- a/src/development/building-and-running.md +++ b/src/development/building-and-running.md @@ -19,12 +19,14 @@ Before you begin, ensure you have the following installed on your system: - Restart IntelliJ when prompted 2. **Clone the Repository**: + ```bash git clone https://github.com/Railroad-Team/Railroad.git cd Railroad ``` 3. **Update Submodules**: + ```bash git submodule update --init --recursive ``` @@ -49,12 +51,15 @@ Before you begin, ensure you have the following installed on your system: ### Using Gradle Wrapper 1. **Build the project**: + ```bash ./gradlew build ``` + (On Windows, use `gradlew.bat` instead of `./gradlew`) 2. **Run the application**: + ```bash ./gradlew run ``` diff --git a/src/plugins/api-reference/events.md b/src/plugins/api-reference/events.md index c7cfdf1..85d9cc9 100644 --- a/src/plugins/api-reference/events.md +++ b/src/plugins/api-reference/events.md @@ -10,7 +10,7 @@ This is the base interface for all events in the Railroad system. All custom eve The `EventBus` is the central component for the event system. It allows plugins to publish new events and subscribe to existing ones. You can obtain an instance of the `EventBus` from the `PluginContext`. -### Methods: +### Methods - `void publish(Event event)`: Publishes an event to the bus, notifying all subscribed listeners. - `void subscribe(Class eventType, EventListener listener)`: Subscribes a given `EventListener` to events of a specific type. @@ -20,7 +20,7 @@ The `EventBus` is the central component for the event system. It allows plugins This interface is used to define a callback for handling events. When an event of the type `T` (which extends `Event`) is published, the `handle` method of the `EventListener` will be invoked. -### Methods: +### Methods - `void handle(T event)`: This method is called when an event of type `T` is published. @@ -63,4 +63,4 @@ public class ProjectLoggerPlugin implements Plugin { // if the plugin context handles their lifecycle. } } -``` \ No newline at end of file +``` diff --git a/src/plugins/api-reference/gson-locator.md b/src/plugins/api-reference/gson-locator.md index 335c8a8..121cbc1 100644 --- a/src/plugins/api-reference/gson-locator.md +++ b/src/plugins/api-reference/gson-locator.md @@ -6,7 +6,7 @@ The Railroad Plugin API provides a centralized way to access a pre-configured `G The `GsonLocator` is a utility class that provides a singleton instance of `com.google.gson.Gson`. Plugins should use this locator to obtain the `Gson` instance for their JSON operations. -### Key Methods: +### Key Methods - `static Gson getInstance()`: Retrieves the singleton `Gson` instance. Throws `IllegalStateException` if the `Gson` instance has not been set (which is typically handled by the core application during startup). @@ -50,5 +50,3 @@ public class MyGsonPlugin implements Plugin { } } ``` - -``` \ No newline at end of file diff --git a/src/plugins/api-reference/index.md b/src/plugins/api-reference/index.md index 3d8ea03..cfe4267 100644 --- a/src/plugins/api-reference/index.md +++ b/src/plugins/api-reference/index.md @@ -2,7 +2,7 @@ This section provides a detailed reference for the Railroad Plugin API, covering core components, event handling, services, registries, settings, localization, secure storage, Gson utilities, JSON serialization, and UI components. -## Topics: +## Topics - [Plugin Lifecycle and Context](./plugin.md) - [Events](./events.md) diff --git a/src/plugins/api-reference/localization.md b/src/plugins/api-reference/localization.md index 1a052f3..e8a78f8 100644 --- a/src/plugins/api-reference/localization.md +++ b/src/plugins/api-reference/localization.md @@ -6,7 +6,7 @@ The Railroad Plugin API provides a localization system to help plugins support m The `LocalizationService` interface provides methods for retrieving localized strings based on a key and optional arguments. This allows your plugin to display messages, UI elements, and other text in the user's preferred language. -### Key Methods: +### Key Methods - `String get(String key)`: Retrieves the localized string for the given key. - `String get(String key, Object... args)`: Retrieves the localized string for the given key, replacing placeholders with the provided arguments. @@ -51,7 +51,7 @@ Translations are stored in `.lang` files, which are simple key-value pair files. For example, an English (US) language file would be named `en_us.lang`. -### Format: +### Format Each line in a `.lang` file represents a key-value pair, where the key is used to retrieve the localized string, and the value is the translated text. Comments can be added using `#`. @@ -65,10 +65,10 @@ settings.myplugin.enable_feature.title=Enable My Feature settings.myplugin.enable_feature.description=Toggles the main feature of my plugin. ``` -### Placeholders: +### Placeholders Placeholders in the translated strings are denoted by `%s`, `%d`, etc., similar to `String.format()` in Java, corresponding to the order of arguments passed to the `localizationService.get()` method. For instance, in `Hello, %s!`, `%s` will be replaced by the first string argument provided. -By organizing your translations in these `.lang` files, the `LocalizationService` can automatically load the appropriate language based on the application's current locale, providing a seamless localized experience for your users. \ No newline at end of file +By organizing your translations in these `.lang` files, the `LocalizationService` can automatically load the appropriate language based on the application's current locale, providing a seamless localized experience for your users. diff --git a/src/plugins/api-reference/logger.md b/src/plugins/api-reference/logger.md index eb70e31..5386f6f 100644 --- a/src/plugins/api-reference/logger.md +++ b/src/plugins/api-reference/logger.md @@ -139,4 +139,4 @@ if (currentLevel.ordinal() <= LoggingLevel.WARN.ordinal()) { - **Log Archiving**: Existing log files are archived (copied and potentially compressed) before new logging sessions begin. - **Log Deletion**: Old log files are periodically deleted based on the `deletionFrequency` configured for each logger. -These operations are managed internally and do not require direct interaction from plugins. \ No newline at end of file +These operations are managed internally and do not require direct interaction from plugins. diff --git a/src/plugins/api-reference/plugin.md b/src/plugins/api-reference/plugin.md index 6ad3d18..bdfa46f 100644 --- a/src/plugins/api-reference/plugin.md +++ b/src/plugins/api-reference/plugin.md @@ -6,7 +6,7 @@ These are the core components for creating a plugin in Railroad. This is the main interface that your plugin class must implement. It defines the lifecycle methods that the Railroad application will call when your plugin is loaded and unloaded. -### Methods: +### Methods - `void onEnable(PluginContext context)`: Called when your plugin is enabled. This is the primary entry point for your plugin's logic. You receive a `PluginContext` object which provides access to various application services and functionalities. - `void onDisable(PluginContext context)`: Called when your plugin is disabled. Use this method to clean up any resources, unregister listeners, or save state before your plugin is unloaded. @@ -15,7 +15,7 @@ This is the main interface that your plugin class must implement. It defines the The `PluginContext` interface provides your plugin with access to the Railroad application's core services, event bus, logger, and other essential functionalities. An instance of `PluginContext` is passed to your plugin's `onEnable` and `onDisable` methods. -### Key Methods: +### Key Methods - `PluginDescriptor getDescriptor()`: Returns the descriptor of the plugin, containing metadata like name, version, and description. - `EventBus getEventBus()`: Provides access to the application's event bus, allowing your plugin to publish and subscribe to events. @@ -31,5 +31,3 @@ The `PluginContext` interface provides your plugin with access to the Railroad a ## `PluginDescriptor` This interface describes your plugin and contains metadata such as its name, version, and description. This information is typically loaded from a plugin configuration file (e.g., `plugin.json`). - - diff --git a/src/plugins/api-reference/registries.md b/src/plugins/api-reference/registries.md index 0770b5a..adeec71 100644 --- a/src/plugins/api-reference/registries.md +++ b/src/plugins/api-reference/registries.md @@ -66,7 +66,7 @@ public class MySettingPlugin implements Plugin { The `dev.railroadide.core.registry.Registry` interface defines the common operations for managing collections of items. Any registry you obtain from the `PluginContext` or `Registries` utility class will implement this interface. -### Key Methods: +### Key Methods - `String getId()`: Returns the unique identifier of the registry. - `Type getType()`: Returns the generic type of items managed by the registry. @@ -132,4 +132,4 @@ public class MyGenericRegistryPlugin implements Plugin { // Clean up } } -``` \ No newline at end of file +``` diff --git a/src/plugins/api-reference/secure-storage.md b/src/plugins/api-reference/secure-storage.md index c22c1b1..a75aa3a 100644 --- a/src/plugins/api-reference/secure-storage.md +++ b/src/plugins/api-reference/secure-storage.md @@ -6,7 +6,7 @@ The Railroad Plugin API provides a `SecureTokenStore` for securely storing sensi The `SecureTokenStore` class allows you to save, retrieve, and clear tokens securely. It typically uses platform-specific mechanisms (e.g., OS keychain, encrypted files) to protect the data. -### Key Methods: +### Key Methods - `SecureTokenStore(String serviceName)`: Constructor. `serviceName` is a unique identifier for your plugin's storage area. - `void saveToken(String token, String key)`: Saves a token associated with a given key. diff --git a/src/plugins/api-reference/services.md b/src/plugins/api-reference/services.md index 9760bdc..682a052 100644 --- a/src/plugins/api-reference/services.md +++ b/src/plugins/api-reference/services.md @@ -98,4 +98,4 @@ public class MyVCSPlugin implements Plugin { // Clean up resources if necessary } } -``` \ No newline at end of file +``` diff --git a/src/plugins/api-reference/settings.md b/src/plugins/api-reference/settings.md index 32ede1b..c53f715 100644 --- a/src/plugins/api-reference/settings.md +++ b/src/plugins/api-reference/settings.md @@ -6,7 +6,7 @@ The Railroad Plugin API provides a robust system for defining, managing, and per The `Setting` class is the core component of the settings API. Each `Setting` represents a single configurable value within the application. Settings are typically registered with the settings registry and can be accessed and modified by plugins. -### Key Properties: +### Key Properties - `id` (String): A unique identifier for the setting (e.g., `myplugin:my_setting_id`). - `treePath` (String): Defines the hierarchical path for the setting, used for organizing settings in the UI (e.g., `plugins.myplugin.general`). @@ -17,7 +17,7 @@ The `Setting` class is the core component of the settings API. Each `Setting` re - `description` (String): A descriptive text providing more information about the setting. - `codec` (SettingCodec<T, ?>): Defines how the setting's value is serialized/deserialized and how it interacts with UI components. -### Building a Setting: +### Building a Setting You create `Setting` instances using its fluent `builder` API: @@ -51,7 +51,7 @@ Setting customMessageSetting = Setting.builder(String.class, "myplugin:c `SettingCategory` is used to group related settings together, primarily for organizing them within the application's user interface. Each category has an `id`, `title`, and `description`. -### Building a SettingCategory: +### Building a SettingCategory ```java import dev.railroadide.core.settings.SettingCategory; @@ -70,7 +70,7 @@ SettingCategory advancedCategory = SettingCategory.builder("myplugin:advanced") A `SettingCodec` defines how a setting's value is converted between its Java object representation, its JSON representation (for persistence), and its UI component representation (e.g., a `TextField` for a `String`). -### Key Components: +### Key Components - `nodeToValue`: Function to extract the value from a UI Node. - `valueToNode`: Function to set the value in a UI Node. @@ -84,7 +84,7 @@ Plugins can create custom codecs for complex data types or custom UI components. Railroad provides a set of predefined `SettingCodec` instances for common data types, making it easy to create settings for basic types without defining custom codecs. These are available through `DefaultSettingCodecs`. -### Available Default Codecs: +### Available Default Codecs - `BOOLEAN` (for `Boolean` values, uses `CheckBox`) - `STRING` (for `String` values, uses `TextField`) @@ -93,7 +93,7 @@ Railroad provides a set of predefined `SettingCodec` instances for common data t - `FLOAT` (for `Float` values, uses `TextField`) - `LONG` (for `Long` values, uses `TextField`) -### Example Usage: +### Example Usage ```java import dev.railroadide.core.settings.DefaultSettingCodecs; diff --git a/src/plugins/api-reference/ui/browse-button.md b/src/plugins/api-reference/ui/browse-button.md index c2942e5..fc08682 100644 --- a/src/plugins/api-reference/ui/browse-button.md +++ b/src/plugins/api-reference/ui/browse-button.md @@ -19,12 +19,12 @@ ## Enums - `BrowseType`: Defines the type of browsing operation: - - `FILE`: For selecting files. - - `DIRECTORY`: For selecting directories. - - `IMAGE`: For selecting image files (with predefined filters). + - `FILE`: For selecting files. + - `DIRECTORY`: For selecting directories. + - `IMAGE`: For selecting image files (with predefined filters). - `BrowseSelectionMode`: Defines the selection mode: - - `SINGLE`: Allows selecting only one item. - - `MULTIPLE`: Allows selecting multiple items. + - `SINGLE`: Allows selecting only one item. + - `MULTIPLE`: Allows selecting multiple items. ## Usage Example diff --git a/src/plugins/api-reference/ui/forms/form-directory-chooser.md b/src/plugins/api-reference/ui/forms/form-directory-chooser.md index 020d7ea..bcb55ac 100644 --- a/src/plugins/api-reference/ui/forms/form-directory-chooser.md +++ b/src/plugins/api-reference/ui/forms/form-directory-chooser.md @@ -35,5 +35,3 @@ Constructs a new `TextFieldWithButton`. - `textField`: The text field for displaying the selected directory path. - `browseButton`: The browse button for opening the directory chooser, or `null` if not needed. - -``` \ No newline at end of file diff --git a/src/plugins/api-reference/ui/rr-card.md b/src/plugins/api-reference/ui/rr-card.md index 34d9a82..fb3cfbd 100644 --- a/src/plugins/api-reference/ui/rr-card.md +++ b/src/plugins/api-reference/ui/rr-card.md @@ -50,4 +50,4 @@ card.setInteractive(true); card.setOnMouseClicked(event -> { System.out.println("Card clicked!"); }); -``` \ No newline at end of file +``` diff --git a/src/plugins/api-reference/ui/rr-form-container-section.md b/src/plugins/api-reference/ui/rr-form-container-section.md index 6c764b9..ec35f1e 100644 --- a/src/plugins/api-reference/ui/rr-form-container-section.md +++ b/src/plugins/api-reference/ui/rr-form-container-section.md @@ -75,4 +75,4 @@ advancedSection.addContent( new RRButton("myplugin.button.apply") ); formContainer.addSection(advancedSection); -``` \ No newline at end of file +``` diff --git a/src/plugins/api-reference/ui/rr-grid-pane.md b/src/plugins/api-reference/ui/rr-grid-pane.md index b2ef2b3..11ab8b9 100644 --- a/src/plugins/api-reference/ui/rr-grid-pane.md +++ b/src/plugins/api-reference/ui/rr-grid-pane.md @@ -25,4 +25,4 @@ gridPane.setPadding(new Insets(10)); gridPane.add(new RRTextField("myplugin.textfield.placeholder.firstname"), 0, 0); // (column, row) gridPane.add(new RRTextField("myplugin.textfield.placeholder.lastname"), 1, 0); gridPane.add(new RRButton("myplugin.button.save"), 0, 1, 2, 1); // (column, row, columnspan, rowspan) -``` \ No newline at end of file +``` diff --git a/src/plugins/api-reference/ui/rr-hbox-vbox.md b/src/plugins/api-reference/ui/rr-hbox-vbox.md index 0f25a08..2b5474c 100644 --- a/src/plugins/api-reference/ui/rr-hbox-vbox.md +++ b/src/plugins/api-reference/ui/rr-hbox-vbox.md @@ -29,4 +29,4 @@ hbox.getChildren().addAll(new RRButton("myplugin.button.one"), new RRButton("myp RRVBox vbox = new RRVBox(5); // 5 pixels spacing vbox.setPadding(new Insets(5)); vbox.getChildren().addAll(new RRTextField("myplugin.textfield.placeholder.submit"), new RRButton("myplugin.button.submit")); -``` \ No newline at end of file +``` diff --git a/src/plugins/guide/accessing-services.md b/src/plugins/guide/accessing-services.md index 1808af1..0b44021 100644 --- a/src/plugins/guide/accessing-services.md +++ b/src/plugins/guide/accessing-services.md @@ -2,7 +2,7 @@ The `PluginContext` provides access to various services that your plugin can use to interact with the Railroad application. You can retrieve a service by calling the `getService()` method on the `PluginContext`. -### Example +## Example Here is an example of how to access the `ApplicationInfoService` to get the application version: diff --git a/src/plugins/guide/building-plugins.md b/src/plugins/guide/building-plugins.md index 9638eb1..8824979 100644 --- a/src/plugins/guide/building-plugins.md +++ b/src/plugins/guide/building-plugins.md @@ -5,6 +5,7 @@ This guide covers the process of building, testing, and distributing your Railro ## Prerequisites Before building your plugin, ensure you have: + - JDK 17 or later installed - Gradle 7.6+ installed or use the Gradle wrapper - Your plugin code is complete and tested locally @@ -17,11 +18,13 @@ Before building your plugin, ensure you have: 2. Run the build command for your operating system: **Windows:** + ```powershell .\gradlew build ``` **macOS/Linux:** + ```bash ./gradlew build ``` @@ -29,6 +32,7 @@ Before building your plugin, ensure you have: ### Build Outputs Successful builds will generate the following in the `build/libs/` directory: + - `your-plugin-1.0.0.jar` - Your compiled plugin - `your-plugin-1.0.0-sources.jar` - Source JAR (if configured) - `your-plugin-1.0.0-javadoc.jar` - Javadoc JAR (if configured) @@ -66,9 +70,9 @@ The plugins directory is located in your Railroad application's data folder. The **Steps to Install:** -1. Locate the JAR file you built (e.g., `my-railroad-plugin-1.0.0.jar`) in your project's `build/libs/` directory. -2. Copy this JAR file. -3. Navigate to the Railroad plugins directory on your system. -4. Paste the copied JAR file into the `plugins` directory. +1. Locate the JAR file you built (e.g., `my-railroad-plugin-1.0.0.jar`) in your project's `build/libs/` directory. +2. Copy this JAR file. +3. Navigate to the Railroad plugins directory on your system. +4. Paste the copied JAR file into the `plugins` directory. Once the JAR file is in the correct location, restart your Railroad application (if it was running) to load the new plugin. Your plugin should now be active and its features available within Railroad. diff --git a/src/plugins/guide/dependencies.md b/src/plugins/guide/dependencies.md index 87013f0..2708c74 100644 --- a/src/plugins/guide/dependencies.md +++ b/src/plugins/guide/dependencies.md @@ -37,12 +37,12 @@ Here is an example of the `dependencies` object within a `plugin.json` file, dem } ``` -### Repository Object Fields (within `dependencies.repositories`): +### Repository Object Fields (within `dependencies.repositories`) - `id` (string): A unique identifier for the repository. - `url` (string): The URL of the Maven repository. -### Artifact Object Fields (within `dependencies.artifacts`): +### Artifact Object Fields (within `dependencies.artifacts`) - `groupId` (string): The group ID of the Maven artifact. - `artifactId` (string): The artifact ID of the Maven artifact. diff --git a/src/plugins/guide/getting-started.md b/src/plugins/guide/getting-started.md index 02cf333..f905868 100644 --- a/src/plugins/guide/getting-started.md +++ b/src/plugins/guide/getting-started.md @@ -4,9 +4,9 @@ Plugins are a great way to extend the functionality of Railroad. They can be use This guide will walk you through the process of creating your first Railroad plugin, from setting up your project to understanding its core components. -## Topics: +## Topics - [Project Setup](./project-setup.md): Learn how to set up your Gradle project for Railroad plugin development. - [Creating Your Plugin Class](./plugin-class.md): Understand the basic structure of a Railroad plugin and its lifecycle methods. - [Accessing Services](./accessing-services.md): Discover how to interact with Railroad's core functionalities through various services. -- [`plugin.json` Configuration](./plugin-json.md): Learn about the essential `plugin.json` file, its location, and required fields. \ No newline at end of file +- [`plugin.json` Configuration](./plugin-json.md): Learn about the essential `plugin.json` file, its location, and required fields. diff --git a/src/plugins/guide/plugin-class.md b/src/plugins/guide/plugin-class.md index 90d0f90..f070b8a 100644 --- a/src/plugins/guide/plugin-class.md +++ b/src/plugins/guide/plugin-class.md @@ -2,7 +2,7 @@ Once your project is set up, you can create your main plugin class that implements the `dev.railroadide.railroadpluginapi.Plugin` interface. This class will contain the logic for your plugin. -### Example +## Example Here is an example of a simple plugin that logs a message to the console when it is enabled: diff --git a/src/plugins/guide/plugin-json.md b/src/plugins/guide/plugin-json.md index 0e01a53..ad28f7c 100644 --- a/src/plugins/guide/plugin-json.md +++ b/src/plugins/guide/plugin-json.md @@ -2,21 +2,21 @@ The `plugin.json` file is a crucial part of your Railroad plugin, providing essential metadata about your plugin to the Railroad application. It must be located at `src/main/resources/META-INF/plugin.json` within your plugin project. -### Fields: +## Fields - **Required Fields:** - - `id` (string): A unique identifier for your plugin (e.g., `com.example.myplugin`). - - `name` (string): The human-readable name of your plugin (e.g., `My Awesome Plugin`). - - `version` (string): The version of your plugin (e.g., `1.0.0`). - - `mainClass` (string): The fully qualified name of your main plugin class that implements `dev.railroadide.railroadpluginapi.Plugin` (e.g., `com.example.MyPlugin`). + - `id` (string): A unique identifier for your plugin (e.g., `com.example.myplugin`). + - `name` (string): The human-readable name of your plugin (e.g., `My Awesome Plugin`). + - `version` (string): The version of your plugin (e.g., `1.0.0`). + - `mainClass` (string): The fully qualified name of your main plugin class that implements `dev.railroadide.railroadpluginapi.Plugin` (e.g., `com.example.MyPlugin`). - **Optional Fields:** - - `author` (string): The author(s) of the plugin. - - `description` (string): A brief description of what your plugin does. - - `website` (string): A URL to your plugin's website or repository. - - `license` (string): The license under which your plugin is distributed (e.g., `MIT`, `Apache 2.0`). - - `icon` (string): A path to an icon for your plugin (e.g., `assets/icon.png`). - - `dependencies` (object): An object defining external library dependencies and repositories. For details on the structure of this object, see [Managing Dependencies](./dependencies.md). + - `author` (string): The author(s) of the plugin. + - `description` (string): A brief description of what your plugin does. + - `website` (string): A URL to your plugin's website or repository. + - `license` (string): The license under which your plugin is distributed (e.g., `MIT`, `Apache 2.0`). + - `icon` (string): A path to an icon for your plugin (e.g., `assets/icon.png`). + - `dependencies` (object): An object defining external library dependencies and repositories. For details on the structure of this object, see [Managing Dependencies](./dependencies.md). ### Example `plugin.json` diff --git a/src/plugins/guide/plugin-structure.md b/src/plugins/guide/plugin-structure.md index 17bc62c..1da39d1 100644 --- a/src/plugins/guide/plugin-structure.md +++ b/src/plugins/guide/plugin-structure.md @@ -55,4 +55,4 @@ public class MyPlugin implements Plugin { context.getLogger().info("MyPlugin is disabling. Remember to clean up resources!"); } } -``` \ No newline at end of file +``` diff --git a/src/plugins/guide/project-setup.md b/src/plugins/guide/project-setup.md index 9c2a449..87e77b4 100644 --- a/src/plugins/guide/project-setup.md +++ b/src/plugins/guide/project-setup.md @@ -2,11 +2,11 @@ To create a Railroad plugin, you'll typically set up a new Gradle project. This allows you to manage dependencies, compile your code, and package your plugin into a JAR file. -### Project Structure +## Project Structure A typical Gradle project for a Railroad plugin will have the following structure: -``` +```txt my-railroad-plugin/ ├── src/ │ ├── main/ diff --git a/src/plugins/guide/working-with-projects.md b/src/plugins/guide/working-with-projects.md index 10d538e..663474e 100644 --- a/src/plugins/guide/working-with-projects.md +++ b/src/plugins/guide/working-with-projects.md @@ -128,4 +128,4 @@ public class FileEventListenerPlugin implements Plugin { context.getEventBus().unsubscribe(FileEvent.class, fileEventListener); } } -``` \ No newline at end of file +``` diff --git a/src/plugins/index.md b/src/plugins/index.md index f0fe15b..a7eb612 100644 --- a/src/plugins/index.md +++ b/src/plugins/index.md @@ -37,4 +37,4 @@ The Railroad Plugin API offers a rich set of features to facilitate robust plugi ## API Reference -For detailed information on all available classes, methods, and interfaces, please refer to the comprehensive [API Reference](./api-reference/index.md). \ No newline at end of file +For detailed information on all available classes, methods, and interfaces, please refer to the comprehensive [API Reference](./api-reference/index.md). diff --git a/src/tutorials/index.md b/src/tutorials/index.md index 18a83b5..b2a6d69 100644 --- a/src/tutorials/index.md +++ b/src/tutorials/index.md @@ -1,2 +1,3 @@ # Overview -An overview of Railroad IDE and its features. \ No newline at end of file + +An overview of Railroad IDE and its features. From d891a810dfaf7b398d1d61c0a1f46ac2f7e46fea Mon Sep 17 00:00:00 2001 From: YodaForce157 <69751882+YodaForce157@users.noreply.github.com> Date: Wed, 13 Aug 2025 13:55:12 +0100 Subject: [PATCH 5/7] Add support 'feature' to getting started page --- src/tutorials/getting-started.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/tutorials/getting-started.md b/src/tutorials/getting-started.md index 14f6424..a9fc557 100644 --- a/src/tutorials/getting-started.md +++ b/src/tutorials/getting-started.md @@ -20,5 +20,8 @@ features: linkText: Documentation - title: Contributing - title: Support - + icon: 📞 + details: Join the Discord to get support with for Railroad. + link: https://discord.turtywurty.dev/ + linkText: Join the Discord --- \ No newline at end of file From e0a48258e7240492f5ca0059f463b3ac1cb15ade Mon Sep 17 00:00:00 2001 From: YodaForce157 <69751882+YodaForce157@users.noreply.github.com> Date: Wed, 13 Aug 2025 14:09:14 +0100 Subject: [PATCH 6/7] [ci skip] Add theme info to readme --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0250b0c..e247484 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,10 @@ ![Static Badge](https://img.shields.io/badge/nodejs-24.3.0-brightgreen?logo=nodedotjs&label=NodeJS) ![Static Badge](https://img.shields.io/badge/Vitepress-1.6.3-brightgreen?logo=vitepress&label=Vitepress) -This is the repository that hosts the source code for the website. +This is the repository that hosts the source code for the website. + +## Theming + +The website uses the [Catppuccin Mocha Sapphire](https://github.com/catppuccin/vitepress) theme, with some additional custom css. If you want to contribute, please read our [Contributing Guide](CONTRIBUTING.md). From e44e90fdd259313c0911f45b741aea3c6b926c07 Mon Sep 17 00:00:00 2001 From: YodaForce157 <69751882+YodaForce157@users.noreply.github.com> Date: Wed, 13 Aug 2025 15:58:39 +0100 Subject: [PATCH 7/7] Remove extra 'with' --- src/tutorials/getting-started.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tutorials/getting-started.md b/src/tutorials/getting-started.md index a9fc557..6336498 100644 --- a/src/tutorials/getting-started.md +++ b/src/tutorials/getting-started.md @@ -21,7 +21,7 @@ features: - title: Contributing - title: Support icon: 📞 - details: Join the Discord to get support with for Railroad. + details: Join the Discord to get support for Railroad. link: https://discord.turtywurty.dev/ linkText: Join the Discord --- \ No newline at end of file