Initial upload

This commit is contained in:
technobaboo
2021-07-21 13:00:57 -05:00
parent 434678e4d8
commit 74aed3ed1d
53 changed files with 546 additions and 598 deletions

View File

@@ -1,11 +0,0 @@
---
slug: hola
title: Hola
author: Gao Wei
author_title: Docusaurus Core Team
author_url: https://github.com/wgao19
author_image_url: https://avatars1.githubusercontent.com/u/2055384?v=4
tags: [hola, docusaurus]
---
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet

View File

@@ -1,17 +0,0 @@
---
slug: hello-world
title: Hello
author: Endilie Yacop Sucipto
author_title: Maintainer of Docusaurus
author_url: https://github.com/endiliey
author_image_url: https://avatars1.githubusercontent.com/u/17883920?s=460&v=4
tags: [hello, docusaurus]
---
Welcome to this blog. This blog is created with [**Docusaurus 2**](https://docusaurus.io/).
<!--truncate-->
This is a test post.
A whole bunch of other information.

View File

@@ -1,13 +0,0 @@
---
slug: welcome
title: Welcome
author: Yangshun Tay
author_title: Front End Engineer @ Facebook
author_url: https://github.com/yangshun
author_image_url: https://avatars0.githubusercontent.com/u/1315101?s=400&v=4
tags: [facebook, hello, docusaurus]
---
Blog features are powered by the blog plugin. Simply add files to the `blog` directory. It supports tags as well!
Delete the whole directory if you don't want the blog features. As simple as that!

View File

@@ -2,34 +2,4 @@
sidebar_position: 1
---
# Tutorial Intro
Let's discover **Docusaurus in less than 5 minutes**.
## Getting Started
Get started by **creating a new site**.
Or **try Docusaurus immediately** with **[new.docusaurus.io](https://new.docusaurus.io)**.
## Generate a new site
Generate a new Docusaurus site using the **classic template**:
```shell
npx @docusaurus/init@latest init my-website classic
```
## Start your site
Run the development server:
```shell
cd my-website
npx docusaurus start
```
Your site starts at `http://localhost:3000`.
Open `docs/intro.md` and edit some lines: the site **reloads automatically** and display your changes.
# Intro

View File

@@ -0,0 +1,4 @@
{
"label": "Protocol",
"position": 2
}

View File

@@ -0,0 +1,4 @@
{
"label": "Client",
"position": 2
}

View File

@@ -0,0 +1 @@
# Initial Client Connection

View File

@@ -0,0 +1,72 @@
---
sidebar_position: 1
---
# Protocol
## Data
Every message uses flatbuffers and most use flexbuffers to add variant data such as method arguments and return values. The flatbuffers Message type is:
```cpp
namespace StardustXR;
table Message {
type: ubyte;
id: uint;
object: string;
method: string;
error: string;
data:[ubyte] (flexbuffer);
}
root_type Message;
```
## Message Types
All fields not accounted for are assumed to be not included or `0` or `""`
### Error
| Field Name | Value |
|-:|:-|
| `type` | `0` |
| `id` | `0` or ID of method call |
| `object` | Path to the object the error comes from |
| `method` | What method caused the error (if applicable, otherwise this is an empty string) |
| `error` | String containing the error message itself |
| `data` | Empty vector |
### Signal
Signals are method calls that do not expect a response of any kind.
| Field Name | Value |
|-:|:-|
| `type` | `1` |
| `object` | Path to object to send signal to |
| `method` | Name of the method to execute |
| `data` | Flexbuffer containing arguments to pass to remote method |
### Method Call
Method calls allow for remote procedure calling and should block the thread they are sent from until a response is heard.
| Field Name | Value |
|-:|:-|
| `type` | `2` |
| `id` | Dynamically generated ID to identify method return for this method |
| `object` | Path to object to execute method on |
| `method` | Name of the method to execute |
| `data` | Flexbuffer containing arguments to pass to remote method |
### Method Return
Message to pass the return value back to the program.
| Field Name | Value |
|-:|:-|
| `type` | `3` |
| `id` | The same as the message call's ID |
| `data` | Flexbuffer containing return value |
## Data Types
Stardust does not support the `Map` or `FixedTypedVector` flexbuffers datatypes.
### Color
A `Vector` of 4 `float` is treated as a `Color` in the form `RGBA`.
### Vector2
A `Vector` of 2 `double` is treated as a `Vector2`.
### Vector3
A `Vector` of 3 `double` is treated as a `Vector3`.
### Quaternion
A `Vector` of 4 `double` is treated as a `Quaternion`.

View File

@@ -0,0 +1,4 @@
{
"label": "Server",
"position": 3
}

View File

@@ -0,0 +1,4 @@
{
"label": "Server Objects",
"position": 2
}

View File

@@ -0,0 +1,11 @@
# /environment
## Signals
### `visible(bool enable)`
Enable or disables the skybox visibility (lighting remains active). This is not meant to be used for an additive AR mode as StereoKit will perform that when the OpenXR runtime indicates the layer's blend mode is additive.
### `setSkytex(string path)`
Sets the sky texture to be the image (HDR) at the absolute `path`.
### `setLighting(string path)`
Sets the ambient lighting (using spherical harmonics) to the HDR at the absolute `path`.

View File

@@ -0,0 +1,11 @@
# /field
Object managing fields for interaction.
## Signals
### `createBoxField(string name, Vector3 origin, Quaternion orientation, Vector3 size)`
Creates a new [[BoxField]] at `/field/[name]`.
### `createSphereField(string name, Vector3 origin, float radius)`
Creates a new [[SphereField]] at `/field/[name]`.

View File

@@ -0,0 +1,9 @@
# /hmd
Reference object to the HMD being used to render content and track head position.
## Signals
### `setPosition(Vector3 position)`
### `setRotation(Quaternion rotation)`
### `setPose(Vector3 position, Quaternion rotation)`
### `setIPD(double meters)`

View File

@@ -0,0 +1,10 @@
# /input
Object managing input and interaction.
## Signals
### `registerPointerInput(string name, Vector3 origin, Vector3 direction, float tilt)`
Creates a new [[Pointerinput]] at `/input/methods/[name]` with the origin, direction, and tilt specified.
### `registerInputHandler(string name, string field, string spacePath, Vector3 position, Quat rotation, string callbackPath, string callbackMethod)`
Creates a new [[InputHandler]] with the specified `name` and `field`, located relative to the space referenced in `spacePath` and the `postion` + `rotation`.

View File

@@ -0,0 +1,10 @@
# /lifecycle
Object representing the life cycle of the Stardust server, from start to each frame to end.
## Signals
### `subscribeLogicStep(string path, string method)`
Executes `method` on object at `path` on the client when the main logic loop of the server starts each frame.
`method` must have arguments of `(double delta, double timeToRender)`.
`delta` gives the time in seconds between the current time and the last time the logic loop executed while `timeToRender` gives the time in ms since epoch when the current frame is expected to reach the user's eyes.

View File

@@ -0,0 +1,7 @@
# /model
Object managing graphical models.
## Signals
### `createFromFile(string name, string path)`
Creates a new [[Model]] at `/model/[name]`.

View File

@@ -0,0 +1,7 @@
# /spatial
Object managing spatial nodes for parenting.
## Signals
### `create(string name, Vector3 origin, Quat orientation, Vector3 scale, bool translatable, bool rotatable, bool scalable)`
Creates a new [[Spatial]] at `/spatial/[name]`.

View File

@@ -0,0 +1,37 @@
---
sidebar_position: 3
---
# Model
### Derived from [[Spatial]]
A graphical model.
## Properties
### `setOrigin(Vector3 origin)`
Sets the origin to `origin`.
### `setOrientation(Quat orientation)`
Sets the orientation to `orientation`.
### `setPose(Vector3 origin, Quat orientation)`
Sets the pose using `origin` and `orientation` absolutely.
### `destroy()`
Destroys the model instance. Resources like the mesh and material and textures may be in memory still, but the resource manager will clean it up if needed.
### `setMaterialProperty(uint32 submeshIndex, string propertyName, float value)`
### `setMaterialProperty(uint32 submeshIndex, string propertyName, Color value)`
### `setMaterialProperty(uint32 submeshIndex, string propertyName, string value)`
Sets the material property `propertyName` on this model's submesh at `submeshIndex` to `value`. Valid material names are:
| Name | Type | Description |
|--------------|--------------|----------------------------------------------------------------------------------------------|
|`color` | `Color` | Tint/multiply the shader's output color by this amount. (default is opaque white) |
|`roughness` | `float` | Scale the metal texture's roughness by this amount |
|`metallic` | `float` | Scale the metal texture's metalness by this amount |
|`tex_scale` | `float` | Scale the UV coordinates of all textures by this amount |
|`diffuse` | `string` | Path to the diffuse texture of the material (if it has one). |
|`emission` | `string` | Path to the emission texture of the material (if it has one). |
|`metal` | `string` | Path to the metalness texture of the material (if it has one). |
|`normal` | `string` | Path to the normal map texture of the material (if it has one). |
|`occlusion` | `string` | Path to the occlusion map texture of the material (if it has one). |

View File

@@ -0,0 +1,10 @@
---
sidebar_position: 1
---
# Node
A base type for all othertypes that exist in 3D space.
## Methods
### `destroy(null)`
Destroy this node immediately, as well as all its children if it has any.

View File

@@ -0,0 +1,47 @@
---
sidebar_position: 2
---
# Spatial
### Derived from [[Node]]
A base type for types that exist in 3D space, always relative to another space or the engine's world space. Spatials are always relative because in AR or XXR reference spaces change constantly in response to new environments.
## Internal Properties
Sometimes it makes sense for a Spatial to not be scalable (like in [[Field]]s where scaling dramatically increases the number of steps to raymarch for pointers) or not be rotatable (point lights) or such, so these are disabled for certain Spatial-derived objects, mentioned right after "Derived from [[Spatial]]".
### `translatable: bool`
If false, object's origin cannot be modified from a client.
### `rotatable: bool`
If false, object's rotation cannot be modified from a client (e.g. point lights, point sound sources).
### `scalable: bool`
If false, object's scale cannot be modified from a client (e.g. [[Field]]s, [[PointerInput]]s).
## Methods
### `move(Vector3 position)`
Moves the Spatial relative to itself if `translatable` is not `false`.
### `rotate(Quat rotation)`
Rotates the Spatial relative to itself if `rotatable` is not `false`.
### `rotateAround(Vector3 point, Quat rotation)`
Rotates the Spatial around `point` (relative to itself) if `rotatable` is not `false`.
### `scale(float scale)`
Multiplies the Spatial's scale vector by `scale` if `scalable` is not `false`.
### `setOrigin(Vector3 origin)`
Sets the origin to `origin` if `translatable` is not `false`.
### `setOrientation(Quat orientation)`
Sets the orientation to `orientation` if `rotatable` is not `false`.
### `setScale(Vector3 scale)`
Sets the scale to `scale` if `scalable` is not `false`.
### `setPose(Vector3 origin, Quat orientation)`
Sets the pose relative to the Spatial's space if `translatable` and `rotatable` are true. This method saves on IPC calls compared to `setOrigin` and `setOrientation` in sequence.
### `setTransform(Vector3 origin, Quat orientation)`
Sets the transform relative to the Spatial's space if `translatable`, `rotatable` and `scalable` are true. This method saves on IPC calls compared to `setOrigin`, `setOrientation`, and `setScale` in sequence.
### `setSpatialParent(string parentPath)`
Sets the spatial parent of this `Spatial` while keeping the "absolute" position in space intact.

View File

@@ -0,0 +1,4 @@
{
"label": "Node Types",
"position": 1
}

View File

@@ -0,0 +1,6 @@
# BoxField
Derived from [[Field]], this Field is in a rectangular prism shape.
## Properties
### `setSize(Vector3 size)`
Sets the size of the box.

View File

@@ -0,0 +1,13 @@
# Field
### Derived from [[Spatial]]
Type that contains methods all Fields share. All fields created are under `/field`.
## Methods
### `double distance(string spacePath, Vector3 point)`
Returns the distance from `point` to the surface of the object, positive if the point is outside and negative if inside. When `point` is far enough away the object will give an approximate distance to the origin instead of the surface.
### `Vector3 normal(string spacePath, Vector3 point)`
Returns the normal of `point` compared to the surface of the object. Normal always points toward object.
### `Vector3 closestPoint(string spacePath, Vector3 point)`
Returns the closest point from `point` to the surface of the object. Use this instead of `distance` and `normal` when best to limit IPC calls.

View File

@@ -0,0 +1,6 @@
# SphereField
Derived from [[Field]], this Field is in a sphere shape.
## Properties
### `setRadius(double size)`
Sets the radius of the sphere.

View File

@@ -0,0 +1,4 @@
{
"label": "Fields",
"position": 4
}

View File

@@ -0,0 +1,23 @@
---
sidebar_position: 1
---
# InputHandler
## Derived from [[Spatial]] (`scalable: false`)
A handler to allow clients to recieve input.
## Methods
### `setOrigin(Vector3 origin)`
Sets the origin to `origin`.
### `setOrientation(Quat orientation)`
Sets the orientation to `orientation`.
### `setPose(Vector3 origin, Quat orientation)`
Sets the pose using `origin` and `orientation` relative to the pose's space.
### `setField(string field)`
Sets the field this input handler will use.
### `setCallback(string callbackPath, string callbackMethod)`
Sets the callback this input handler will use.

View File

@@ -0,0 +1,49 @@
---
sidebar_position: 2
---
# InputMethod
Represents an input device generically, with specifics being fleshed out in subclasses.
## Internal Properties
### `type: uint8`
| | Name | Description |
|---|--------------|-------------------------------------------------------------------------------------------------------------|
| 0 | `Global` | A non-spatial input, used for power buttons and system volume and such |
| 1 | `Controller` | Contains a pose and datamap for buttons, trackpad, joystick, grip, trigger, etc. |
| 2 | [[PointerInput]] | Defined by origin, direction, and tilt with datamap for buttons, trackpad, etc. |
| 3 | [[HandInput]] | Contains a full 27-bone hand skeleton (including forearm) and datamap for abstractions like grip, pinch distance/point, etc. |
### `datamap: Dictionary`
See #Datamap:
## Internal Methods
### `distanceToField(string field)`
Returns the distance from this input to a field in meters. `field` is the name of the field, not the full path.
### `serialize()`
Returns a serialized version of the InputMethod, each serialized schema is shown under #Serialization in the respective Input subclasses.
## Serialization
| Key | Value Type |
|-----------|-------------|
| type | `int` |
| distance | `float` |
## Datamap
The datamap is a dictionary containing abstracted and raw data related to the input that clients can use to analyze input in the most optimal way. It has keys of type `Key`(Flexbuffers-specific, in any other language use a `String`) and values:
| Type | Example Uses | Usage Notes |
|-----------|----------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------|
| `bool` | Digital buttons | If values are analog, use a `float` instead with `1.0` being considered `true`. |
| `float` | Analog trigger, grip | For values such as grip/trigger, make the range `0.0`-`1.0`, for something like a scroll wheel `-0.5`-`0.5`. |
| `Vector2` | Touchpad, joystick | For values such as trackpad and joystick, make each component in the range of `-0.5`-`0.5` and calculate+apply deadzone before setting these values. |
| `Vector3` | Pinch position, grip axis vector | For points and directions, make this a value inside the InputMethod's local space. Raw hand pose data should not be put in the datamap. |
Standard supported datamap keys will be put in the individual type's documentation, however you can put more data in and some input handlers may be able to use that data for better interactions.
## Methods
### `setPosition(Vector3 point)`
Sets the position of this [[InputMethod]]. This pose also defines the main interaction point.
### `modifyDatamap(Dictionary data)`
Modifies the datamap of this [[InputMethod]]. Each key here will add to the datamap if not present and set the existing value if present. Any key not present in `data` will be unaffected.

View File

@@ -0,0 +1,4 @@
{
"label": "Input",
"position": 5
}

View File

@@ -0,0 +1,10 @@
include "common.fbs";
namespace StardustXR;
table Hand {
finger_joints:[joint] (required);
palm:joint (required);
wrist:joint (required);
elbow:joint;
}

View File

@@ -0,0 +1,57 @@
# HandInput
### Derived from [[InputMethod]] and [[Spatial]] (`scalable: false`)
A full 27-bone hand+forearm input with useful abstractions provided through the datamap.
The local space of a hand is where +Z is away from the palm, +Y is from the palm to the fingers, and +X is orthogonal and to the right.
## Serialization
| Key | Value Type |
|-----------|--------------|
| origin | `Vector3` |
| direction | `Vector3` |
| tilt | `float` |
| datamap | `Dictionary` |
```js
[
thumb metacarpal,
thumb proximal,
thumb distal,
thumb tip,
index metacarpal,
index proximal,
index intermediate,
index distal,
index tip,
middle metacarpal,
middle proximal,
middle intermediate,
middle distal,
middle tip,
ring metacarpal,
ring proximal,
ring intermediate,
ring distal,
ring tip,
little metacarpal,
little proximal,
little intermediate,
little distal,
little tip
]
```
(This section is WIP)
## Datamap
### Required
| Key | Value Type | Description |
|-----------------|-----------------------------|--------------------------------------------------------------------|
| confidence | `float` (range `0.0`-`1.0`) | How confident the hand tracker is of the pose of the hand |
| isLeft | `bool` | `true` if this hand is the left hand, `false` if not |
| pinchStrength | `float` (range `0.0`-`1.0`) | How much the hand is pinching |
| pinchDistance | `float` (>`0.0`) | The distance in meters between the thumb and index finger |
| grabStrength | `float` (range `0.0`-`1.0`) | How much the hand is making a fist |
## Methods
**TODO**: Properly secured field distance calculation accessible to clients

View File

@@ -0,0 +1,16 @@
include "PointerInput.fbs";
include "HandInput.fbs";
namespace StardustXR;
union InputDataRaw {
Pointer,
Hand
}
table InputData {
input:InputDataRaw (required);
distance:float = 0;
datamap:[ubyte] (flexbuffer);
}
root_type InputData;

View File

@@ -0,0 +1,8 @@
include "common.fbs";
namespace StardustXR;
table Pointer {
origin:vec3 (required);
direction:vec3 (required);
tilt:float = 0;
}

View File

@@ -0,0 +1,36 @@
# PointerInput
### Derived from [[InputMethod]]
An input method for pointers, such as the Huawei VR Glass's remote, a pointer put on an Index controller, Oculus style laser mouse, etc.
The local space for a pointer is where +Z is along the pointer's direction, +X is to the right of the pointer when laying face up, and +Y is upward when laying face up.
## Serialization
| Key | Value Type |
|-----------|--------------|
| origin | `Vector3` |
| direction | `Vector3` |
| tilt | `float` |
| datamap | `Dictionary` |
## Datamap
### Required
| Key | Value Type | Description |
|--------|-------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| select | `float` (range `0.0`-`1.0`) | Whether the pointer is attempting to select an object, usually through trigger. 1.0 is selected, 0.0 is not selected, and inbetween is to add smoothness to the interaction. |
| grab | `float` (range `0.0`-`1.0`) | How much the pointer is attempting to grab an object. 0.0 is not grabbing at all, 1.0 is grabbing the strongest, and inbetween is to add smoothness. |
| scroll | `Vector2` (component range `-0.5`-`0.5`) | The amount to scroll on this input tick (sensitivity determined on the receiving client). Can be used for 2D scrolling as well as adjusting depth/size when grabbing an object. |
### Built in
| Key | Value Type | Description |
|--------|-------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| deepestPointDistance | `float` (>=`0.0`) | The distance along the ray where the deepest surface point resides. |
## Methods
### `setDirection(Vector3 direction)`
Sets the direction the pointer is pointing in stage space.
### `setTilt(float angle)`
Sets the tilt of the pointer (rotation about the pointer direction) clockwise in radians.
### `setOrientation(Vector3 direction, float angle)`
Sets the direction and tilt of the pointer to save on IPC calls.
### `setPose(Vector3 origin, Vector3 direction, float angle)`
Sets the origin, direction, and tilt of the pointer to save on IPC calls.

View File

@@ -0,0 +1,25 @@
namespace StardustXR;
struct vec3 {
x:float;
y:float;
z:float;
}
struct quat {
w:float;
x:float;
y:float;
z:float;
}
struct pose {
position:vec3;
rotation:quat;
}
struct joint {
position:vec3;
rotation:quat;
radius:float;
}

View File

@@ -0,0 +1,2 @@
#!/usr/bin/env bash
flatc -c *.fbs $@

View File

@@ -1,4 +0,0 @@
{
"label": "Tutorial - Basics",
"position": 2
}

View File

@@ -1,21 +0,0 @@
---
sidebar_position: 6
---
# Congratulations!
You have just learned the **basics of Docusaurus** and made some changes to the **initial template**.
Docusaurus has **much more to offer**!
Have **5 more minutes**? Take a look at **[versioning](../tutorial-extras/manage-docs-versions.md)** and **[i18n](../tutorial-extras/translate-your-site.md)**.
Anything **unclear** or **buggy** in this tutorial? [Please report it!](https://github.com/facebook/docusaurus/discussions/4610)
## What's next?
- Read the [official documentation](https://docusaurus.io/).
- Add a custom [Design and Layout](https://docusaurus.io/docs/styling-layout)
- Add a [search bar](https://docusaurus.io/docs/search)
- Find inspirations in the [Docusaurus showcase](https://docusaurus.io/showcase)
- Get involved in the [Docusaurus Community](https://docusaurus.io/community/support)

View File

@@ -1,29 +0,0 @@
---
sidebar_position: 3
---
# Create a Blog Post
Docusaurus creates a **page for each blog post**, but also a **blog index page**, a **tag system**, an **RSS** feed...
## Create your first Post
Create a file at `blog/2021-02-28-greetings.md`:
```md title="blog/2021-02-28-greetings.md"
---
slug: greetings
title: Greetings!
author: Steven Hansel
author_title: Docusaurus Contributor
author_url: https://github.com/ShinteiMai
author_image_url: https://github.com/ShinteiMai.png
tags: [greetings]
---
Congratulations, you have made your first post!
Feel free to play around and edit this post as much you like.
```
A new blog post is now available at `http://localhost:3000/blog/greetings`.

View File

@@ -1,55 +0,0 @@
---
sidebar_position: 2
---
# Create a Document
Documents are **groups of pages** connected through:
- a **sidebar**
- **previous/next navigation**
- **versioning**
## Create your first Doc
Create a markdown file at `docs/hello.md`:
```md title="docs/hello.md"
# Hello
This is my **first Docusaurus document**!
```
A new document is now available at `http://localhost:3000/docs/hello`.
## Configure the Sidebar
Docusaurus automatically **creates a sidebar** from the `docs` folder.
Add metadatas to customize the sidebar label and position:
```md title="docs/hello.md" {1-4}
---
sidebar_label: 'Hi!'
sidebar_position: 3
---
# Hello
This is my **first Docusaurus document**!
```
It is also possible to create your sidebar explicitly in `sidebars.js`:
```diff title="sidebars.js"
module.exports = {
tutorialSidebar: [
{
type: 'category',
label: 'Tutorial',
- items: [...],
+ items: ['hello'],
},
],
};
```

View File

@@ -1,43 +0,0 @@
---
sidebar_position: 1
---
# Create a Page
Add **Markdown or React** files to `src/pages` to create a **standalone page**:
- `src/pages/index.js` -> `localhost:3000/`
- `src/pages/foo.md` -> `localhost:3000/foo`
- `src/pages/foo/bar.js` -> `localhost:3000/foo/bar`
## Create your first React Page
Create a file at `src/pages/my-react-page.js`:
```jsx title="src/pages/my-react-page.js"
import React from 'react';
import Layout from '@theme/Layout';
export default function MyReactPage() {
return (
<Layout>
<h1>My React page</h1>
<p>This is a React page</p>
</Layout>
);
}
```
A new page is now available at `http://localhost:3000/my-react-page`.
## Create your first Markdown Page
Create a file at `src/pages/my-markdown-page.md`:
```mdx title="src/pages/my-markdown-page.md"
# My Markdown page
This is a Markdown page
```
A new page is now available at `http://localhost:3000/my-markdown-page`.

View File

@@ -1,31 +0,0 @@
---
sidebar_position: 5
---
# Deploy your site
Docusaurus is a **static-site-generator** (also called **[Jamstack](https://jamstack.org/)**).
It builds your site as simple **static HTML, JavaScript and CSS files**.
## Build your site
Build your site **for production**:
```bash
npm run build
```
The static files are generated in the `build` folder.
## Deploy your site
Test your production build locally:
```bash
npm run serve
```
The `build` folder is now served at `http://localhost:3000/`.
You can now deploy the `build` folder **almost anywhere** easily, **for free** or very small cost (read the **[Deployment Guide](https://docusaurus.io/docs/deployment)**).

View File

@@ -1,144 +0,0 @@
---
sidebar_position: 4
---
# Markdown Features
Docusaurus supports **[Markdown](https://daringfireball.net/projects/markdown/syntax)** and a few **additional features**.
## Front Matter
Markdown documents have metadata at the top called [Front Matter](https://jekyllrb.com/docs/front-matter/):
```text title="my-doc.md"
// highlight-start
---
id: my-doc-id
title: My document title
description: My document description
slug: /my-custom-url
---
// highlight-end
## Markdown heading
Markdown text with [links](./hello.md)
```
## Links
Regular Markdown links are supported, using url paths or relative file paths.
```md
Let's see how to [Create a page](/create-a-page).
```
```md
Let's see how to [Create a page](./create-a-page.md).
```
**Result:** Let's see how to [Create a page](./create-a-page.md).
## Images
Regular Markdown images are supported.
Add an image at `static/img/docusaurus.png` and display it in Markdown:
```md
![Docusaurus logo](/img/docusaurus.png)
```
![Docusaurus logo](/img/docusaurus.png)
## Code Blocks
Markdown code blocks are supported with Syntax highlighting.
```jsx title="src/components/HelloDocusaurus.js"
function HelloDocusaurus() {
return (
<h1>Hello, Docusaurus!</h1>
)
}
```
```jsx title="src/components/HelloDocusaurus.js"
function HelloDocusaurus() {
return <h1>Hello, Docusaurus!</h1>;
}
```
## Admonitions
Docusaurus has a special syntax to create admonitions and callouts:
:::tip My tip
Use this awesome feature option
:::
:::danger Take care
This action is dangerous
:::
:::tip My tip
Use this awesome feature option
:::
:::danger Take care
This action is dangerous
:::
## MDX and React Components
[MDX](https://mdxjs.com/) can make your documentation more **interactive** and allows using any **React components inside Markdown**:
```jsx
export const Highlight = ({children, color}) => (
<span
style={{
backgroundColor: color,
borderRadius: '20px',
color: '#fff',
padding: '10px',
cursor: 'pointer',
}}
onClick={() => {
alert(`You clicked the color ${color} with label ${children}`)
}}>
{children}
</span>
);
This is <Highlight color="#25c2a0">Docusaurus green</Highlight> !
This is <Highlight color="#1877F2">Facebook blue</Highlight> !
```
export const Highlight = ({children, color}) => (
<span
style={{
backgroundColor: color,
borderRadius: '20px',
color: '#fff',
padding: '10px',
cursor: 'pointer',
}}
onClick={() => {
alert(`You clicked the color ${color} with label ${children}`);
}}>
{children}
</span>
);
This is <Highlight color="#25c2a0">Docusaurus green</Highlight> !
This is <Highlight color="#1877F2">Facebook blue</Highlight> !

View File

@@ -1,4 +0,0 @@
{
"label": "Tutorial - Extras",
"position": 3
}

View File

@@ -1,55 +0,0 @@
---
sidebar_position: 1
---
# Manage Docs Versions
Docusaurus can manage multiple versions of your docs.
## Create a docs version
Release a version 1.0 of your project:
```bash
npm run docusaurus docs:version 1.0
```
The `docs` folder is copied into `versioned_docs/version-1.0` and `versions.json` is created.
Your docs now have 2 versions:
- `1.0` at `http://localhost:3000/docs/` for the version 1.0 docs
- `current` at `http://localhost:3000/docs/next/` for the **upcoming, unreleased docs**
## Add a Version Dropdown
To navigate seamlessly across versions, add a version dropdown.
Modify the `docusaurus.config.js` file:
```js title="docusaurus.config.js"
module.exports = {
themeConfig: {
navbar: {
items: [
// highlight-start
{
type: 'docsVersionDropdown',
},
// highlight-end
],
},
},
};
```
The docs version dropdown appears in your navbar:
![Docs Version Dropdown](/img/tutorial/docsVersionDropdown.png)
## Update an existing version
It is possible to edit versioned docs in their respective folder:
- `versioned_docs/version-1.0/hello.md` updates `http://localhost:3000/docs/hello`
- `docs/hello.md` updates `http://localhost:3000/docs/next/hello`

View File

@@ -1,88 +0,0 @@
---
sidebar_position: 2
---
# Translate your site
Let's translate `docs/intro.md` to French.
## Configure i18n
Modify `docusaurus.config.js` to add support for the `fr` locale:
```js title="docusaurus.config.js"
module.exports = {
i18n: {
defaultLocale: 'en',
locales: ['en', 'fr'],
},
};
```
## Translate a doc
Copy the `docs/intro.md` file to the `i18n/fr` folder:
```bash
mkdir -p i18n/fr/docusaurus-plugin-content-docs/current/
cp docs/intro.md i18n/fr/docusaurus-plugin-content-docs/current/intro.md
```
Translate `i18n/fr/docusaurus-plugin-content-docs/current/intro.md` in French.
## Start your localized site
Start your site on the French locale:
```bash
npm run start -- --locale fr
```
Your localized site is accessible at `http://localhost:3000/fr/` and the `Getting Started` page is translated.
:::caution
In development, you can only use one locale at a same time.
:::
## Add a Locale Dropdown
To navigate seamlessly across languages, add a locale dropdown.
Modify the `docusaurus.config.js` file:
```js title="docusaurus.config.js"
module.exports = {
themeConfig: {
navbar: {
items: [
// highlight-start
{
type: 'localeDropdown',
},
// highlight-end
],
},
},
};
```
The locale dropdown now appears in your navbar:
![Locale Dropdown](/img/tutorial/localeDropdown.png)
## Build your localized site
Build your site for a specific locale:
```bash
npm run build -- --locale fr
```
Or build your site to include all the locales at once:
```bash
npm run build
```

View File

@@ -1,34 +1,38 @@
const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
const lightCodeTheme = require('prism-react-renderer/themes/vsLight');
const darkCodeTheme = require('prism-react-renderer/themes/vsDark');
/** @type {import('@docusaurus/types').DocusaurusConfig} */
module.exports = {
title: 'My Site',
tagline: 'Dinosaurs are cool',
url: 'https://your-docusaurus-test-site.com',
title: 'Stardust XR',
tagline: 'We Fight for the Users!',
url: 'https://stardustxr.github.io',
baseUrl: '/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/favicon.ico',
organizationName: 'facebook', // Usually your GitHub org/user name.
projectName: 'docusaurus', // Usually your repo name.
organizationName: 'StardustXR', // Usually your GitHub org/user name.
projectName: 'stardustxr.github.io', // Usually your repo name.
themeConfig: {
colorMode: {
defaultMode: "dark",
disableSwitch: false,
respectPrefersColorScheme: false,
},
navbar: {
title: 'My Site',
title: 'Stardust XR',
logo: {
alt: 'My Site Logo',
src: 'img/logo.svg',
alt: 'Stardust XR logo, a yellow astroid with smaller white astroids around it',
src: 'img/icon.webp',
},
items: [
{
type: 'doc',
docId: 'intro',
position: 'left',
label: 'Tutorial',
label: 'Docs',
},
{to: '/blog', label: 'Blog', position: 'left'},
{
href: 'https://github.com/facebook/docusaurus',
href: 'https://github.com/technobaboo/stardust-xr',
label: 'GitHub',
position: 'right',
},
@@ -41,35 +45,27 @@ module.exports = {
title: 'Docs',
items: [
{
label: 'Tutorial',
to: '/docs/intro',
label: 'Protocol',
to: '/docs/protocol/protocol',
},
],
},
{
title: 'Community',
items: [
{
label: 'Stack Overflow',
href: 'https://stackoverflow.com/questions/tagged/docusaurus',
},
{
label: 'Discord',
href: 'https://discordapp.com/invite/docusaurus',
href: 'https://discord.gg/qwxuwRrbP5',
},
{
label: 'Twitter',
href: 'https://twitter.com/docusaurus',
href: 'https://twitter.com/stardustxr',
},
],
},
{
title: 'More',
items: [
{
label: 'Blog',
to: '/blog',
},
{
label: 'GitHub',
href: 'https://github.com/facebook/docusaurus',
@@ -77,7 +73,7 @@ module.exports = {
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`,
copyright: `Copyright © ${new Date().getFullYear()} Nova King`,
},
prism: {
theme: lightCodeTheme,
@@ -92,13 +88,7 @@ module.exports = {
sidebarPath: require.resolve('./sidebars.js'),
// Please change this to your repo.
editUrl:
'https://github.com/facebook/docusaurus/edit/master/website/',
},
blog: {
showReadingTime: true,
// Please change this to your repo.
editUrl:
'https://github.com/facebook/docusaurus/edit/master/website/blog/',
'https://github.com/StardustXR/website/edit/main/',
},
theme: {
customCss: require.resolve('./src/css/custom.css'),

View File

@@ -7,13 +7,13 @@
/* You can override the default Infima variables here. */
:root {
--ifm-color-primary: #25c2a0;
--ifm-color-primary-dark: rgb(33, 175, 144);
--ifm-color-primary-darker: rgb(31, 165, 136);
--ifm-color-primary-darkest: rgb(26, 136, 112);
--ifm-color-primary-light: rgb(70, 203, 174);
--ifm-color-primary-lighter: rgb(102, 212, 189);
--ifm-color-primary-lightest: rgb(146, 224, 208);
--ifm-color-primary: #dde000;
--ifm-color-primary-dark: rgb(175, 173, 33);
--ifm-color-primary-darker: rgb(165, 163, 31);
--ifm-color-primary-darkest: rgb(134, 136, 26);
--ifm-color-primary-light: rgb(201, 203, 70);
--ifm-color-primary-lighter: rgb(212, 210, 102);
--ifm-color-primary-lightest: rgb(223, 224, 146);
--ifm-code-font-size: 95%;
}

View File

@@ -16,8 +16,8 @@ function HomepageHeader() {
<div className={styles.buttons}>
<Link
className="button button--secondary button--lg"
to="/docs/intro">
Docusaurus Tutorial - 5min
to="/docs/stardust-protocol/protocol">
Protocol API Reference
</Link>
</div>
</div>
@@ -29,8 +29,8 @@ export default function Home() {
const {siteConfig} = useDocusaurusContext();
return (
<Layout
title={`Hello from ${siteConfig.title}`}
description="Description will go into a meta tag in <head />">
title={`${siteConfig.title}`}
description="XR Display Server">
<HomepageHeader />
<main>
<HomepageFeatures />

View File

@@ -1,7 +0,0 @@
---
title: Markdown page example
---
# Markdown page example
You don't need React to write simple standalone pages.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 15 KiB

BIN
static/img/icon.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 895 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 6.3 KiB