Move documentation from wiki to main repo

Makes it easier to keep documentation up to date and can deploy with
GitHub pages.

README.md moved to docs/README.md and is shared with GitHub Pages home
page.
This commit is contained in:
Leroy Hopson 2022-08-07 22:49:29 +12:00
parent 66254ea17e
commit 6f89edc14e
No known key found for this signature in database
GPG key ID: D2747312A6DB51AA
36 changed files with 4544 additions and 143 deletions

View file

@ -0,0 +1,56 @@
---
layout: default
title: Building From Source
parent: Setup
nav_order: 2
permalink: /setup/building-from-source
---
# Building From Source
Building GodotXterm from source consists of four steps:
1. Clone git submodules.
2. Compile libuv using CMake.
3. Compile godot-cpp using scons.
4. Compile libtsm and libgodotxterm using scons.
This plugin follows the same format as the [GDNative C++ Example](https://docs.godotengine.org/en/stable/tutorials/plugins/gdnative/gdnative-cpp-example.html). So if you can compile that example then you are 90% of the way there. The main difference is using CMake to compile libuv.
## Dependencies
- [Git](https://git-scm.com/) (to clone git submodules)
- [SCons](https://scons.org/) (a software construction tool)
- A C/C++ compiler (i.e. [gcc](https://gcc.gnu.org/), [llvm](https://llvm.org/), [MSVC](https://visualstudio.microsoft.com/vs/features/cplusplus/))
- [CMake](https://cmake.org/) (to compile libuv)
## The Easy Way
Run the build script in `addons/godot-xterm/native`:
```
cd addons/godot_xterm/native
./build.sh
```
On Windows you can use `git-bash` to run this script.
Provided the dependencies above are installed then it should "just work™".
Binaries for your platform will be installed in `addons/godot_xterm/native/bin`.
The [build.sh] script accepts args `--target` which can be set to `debug` (default) or `release` and `--disable-pty` to compile only the dependencies of [Terminal] node and not [PTY] node (even on platforms that support it).
### The Hard Way
If you are having trouble compiling, study the [build.sh] script and the GitHub actions workflow in [main.yml] to see what commands are being run and how dependencies are installed. You can also dig into the [SConstruct](https://github.com/lihop/godot-xterm/blob/stable/addons/godot_xterm/native/SConstruct) file, and don't forget to refer back to the [GDNative C++ Example](https://docs.godotengine.org/en/stable/tutorials/plugins/gdnative/gdnative-cpp-example.html).
Also feel free to open a new discussion in the [discussions](https://github.com/lihop/godot-xterm/discussions) section of this project.
## Cross Compiling
Although the SConstruct file contains some logic for cross-compiling, it has never been tested. If you want compile for other platforms consider forking this repo and then pushing your changes to GitHub. The workflow defined in [main.yml] will run and build the library for all supported platforms (Linux, macOS, Windows, and HTML5).
Additionally, If you have `docker` and `docker-compose` installed, the [build.sh] script will also try to build the HTML5 binary inside a docker container and copy them to `addons/godot_xterm/native/bin`.
[PTY]: /api/pty
[Terminal]: /api/terminal
[build.sh]: https://github.com/lihop/godot-xterm/blob/stable/addons/godot_xterm/native/build.sh
[main.yml]: https://github.com/lihop/godot-xterm/blob/stable/.github/workflows/main.yml

View file

@ -0,0 +1,54 @@
---
layout: default
title: Precompiled Binaries
parent: Setup
nav_order: 1
permalink: /setup/precompiled-binaries
---
# Precompiled Binaries
{: .no_toc }
Installing GodotXterm using precompiled binaries means that you wont be required
to use a C/C++ compiler to build the project from source. It is simply a matter
of copying files to the correct location in your project. These files can be
installed from several sources:
1. TOC
{:toc}
**Note:** precompiled binaries will only work with certain versions of Godot
(usually the current stable release). If you need binaries for a different or
custom Godot version, or want to make modifications to the C/C++ code, please
refer to the section on [Building From Source](/setup/building-from-source).
## Godot Asset Library
GodotXterm can be installed from the [Godot Asset Library](https://godotengine.org/asset-library/asset/1007).
See the [Godot Asset Library documentation](https://docs.godotengine.org/en/stable/community/asset_library/using_assetlib.html) for more info on how to use it.
## Gd-plug Plugin Manager
If you are using the gd-plug plugin manager you can add the following line to your `plug.gd` file:
```
plug("lihop/godot-xterm-dist", {commit = "a1131a562e8e8f0c57b0ddf61de7fa015d463ba0", include = ["addons/godot_xterm"]})
```
Replace the commit hash with the hash of the GodotXterm version you wish to install.
See [tags](https://github.com/lihop/godot-xterm-dist/tags) for a list of versions and their corresponding commit hashes.
See the [gd-plug documentation](https://github.com/imjp94/gd-plug/blob/master/README.md) for more info on how to use it.
## Manual Installation
Alternatively, GodotXterm can be installed manually in two steps:
1. Copy the [`addons/godot_xterm`](https://github.com/lihop/godot-xterm/tree/stable/addons/godot_xterm) directory to the `addons` directory of your Godot project.
2. Copy the GDNative binaries into `addons/godot_xterm/native/bin` directory.
The easiest way to obtain the GDNative binaries is to download them from [the Releases page](https://github.com/lihop/godot-xterm/releases).
Download the zip archive named `libgodot-xterm-release.zip` and extract its contents into the `/addons/godot_xterm/native/bin` directory of your project.
After this your `addons/godot_xterm/native/bin` directory should contain the following files:
- `libgodot-xterm.javascript.32.wasm`
- `libgodot-xterm.linux.32.so`
- `libgodot-xterm.linux.64.so`
- `libgodot-xterm.osx.64.dylib`
- `libgodot-xterm.windows.32.dll`
- `libgodot-xterm.windows.64.dll`
Debug builds are also available on the Releases page if required.
Download and unzip `libgodot-xterm-debug.zip` instead of `libgodot-xterm-release.zip` to the same location.

9
docs/setup/setup.md Normal file
View file

@ -0,0 +1,9 @@
---
layout: default
title: Setup
nav_order: 2
has_children: true
permalink: /setup
---
# Setup