-
Notifications
You must be signed in to change notification settings - Fork 677
Add MkDocs documentation #2361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add MkDocs documentation #2361
Changes from all commits
ccb568c
69724ee
86a0fc6
6124549
73f1070
1f068a9
ecab61e
3a887fc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,3 +11,4 @@ resources/.DS_Store | |
| .clinic/ | ||
| CLAUDE.md | ||
| .idea/ | ||
| site/ | ||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # Development reference | ||
|
|
||
| If you would like to contribute, first, check out the [contribution page](contribute.md), and then check out the [Getting Started guide](getting_started.md) to learn how to set up a local copy of the repository. | ||
|
|
||
| ## Introduction | ||
|
|
||
| This project started as a fork of WarFront (not to be confused with FrontWars), by evanpelle. It is written in TypeScript, which is like JavaScript, but with static typing. As of writing, the project is deployed as a website at openfront.io, with a planned release on Steam. | ||
|
|
||
| ## Project Structure | ||
|
|
||
| - `/docs` - The documentation you're reading right now! | ||
| - `/resources` - Static assets (images, maps, etc.) | ||
| - `/proprietary` - Non free static assets (music) | ||
| - `/map-generator` - A tool used to create maps for the game | ||
| - `/tests` - [Jest](https://jestjs.io/) tests for [regression](https://en.wikipedia.org/wiki/Regression_testing) prevention | ||
| - `/src` - The source code | ||
| - `./core` - [Shared game logic](core.md) | ||
| - `./game` - Files managing in-memory game state, map loading, and utilities for game management | ||
| - `./configuration` - Different presets to be used by other parts of the code | ||
| - `./execution` - Logic controllers for different parts of the game | ||
| - `./worker` - Isolation of long-running or async tasks to a worker context | ||
| - `./pathfinding` - Different algorithms for navigation | ||
| - `./validations` - Utilities for sanitizing user content (like usernames) | ||
| - `./utilities` - Generic core helper functions | ||
| - `./client` - [Frontend game client](client.md) | ||
| - `./graphics` - 2D rendering | ||
| - `./components` - Custom HTML components | ||
| - `./styles` - CSS used by the client | ||
| - `./data` - json data accessed by the client (like countries) | ||
| - `./sound` - Sound management | ||
| - `./utilities` - Generic client helper functions | ||
| - `./server` - [Backend game server](server.md) | ||
|
|
||
| ## Technologies used | ||
|
|
||
| - [Lit](https://lit.dev/) for creating usable html objects (usually `TemplateResult`) from strings. | ||
|
|
||
|  | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,149 @@ | ||
| # Getting Started | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - git | ||
| - npm (v10.9.2 or higher) | ||
| - A modern browser with developer tools | ||
| - github account | ||
| - discord account | ||
|
|
||
| Before you start, make sure you have all of these tools installed and ready to be used | ||
|
|
||
| Test by running in your terminal (or command prompt) | ||
|
|
||
| ```bash | ||
| git --help | ||
| npm --help | ||
| ``` | ||
|
|
||
| You should see some help output. If you do, move on. If you don't try restarting your terminal, restarting your device, or reinstalling the tools. | ||
|
|
||
| ## Discussing with the community | ||
|
|
||
| If you would like to make a change, especially a larger one (like a new feature, a large rewrite, or similar), you will need to discuss with the contributors and the maintainers on IF the change should be implemented, and potentially HOW it should be implemented. You may make a change without this discussion, but there is a much larger chance that it will require a lot of changes, or be straight up rejected. | ||
|
|
||
| The first step to becoming active in the community as a contributor is to request to join the development discord over at [https://discord.gg/K9zernJB5z]. It usually takes up to a few days to get accepted. | ||
|
|
||
| In the meantime while waiting, you can open an issue on the issues page. Make sure to fill it out thoroughly. You can then ask to be assigned in the comments of the issue. | ||
|
|
||
| Once you know what kind of changes you would like to make, you can move on to the next section. | ||
|
|
||
| ## Making the change | ||
|
|
||
| If you are new to git, the first author of this file recommends you check out [this website](https://learngitbranching.js.org/?locale=en_US) for a visual way of learning how to use it. | ||
|
|
||
| ### Setup | ||
|
|
||
| In github, fork [the repo](https://github.com/openfrontio/OpenFrontIO) onto your account. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix capitalization: "github" → "GitHub". 🧰 Tools🪛 LanguageTool[uncategorized] ~38-~38: The official name of this software platform is spelled with a capital “H”. (GITHUB) 🤖 Prompt for AI Agents |
||
|
|
||
|  | ||
|
|
||
| Clone the repo, go into it, and set the upstream to the original repo. | ||
|
|
||
| ```bash | ||
| git clone https://github.com/YourUsername/OpenFrontIO.git | ||
| cd OpenFrontIO | ||
| git remote add upstream https://github.com/openfrontio/OpenFrontIO.git | ||
| ``` | ||
|
|
||
| Install dependencies | ||
|
|
||
| ```bash | ||
| npm i | ||
| ``` | ||
|
|
||
| Before making a change, make sure your local repo is up to date on the upstream and update your origin. | ||
|
|
||
| ```bash | ||
| git checkout main | ||
| git fetch upstream --rebase | ||
| git push | ||
| ``` | ||
|
|
||
| If you would like to make a new change, create a new branch, and `checkout` into it | ||
|
|
||
| ```bash | ||
| git checkout -b awesomefeature | ||
| ``` | ||
|
|
||
| ### Editing files | ||
|
|
||
| You can now make a change and make a commit | ||
|
|
||
| ```bash | ||
| git commit -m "add XYZ feature" path/to/file.ts | ||
| ``` | ||
|
|
||
| To test your change in-game, you can run any of the following | ||
|
|
||
| ```bash | ||
| npm run dev | ||
| ``` | ||
|
|
||
| ```bash | ||
| npm run start:client | ||
| ``` | ||
|
|
||
| ```bash | ||
| npm run start:server-dev | ||
| ``` | ||
|
|
||
| ### Cleaning up | ||
|
|
||
| Before publishing make sure to test your change manually, and then with npm, as you want to avoid creating regressions. | ||
|
|
||
| ```bash | ||
| npm run test | ||
| ``` | ||
|
|
||
| Make sure your format also matches the one employed by the rest of the codebase | ||
|
|
||
| ```bash | ||
| npm run format | ||
| ``` | ||
|
|
||
| or alternatively | ||
|
|
||
| ```bash | ||
| npx prettier --write path/to/file | ||
| ``` | ||
|
|
||
| Lastly, make sure to lint your code | ||
|
|
||
| ```bash | ||
| npm run lint | ||
| ``` | ||
|
|
||
| ```bash | ||
| npm run lint:fix | ||
| ``` | ||
|
|
||
| Don't forget to commit your changes | ||
|
|
||
| ```bash | ||
| git commit . -m "format" | ||
| ``` | ||
|
|
||
| ### Publishing your change | ||
|
|
||
| Once you are happy with your commits, format your changes, and push them to origin. You cannot push directly to upstream (the official repo). | ||
|
|
||
| ```bash | ||
| git push | ||
| ``` | ||
|
|
||
| Now, go to your repo on github, and create a pull request from your branch `YourUserName/OpenFrontIO/awesomefeature` to the main repo `OpenFrontIO/OpenFrontIO/main`. | ||
|
|
||
| Make sure to fill out the description properly before making a PR. If you are not ready to be reviewed yet, you can submit a "draft PR". As you push changes on your branch, the PR will be updated to match. | ||
|
|
||
| coderabbitai will then comment on your PR and suggest changes. If the changes are sensible, implement them. | ||
|
|
||
| Afterwards, if your PR is set as ready to be reviewed (not a draft) one of the maintainers will come and comment any needed changes. Discuss them further or implement the changes, and wait for another review. | ||
|
|
||
| Hopefully, afterwards, your change will be accepted, merged into main, and then later on, pushed out in an update to the live game! | ||
|
Comment on lines
+141
to
+144
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use American English spelling: "Afterwards" → "Afterward". Applies to both lines 138 and 141. 🧰 Tools🪛 LanguageTool[locale-violation] ~138-~138: In American English, ‘afterward’ is the preferred variant. ‘Afterwards’ is more commonly used in British English and other dialects. (AFTERWARDS_US) [locale-violation] ~141-~141: In American English, ‘afterward’ is the preferred variant. ‘Afterwards’ is more commonly used in British English and other dialects. (AFTERWARDS_US) 🤖 Prompt for AI Agents |
||
|
|
||
| ## Next steps | ||
|
|
||
| - To learn more about our contribution guidelines, check out [the contribution page](contribute.md) | ||
| - To learn more about the structure of the codebase, go to [the development reference](develop.md) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| # OpenFront docs | ||
|
|
||
| [OpenFront.io](https://openfront.io) is an online RTS io game project. | ||
|
|
||
| This documentation serves as a place to learn about the internal workings of [this project](https://github.com/openfrontio/openfrontio), namely: | ||
|
|
||
| - [Using the API (API Reference)](API.md) | ||
| - [Contributing](contribute.md) | ||
| - [Orienting yourself in the project (Developer Reference)](develop.md) | ||
|
|
||
| For a quick guide on how to get the repository up and running with some of your first changes, visit the [Starting Guide](getting_started.md)! | ||
|
|
||
| In order to learn about game mechanics, check out the [community run wiki](https://openfront.miraheze.org), or even contribute to it! |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| site_name: OpenFront docs | ||
| nav: | ||
| - Home: index.md | ||
| - API reference: API.md | ||
| - Getting Started: getting_started.md | ||
| - Contributing: contribute.md | ||
| - Development reference: develop.md | ||
| - Client reference: client.md | ||
| - Server reference: server.md | ||
| - Core reference: core.md | ||
|
|
||
| theme: readthedocs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add alt text to the image for accessibility.
The image is missing alt text, which is required for accessibility. Users with screen readers and others will not understand what the image depicts.
Apply this diff to add descriptive alt text:
Adjust the alt text to accurately describe what the image shows.
📝 Committable suggestion
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
38-38: Images should have alternate text (alt text)
(MD045, no-alt-text)
🤖 Prompt for AI Agents