-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #777 from ClaasJG/master
Deploy Website with Github Pages (Related #776)
- Loading branch information
Showing
18 changed files
with
246 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
name: Website | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
env: | ||
RUSTFLAGS: -Cdebuginfo=0 | ||
CARGO_TERM_COLOR: always | ||
CARGO_INCREMENTAL: 0 | ||
RUST_BACKTRACE: 1 | ||
|
||
jobs: | ||
Tutorials: | ||
name: Doc Tutorials | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
sparse-checkout: docs/tutorials | ||
|
||
- name: Build Books | ||
uses: taiki-e/install-action@v2 | ||
with: | ||
tool: mdbook@0.4.37 | ||
|
||
- run: mdbook build docs/tutorials --dest-dir ${GITHUB_WORKSPACE}/public/docs/tutorials | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: Doc Tutorials | ||
path: public/docs/tutorials | ||
|
||
Rust-API: | ||
name: Doc Rust API | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
profile: minimal | ||
override: true | ||
components: rust-docs | ||
|
||
- name: Build API Doc | ||
env: | ||
FEATURES: parallel serde derive uuid_entity storage-event-control | ||
run: cargo doc --all --features "${FEATURES}" # --no-deps | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: Doc Rust API | ||
path: | | ||
target/doc | ||
Website: | ||
name: Doc Website | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
sparse-checkout: | | ||
docs/website | ||
- name: Find Base Url | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# Use the API to retrieve the github pages url and set an environment variable containing the value. | ||
run: echo "GITHUB_PAGES_URL=$(gh api "repos/$GITHUB_REPOSITORY/pages" --jq '.html_url')" >> $GITHUB_ENV | ||
|
||
- uses: taiki-e/install-action@v2 | ||
with: | ||
tool: zola@0.18.0 | ||
|
||
- run: zola build --base-url $GITHUB_PAGES_URL | ||
working-directory: docs/website | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: Doc Zola | ||
path: docs/website/public | ||
|
||
Deploy: | ||
name: Deploy | ||
runs-on: ubuntu-latest | ||
needs: [ Tutorials, Rust-API, Website ] | ||
permissions: | ||
pages: write | ||
id-token: write | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
if: github.event_name != 'pull_request' | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: Doc Tutorials | ||
path: public/docs/tutorials | ||
|
||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: Doc Rust API | ||
path: public/docs/api | ||
|
||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: Doc Zola | ||
path: public | ||
|
||
- uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: public | ||
|
||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,101 @@ | ||
+++ | ||
paginate_by = 5 | ||
sort_by = "date" | ||
title = "Specs" | ||
template = "section-nodate.html" | ||
+++ | ||
|
||
> **S**pecs **P**arallel **ECS** | ||
Specs is an Entity-Component System written in Rust. | ||
Unlike most other ECS libraries out there, it provides | ||
|
||
* easy parallelism | ||
* high flexibility | ||
* contains 5 different storages for components, which can be extended by the user | ||
* its types are mostly not coupled, so you can easily write some part yourself and | ||
still use Specs | ||
* `System`s may read from and write to components and resources, can depend on each | ||
other and you can use barriers to force several stages in system execution | ||
* high performance for real-world applications | ||
|
||
## [Link to the book][book] | ||
|
||
[book]: docs/tutorials/ | ||
|
||
## Example | ||
|
||
```rust | ||
use specs::prelude::*; | ||
|
||
// A component contains data | ||
// which is associated with an entity. | ||
#[derive(Debug)] | ||
struct Vel(f32); | ||
|
||
impl Component for Vel { | ||
type Storage = VecStorage<Self>; | ||
} | ||
|
||
#[derive(Debug)] | ||
struct Pos(f32); | ||
|
||
impl Component for Pos { | ||
type Storage = VecStorage<Self>; | ||
} | ||
|
||
struct SysA; | ||
|
||
impl<'a> System<'a> for SysA { | ||
// These are the resources required for execution. | ||
// You can also define a struct and `#[derive(SystemData)]`, | ||
// see the `full` example. | ||
type SystemData = (WriteStorage<'a, Pos>, ReadStorage<'a, Vel>); | ||
|
||
fn run(&mut self, (mut pos, vel): Self::SystemData) { | ||
// The `.join()` combines multiple component storages, | ||
// so we get access to all entities which have | ||
// both a position and a velocity. | ||
for (pos, vel) in (&mut pos, &vel).join() { | ||
pos.0 += vel.0; | ||
} | ||
} | ||
} | ||
|
||
fn main() { | ||
// The `World` is our | ||
// container for components | ||
// and other resources. | ||
let mut world = World::new(); | ||
world.register::<Pos>(); | ||
world.register::<Vel>(); | ||
|
||
// An entity may or may not contain some component. | ||
|
||
world.create_entity().with(Vel(2.0)).with(Pos(0.0)).build(); | ||
world.create_entity().with(Vel(4.0)).with(Pos(1.6)).build(); | ||
world.create_entity().with(Vel(1.5)).with(Pos(5.4)).build(); | ||
|
||
// This entity does not have `Vel`, so it won't be dispatched. | ||
world.create_entity().with(Pos(2.0)).build(); | ||
|
||
// This builds a dispatcher. | ||
// The third parameter of `with` specifies | ||
// logical dependencies on other systems. | ||
// Since we only have one, we don't depend on anything. | ||
// See the `full` example for dependencies. | ||
let mut dispatcher = DispatcherBuilder::new() | ||
.with(SysA, "sys_a", &[]).build(); | ||
// This will call the `setup` function of every system. | ||
// In this example this has no effect | ||
// since we already registered our components. | ||
dispatcher.setup(&mut world); | ||
|
||
// This dispatches all the systems in parallel (but blocking). | ||
dispatcher.dispatch(&mut world); | ||
} | ||
``` | ||
|
||
## Contribution | ||
|
||
Contribution is very welcome! If you didn't contribute before, | ||
just filter for issues with "easy" or "good first issue" label. | ||
Please note that your contributions are assumed to be dual-licensed under Apache-2.0/MIT. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{% extends "index.html" %} | ||
|
||
{% block content %} | ||
<div class="post"> | ||
<h1 class="post-title">{{ section.title }}</h1> | ||
{{ section.content | safe }} | ||
</div> | ||
{% endblock content %} | ||
|
Oops, something went wrong.