Skip to content

Commit

Permalink
documentation setup for MkDocs
Browse files Browse the repository at this point in the history
  • Loading branch information
SpontanCombust committed Mar 21, 2024
1 parent 01f0355 commit 8447f99
Show file tree
Hide file tree
Showing 10 changed files with 175 additions and 1 deletion.
28 changes: 28 additions & 0 deletions .github/workflows/deploy-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: deploy-pages

on:
push:
branches:
- master
workflow_dispatch:

permissions:
contents: write

jobs:
deploy-pages:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install python
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install dependencies
run: |
pip install mkdocs
pip install mkdocs-cinder
- name: Deploy
run: >
mkdocs gh-deploy -m "ci: update github pages"
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@
/editors/vscode/node_modules
/editors/vscode/out
/editors/vscode/server
*.vsix
*.vsix

/site
Binary file added docs/_theme_override/img/favicon.ico
Binary file not shown.
1 change: 1 addition & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# TODO!
5 changes: 5 additions & 0 deletions docs/copyright.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Notice of non-affiliation and disclaimer

Authors of `WitcherScript IDE` project are not affiliated, associated, authorized, endorsed by, or in any way officially connected with CD Projekt RED, or any of its subsidiaries or its affiliates. The official CDPR website can be found at `https://www.cdprojektred.com`.

Names `Witcher`, `Witcher Script` and other related names, marks, emblems and images are registered trademarks of their respective owners.
46 changes: 46 additions & 0 deletions docs/dev-manual.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Developer manual

Here you will find the information you need if you want to contribute to this project's creation or just want to compile the project yourself.


## Project structure
- `.vscode` - VSCode specific files with debugging configurations
- `crates` - server Rust code. The main crate is `lsp`, which contains language server implementation
- `docs` - project documentation from which this website is built
- `editors` - contains implementations of WitcherScript language client, currently just `vscode` client written in TypeScript
- `xtask` - code for build commands to speed up development


## Building the project
You will need [Rust with Cargo](https://rustup.rs/) to build the server and [node.js with npm](https://nodejs.org/en) to build the client.

Project utilises the `xtask` convention of writing build scripts in Rust. To call a build script simply run `cargo xtask {command}` in the root project directory. You can run `cargo xtask --help` to see all the available commands and what they do.

Currently available xtask commands:

- `prep-server` - build and copy LSP server executable into VSCode's extension directory
- `--release` - should LSP be built with optimised release profile
- `--target` - compilation target triple
- `prep-client` - build VSCode client
- `--watch` - whether client should be continuously watched for changes made to it and rebuilt
- `package` - build and package VSCode extension into a .vsix file
- `--out-dir` - output directory for the .vsix file; default is the current working directory
- `--out-name` - name of the output file without the extension; default is "witcherscript-ide"
- `install` - build, package and install the VSCode extension


## Debugging
Use VSCode to debug the client and server. The project provides launch configurations for both of them:

- `Launch Client` - launches the extension host session of the client. Client needs to be built first!
- `Attach to Server` - attaches to the currently running server process created by the client. You need the [CodeLLDB extension](https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb) for this.


## The project board
You can access the [project board](https://github.com/users/SpontanCombust/projects/2/views/1) conveniently detailing what has been done and future plans.


## Contributing
Contributions to the project are welcome. First create an issue or a PR to discuss the change you want to make and ensure that it doesn't conflict with any future plans or core features. The active development branch is `dev`.

You can also catch me in the [Wolven Workshop](https://discord.gg/S3HjaY65uh) Discord server.
5 changes: 5 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# About

WitcherScript IDE is a project aiming to improve the developer experience of Witcher 3 modders by supplying them with powerful code analysis tools in form of an editor extension.

`witcherscript-ide` implements the [Language Server Protocol](https://microsoft.github.io/language-server-protocol/) for the WitcherScript language - a proprietary scripting language used by award winning game Witcher 3 Wild Hunt created by CD Projekt RED.
64 changes: 64 additions & 0 deletions docs/user-manual/project-manifest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Script Project Manifest

In order for the IDE to know all the important information needed to analyze scripts a project needs a manifest file.
This file is written in TOML format and by convention is called `witcherscript.toml`.

Beware: format of the manifest may change in the future. Look out for breaking changes section in the changelog.

## Format:
Every manifest is composed of following sections:

- [content](#the-content-table) *:
- [name](#the-name-field) *
- [version](#the-version-field) *
- [game_version](#the-game_version-field) *
- [authors](#the-authors-field)
- [scripts_root](#the-scripts_root-field)
- [dependencies](#the-dependencies-table)

\* table/field is required

### The `[content]` table
Project metadata establishing basic information on how its content is named and structured.

#### The `name` field
Name of the project. It must begin with a letter and contain only alphanumerical characters or underscores and have no spaces.

#### The `version` field
Version of the project. It must follow [semantic versioning](https://semver.org/) format.

#### The `game_version` field
Version of Witcher 3 with which this project is compatible. It can be a range of versions.
The field does not require any specific format at the moment, but it will change in the future.

#### The `authors` field
An array of authors of this project. Their form can be completely arbitrary.
This field is optional.

#### The `scripts_root` field
Relative path to the scripts root directory. This field is optional and defaults to `"./scripts"`.


### The `[dependencies]` table
This table contains key-value pairs of dependency specifications. The kay is always the name of the foreign content. The value can take multiple forms:

- boolean `true`/`false` - means the content should be looked for based upon its name. If the value is `false` the dependency will be ignored.
- `{ path = "path/to/content" }` - content should be looked for in a specific directory on disk. The path can be either relative or absolute.


## Example
Contents of an exemplary `witcherscript.toml` manifest:

```toml
[content]
name = "modSuperSpeed"
version = "1.0.0"
authors = [ 'Yours truly' ]
game_version = "4.04"

[dependencies]
content0 = true # added by default
modMovement = { path = "../modMovement" }
```

Note that you do not have to create a manifest file by hand. You can use one of the "create" commands in the editor.
1 change: 1 addition & 0 deletions docs/user-manual/script-content.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# TODO!
22 changes: 22 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
site_name: WitcherScript IDE
site_description: WitcherScript-IDE - Witcher 3 scripting tooling
site_author: Przemysław Cedro (SpontanCombust)
site_url: https://spontancombust.github.io/witcherscript-ide/
repo_url: https://github.com/SpontanCombust/witcherscript-ide

nav:
- 'Home': 'index.md'
- 'User Manual':
- 'Script Content': 'user-manual/script-content.md'
- 'Project Manifest': 'user-manual/project-manifest.md'
- 'Developer Manual': 'dev-manual.md'
- 'Changelog': 'changelog.md'
- 'Copyright': 'copyright.md'

theme:
name: cinder
custom_dir: docs/_theme_override/
locale: en

exclude_docs: |
_theme_override

0 comments on commit 8447f99

Please sign in to comment.