diff --git a/.editorconfig b/.editorconfig
index 263d65f2..702598e1 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -7,4 +7,9 @@ charset = utf-8
[*.json]
indent_style = space
indent_size = 2
+trim_trailing_whitespace = true
+
+[*.md]
+indent_style = space
+indent_size = 4
trim_trailing_whitespace = true
\ No newline at end of file
diff --git a/README.md b/README.md
index de72a54c..79ee70c4 100644
--- a/README.md
+++ b/README.md
@@ -1,14 +1,14 @@
-

+
@@ -45,9 +45,9 @@ To install the server, either:
To install the plugin, either:
* Install the plugin from the [Roblox plugin page](https://www.roblox.com/library/1211549683/Rojo).
- * This gives you less control over what version you install -- you will always have the latest version.
+ * This gives you less control over what version you install -- you will always have the latest version.
* Or, download the latest release from [the GitHub releases section](https://github.com/LPGhatguy/rojo/releases) and install it into your Roblox plugins folder
- * You can open this folder by clicking the "Plugins Folder" button from the Plugins toolbar in Roblox Studio
+ * You can open this folder by clicking the "Plugins Folder" button from the Plugins toolbar in Roblox Studio
## Server Usage
For more help, use `rojo help`.
@@ -68,9 +68,9 @@ The default project file is:
```json
{
- "name": "my-new-project",
- "servePort": 8000,
- "partitions": {}
+ "name": "my-new-project",
+ "servePort": 8000,
+ "partitions": {}
}
```
@@ -97,14 +97,14 @@ For example, if you want to map your `src` directory to an object named `My Cool
```json
{
- "name": "rojo",
- "servePort": 8000,
- "partitions": {
- "game": {
- "path": "src",
- "target": "ReplicatedStorage.My Cool Game"
+ "name": "rojo",
+ "servePort": 8000,
+ "partitions": {
+ "game": {
+ "path": "src",
+ "target": "ReplicatedStorage.My Cool Game"
+ }
}
- }
}
```
@@ -140,13 +140,13 @@ Any directory containing one of these files will instead be a `ModuleScript`, `S
For example, this file tree:
* my-game
- * init.client.lua
- * foo.lua
+ * init.client.lua
+ * foo.lua
Will turn into these instances in Roblox:
* `my-game` (`LocalScript` with source from `my-game/init.client.lua`)
- * `foo` (`ModuleScript` with source from `my-game/foo.lua`)
+ * `foo` (`ModuleScript` with source from `my-game/foo.lua`)
`*.model.json` files are a way to represent simple Roblox instances on the filesystem until `rbxmx` and `rbxlx` support is implemented in Rojo.
@@ -156,28 +156,28 @@ JSON Model files are strict, with every property being required. They look like
```json
{
- "Name": "hello",
- "ClassName": "Model",
- "Children": [
- {
- "Name": "Some Part",
- "ClassName": "Part",
- "Children": [],
- "Properties": {}
- },
- {
- "Name": "Some StringValue",
- "ClassName": "StringValue",
- "Children": [],
- "Properties": {
- "Value": {
- "Type": "String",
- "Value": "Hello, world!"
+ "Name": "hello",
+ "ClassName": "Model",
+ "Children": [
+ {
+ "Name": "Some Part",
+ "ClassName": "Part",
+ "Children": [],
+ "Properties": {}
+ },
+ {
+ "Name": "Some StringValue",
+ "ClassName": "StringValue",
+ "Children": [],
+ "Properties": {
+ "Value": {
+ "Type": "String",
+ "Value": "Hello, world!"
+ }
+ }
}
- }
- }
- ],
- "Properties": {}
+ ],
+ "Properties": {}
}
```
diff --git a/docs/getting-started/creating-a-project.md b/docs/getting-started/creating-a-project.md
new file mode 100644
index 00000000..49dad7fc
--- /dev/null
+++ b/docs/getting-started/creating-a-project.md
@@ -0,0 +1,77 @@
+# Creating a Project
+To use Rojo, you'll need to create a new project file, which tells Rojo what your project is, and how to load it into Roblox Studio.
+
+## New Project
+Create a new folder, then run `rojo init` inside that folder to initialize an empty project.
+
+```sh
+mkdir my-new-project
+cd my-new-project
+
+rojo init
+```
+
+Rojo will create an empty project file named `rojo.json` in the directory.
+
+The default configuration doesn't do anything. We need to tell Rojo where our code is on the filesystem, and where we want to put it in the Roblox tree.
+
+To do that, open up `rojo.json` and add an entry to the `partitions` table:
+
+```json
+{
+ "name": "your-project-name-here",
+ "servePort": 8000,
+ "partitions": {
+ "src": {
+ "path": "src",
+ "target": "ReplicatedStorage.Project"
+ }
+ }
+}
+```
+
+!!! warning
+ Make sure that the `src` directory exists in your project, or Rojo will throw an error!
+
+!!! warning
+ Any objects contained in the `target` of a partition will be destroyed by Rojo if not found on the filesystem!
+
+A Rojo project has one or more *partitions*. Partitions define how code should be transferred between the filesystem and Roblox by mapping directories and files to Roblox objects.
+
+Each partition has:
+
+* A name (the key in the `partitions` object), which is used for debugging
+* `path`, the location on the filesystem relative to `rojo.json`
+* `target`, the location in Roblox relative to `game`
+
+## Syncing into Studio
+
+Once you've added your partition to the project file, you can start the Rojo dev server by running a command in your project's directory:
+
+```sh
+rojo serve
+```
+
+If your project is in the right place, Rojo will let you know that it was found and start an HTTP server that the plugin can connect to.
+
+In Roblox Studio, open the plugins tab and find Rojo's buttons.
+
+
+{: align="center" }
+
+Press **Test Connection** to verify that the plugin can communicate with the dev server. Watch the Output panel for the results.
+
+!!! info
+ If you see an error message, return to the previous steps and make sure that the Rojo dev server is running.
+
+ 
+ {: align="center" }
+
+After your connection was successful, press **Sync In** to move code from the filesystem into Studio, or use **Toggle Polling** to have Rojo automatically sync in changes as they happen.
+
+## Importing an Existing Project
+Rojo will eventually support importing an existing Roblox project onto the filesystem for use with Rojo.
+
+Rojo doesn't currently support converting an existing project or syncing files from Roblox Studio onto the filesystem. In the mean time, you can manually copy your files into the structure that Rojo expects.
+
+Up-to-date information will be available on [issue #5](https://github.com/LPGhatguy/rojo/issues/5) as this is worked on.
\ No newline at end of file
diff --git a/docs/getting-started/installation.md b/docs/getting-started/installation.md
new file mode 100644
index 00000000..2c3c986d
--- /dev/null
+++ b/docs/getting-started/installation.md
@@ -0,0 +1,23 @@
+# Installation
+Rojo has two components:
+
+* The server, a binary written in Rust
+* The plugin, a Roblox Studio plugin written in Lua
+
+It's important that the plugin and server are compatible. The plugin will show errors in the Roblox Studio Output window if there is a version mismatch.
+
+## Installing the Server
+To install the server, either:
+
+* If you have Rust installed, use `cargo install rojo`
+* Or, download a pre-built Windows binary from [the GitHub releases page](https://github.com/LPGhatguy/rojo/releases)
+
+**The Rojo binary must be run from the command line, like Terminal on MacOS or `cmd.exe` on Windows. It's recommended that you put the Rojo binary on your `PATH` to make this easier.**
+
+## Installing the Plugin
+To install the plugin, either:
+
+* Install the plugin from the [Roblox plugin page](https://www.roblox.com/library/1211549683/Rojo).
+ * This gives you less control over what version you install -- you will always have the latest version.
+* Or, download the latest release from [the GitHub releases section](https://github.com/LPGhatguy/rojo/releases) and install it into your Roblox plugins folder
+ * You can open this folder by clicking the "Plugins Folder" button from the Plugins toolbar in Roblox Studio
\ No newline at end of file
diff --git a/docs/images/connection-error.png b/docs/images/connection-error.png
new file mode 100644
index 00000000..af3c16fa
Binary files /dev/null and b/docs/images/connection-error.png differ
diff --git a/docs/images/plugin-buttons.png b/docs/images/plugin-buttons.png
new file mode 100644
index 00000000..58739930
Binary files /dev/null and b/docs/images/plugin-buttons.png differ
diff --git a/docs/images/sync-example.png b/docs/images/sync-example.png
new file mode 100644
index 00000000..ab56863b
Binary files /dev/null and b/docs/images/sync-example.png differ
diff --git a/docs/sync-details.md b/docs/sync-details.md
new file mode 100644
index 00000000..40dfb285
--- /dev/null
+++ b/docs/sync-details.md
@@ -0,0 +1,61 @@
+# Sync Details
+This page aims to describe how Rojo turns files on the filesystem into Roblox objects.
+
+## Folders
+Any directory on the filesystem will turn into a `Folder` instance in Roblox, unless that folder matches the name of a service or other existing instance. In those cases, that instance will be preserved.
+
+## Scripts
+Rojo can represent `ModuleScript`, `Script`, and `LocalScript` objects. The default script type is `ModuleScript`, since most scripts in well-structued Roblox projects will be modules.
+
+| File Name | Instance Type |
+| -------------- | -------------- |
+| `*.server.lua` | `Script` |
+| `*.client.lua` | `LocalScript` |
+| `*.lua` | `ModuleScript` |
+
+If a directory contains a file named `init.server.lua`, `init.client.lua`, or `init.lua`, that folder will be transformed into a `*Script` instance with the conents of the `init` file. This can be used to create scripts inside of scripts.
+
+For example, this file tree:
+
+* my-game
+ * init.client.lua
+ * foo.lua
+
+Will turn into these instances in Roblox:
+
+
+
+## Models
+Rojo supports a JSON model format for representing simple models. It's designed for instance types like `BindableEvent` or `*Value` objects, and is not suitable for larger models.
+
+!!! info
+ In the future, Rojo will support `.rbxmx` models. See [issue #7](https://github.com/LPGhatguy/rojo/issues/7) for more details and updates on this feature.
+
+JSON model files are strict, with every property being required. They look like this:
+
+```json
+{
+ "Name": "hello",
+ "ClassName": "Model",
+ "Children": [
+ {
+ "Name": "Some Part",
+ "ClassName": "Part",
+ "Children": [],
+ "Properties": {}
+ },
+ {
+ "Name": "Some StringValue",
+ "ClassName": "StringValue",
+ "Children": [],
+ "Properties": {
+ "Value": {
+ "Type": "String",
+ "Value": "Hello, world!"
+ }
+ }
+ }
+ ],
+ "Properties": {}
+}
+```
\ No newline at end of file
diff --git a/docs/why-rojo.md b/docs/why-rojo.md
new file mode 100644
index 00000000..b6872309
--- /dev/null
+++ b/docs/why-rojo.md
@@ -0,0 +1,21 @@
+# Why Rojo?
+There are a number of existing plugins for Roblox that move code from the filesystem into Roblox.
+
+Besides Rojo, there is:
+
+* [Studio Bridge](https://github.com/vocksel/studio-bridge) by [Vocksel](https://github.com/vocksel)
+* [RbxRefresh](https://github.com/osyrisrblx/RbxRefresh) by [Osyris](https://github.com/osyrisrblx)
+* [RbxSync](https://github.com/evaera/RbxSync) by [evaera](https://github.com/evaera)
+* [CodeSync](https://github.com/MemoryPenguin/CodeSync) and [rbx-exteditor](https://github.com/MemoryPenguin/rbx-exteditor) by [MemoryPenguin](https://github.com/MemoryPenguin)
+* [rbxmk](https://github.com/anaminus/rbxmk) by [Anaminus](https://github.com/anaminus)
+
+So why did I build Rojo?
+
+Each of these tools solves what is essentially the same problem from a few different angles. The goal of Rojo is to take all of the lessons and ideas learned from these projects and build a tool that can solve the problem for good.
+
+Additionally:
+
+* I think that this tool needs to be built in a compiled language without a runtime, for easy distribution and good performance.
+* I think that the conventions promoted by other sync plugins (`.module.lua` for modules, as well a single sync point) are sub-optimal.
+* I think that I have a good enough understanding of the problem to build something robust.
+* I think that Rojo should be able to do more than just sync code.
\ No newline at end of file
diff --git a/mkdocs.yml b/mkdocs.yml
index 10529937..703712bf 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -11,8 +11,14 @@ theme:
pages:
- Home: index.md
+ - Why Rojo?: why-rojo.md
+ - Getting Started:
+ - Installation: getting-started/installation.md
+ - Creating a Project: getting-started/creating-a-project.md
+ - Sync Details: sync-details.md
markdown_extensions:
+ - attr_list
- admonition
- codehilite:
guess_lang: false