Skip to content

Commit

Permalink
add web documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
aitorllj93 committed Dec 26, 2022
1 parent 3865256 commit ea51c9b
Show file tree
Hide file tree
Showing 54 changed files with 2,122 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/core/src/Values/ValueTypeRegistry.ts
Expand Up @@ -22,4 +22,8 @@ export class ValueTypeRegistry {
getAllNames(): string[] {
return Object.keys(this.valueTypeNameToValueType);
}

getAll(): ValueType[] {
return Object.values(this.valueTypeNameToValueType);
}
}
27 changes: 27 additions & 0 deletions website/.gitignore
@@ -0,0 +1,27 @@
# Dynamically generated content
/docs/profiles/Core/Nodes
/docs/profiles/Core/Values
/docs/profiles/Scene/Nodes
/docs/profiles/Scene/Values
/docs/examples

# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
41 changes: 41 additions & 0 deletions website/README.md
@@ -0,0 +1,41 @@
# Website

This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.

### Installation

```
$ yarn
```

### Local Development

```
$ yarn start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

### Build

```
$ yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

### Deployment

Using SSH:

```
$ USE_SSH=true yarn deploy
```

Not using SSH:

```
$ GIT_USER=<Your GitHub username> yarn deploy
```

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
3 changes: 3 additions & 0 deletions website/babel.config.js
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions website/blog/2021-08-26-welcome/index.md
@@ -0,0 +1,25 @@
---
slug: welcome
title: Welcome
authors: [bhouston, aitorllj93]
tags: [behave-graph, hello]
---

[Docusaurus blogging features](https://docusaurus.io/docs/blog) are powered by the [blog plugin](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-blog).

Simply add Markdown files (or folders) to the `blog` directory.

Regular blog authors can be added to `authors.yml`.

The blog post date can be extracted from filenames, such as:

- `2019-05-30-welcome.md`
- `2019-05-30-welcome/index.md`

A blog post folder can be convenient to co-locate blog post images:

![Behave-Graph Flow](./behave-graph-flow.png)

The blog supports tags as well!

**And if you don't want a blog**: just delete this directory, and use `blog: false` in your Docusaurus config.
11 changes: 11 additions & 0 deletions website/blog/authors.yml
@@ -0,0 +1,11 @@
bhouston:
name: Ben Houston
title: Behave-Graph maintainer
url: https://github.com/bhouston
image_url: https://github.com/bhouston.png

aitorllj93:
name: Aitor Llamas
title: Behave-Graph maintainer
url: https://github.com/aitorllj93
image_url: https://github.com/aitorllj93.png
7 changes: 7 additions & 0 deletions website/docs/core-concepts/_category_.json
@@ -0,0 +1,7 @@
{
"label": "Core Concepts",
"position": 4,
"link": {
"type": "generated-index"
}
}
51 changes: 51 additions & 0 deletions website/docs/core-concepts/abstractions.md
@@ -0,0 +1,51 @@
---
sidebar_position: 5
---

# Abstractions

Behave-graph is designed as a light weight library that can be plugged into other engines, such as Three.js or Babylon.js. In order to simplify pluggin into other engines, it defines the functionality required for interfacing with these engines as "abstractions", which can then be implemented by the engines.

This design is inspired by [Hardware Abstraction layers](https://en.wikipedia.org/wiki/Hardware_abstraction) present in operating systems. HALs, as they are called, are interfaces which are then implemented by drivers that enable that functionality. HALs allow for operating systems to easily be ported to different systems because the machine specific implementations for the operating systems are cordened off from the main operating system behind these HALs. Behave-graph takes this same approach.

Example abstractions in behave-graph:

* **ILogger**. The logging interface allows for behave-graph to report verbose, info, warning and error text messages. The command line graph-exec tool uses the driver DefaultLogger to output these messages to the console.
* **ILifecycleEventEmitter**. This interface is responsible for emitting when the behave-graph should start, tick and stop.
* **IScene**. This interface is responsible for doing basic scene manipulations. In the three example, this interface is implemented by the ThreeScene class that maps these operations to a Three.js-based scene graph.

For example here is the ILogger abstraction, you can see it is just a standard Typescript interface:

```ts
export interface ILogger {
verbose(text: string): void;
info(text: string): void;
warn(text: string): void;
error(text: string): void;
}
```

Here is the DefaultLogger implementation of the abstraction, you can see it is just a standard Typescript class that implements the above interface:

```ts
import { Logger } from '../../../../Diagnostics/Logger.js';
import { ILogger } from '../ILogger.js';

export class DefaultLogger implements ILogger {
verbose(text: string): void {
Logger.verbose(text);
}

info(text: string): void {
Logger.info(text);
}

warn(text: string): void {
Logger.warn(text);
}

error(text: string): void {
Logger.error(text);
}
}
```

0 comments on commit ea51c9b

Please sign in to comment.