Skip to content

Commit

Permalink
docs: add autogenerated documentation site
Browse files Browse the repository at this point in the history
  • Loading branch information
colinmarc committed Dec 11, 2024
1 parent 987b8ed commit 279048f
Show file tree
Hide file tree
Showing 17 changed files with 619 additions and 73 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
on:
push:
branches: [main, docs]

name: Build documentation site
jobs:
build:
name: Build
runs-on: ubuntu-24.04
steps:
- uses: dtolnay/rust-toolchain@stable
- uses: actions/checkout@v4
with:
submodules: true

- uses: swatinem/rust-cache@v2
with:
workspaces: |
mm-protocol
mm-client-common
- name: install protoc
run: |
sudo apt update
sudo apt install protobuf-compiler
- name: install zola
uses: taiki-e/install-action@v2
with:
tool: [email protected]

- name: generate config reference
run: |
mkdir -p docs/content/reference
cargo run --manifest-path mm-docgen/Cargo.toml --bin config-docgen \
mmserver.default.toml > docs/content/reference/config.md
- name: generate protocol reference
run: |
cargo run --manifest-path mm-docgen/Cargo.toml --bin protocol-docgen \
mm-protocol/src/messages.proto > docs/content/reference/protocol.md
- name: zola build
run: zola -r docs build -o docs/build

- name: generate rustdoc for mm-protocol
run: |
cargo doc --manifest-path mm-protocol/Cargo.toml \
--no-deps --target-dir docs/build
- name: generate rustdoc for mm-client-common
run: |
cargo doc --manifest-path mm-client-common/Cargo.toml \
--no-deps --target-dir docs/build
- name: Upload static files
id: deployment
uses: actions/upload-pages-artifact@v3
with:
path: docs/build
deploy:
name: Deploy
runs-on: ubuntu-latest
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4




3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "docs/themes/anemone"]
path = docs/themes/anemone
url = https://github.com/Speyll/anemone
64 changes: 11 additions & 53 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# Magic Mirror 🪞✨
[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/colinmarc/magic-mirror/tests.yaml)](https://github.com/colinmarc/magic-mirror/actions/workflows/tests.yaml)
[![Discord](https://img.shields.io/discord/1284975819222945802?style=flat&label=discord&color=7289DA)](https://discord.gg/v22G644DzS)
[![Server Release](https://img.shields.io/github/v/release/colinmarc/magic-mirror?filter=mmserver*&display_name=tag&label=download)](https://github.com/colinmarc/magic-mirror/releases/tag/mmserver-v0.5.6)
[![Client Release](https://img.shields.io/github/v/release/colinmarc/magic-mirror?filter=mmclient*&display_name=tag&label=download)](https://github.com/colinmarc/magic-mirror/releases/tag/mmclient-v0.4.1)

<picture>
<source srcset="docs/content/header_dark.png" media="(prefers-color-scheme: dark)" />
<img src="docs/content/header_light.png" />
</picture>

This is a game streaming and remote desktop tool for Linux, featuring:

Expand All @@ -17,56 +20,11 @@ This is a game streaming and remote desktop tool for Linux, featuring:
> [!WARNING]
> Alpha software! Please submit any issues you encounter. Run the server with `--bug-report` to generate detailed logs and record videos to attach to your report.
### Quickstart

Grab the latest release (link above), and run it on a server with a GPU:

```shell
$ cat > steam-bigpicture.toml <<EOF
command = ["steam", "-gamepadui"]
xwayland = true
EOF
$ ./mmserver --bind "<your local ip>:9599" -i steam-bigpicture.toml
```

You can replace steam with your app of choice, or even a full nested desktop environment like [Sway](https://swaywm.org/).

And then on the client (after installing `ffmpeg`):

```shell
$ ./mmclient "<ip>:9599" steam-bigpicture --codec h265 --resolution 1080
```

This will work over the local network, or a private IP space like Tailscale. To serve over the public internet, TLS is required. See [mmserver.default.toml](mmserver.default.toml) for more detail on that and other configuration options.

For instructions on building the server and/or client yourself, see [BUILD.md](BUILD.md).


### System Requirements

The following is required to run the server:

- Linux 6.x (for Ubuntu, this means Mantic or Noble)
- (For AMD/Intel cards) Mesa 24.1.x or later
- (For NVIDIA cards) [Vulkan drivers](https://developer.nvidia.com/vulkan-driver) version 550 or later
- XWayland (for X11 apps)

The following is required to run the client:

- Ffmpeg 6.x

### Encoder support

Hardware encoding, based on Vulkan Video, is needed to get the best performance and latency. CPU-based encode is available as a fallback, but it's much slower.

To see if your GPU supports video encoding, see the following matrix for your vendor: [AMD](https://en.wikipedia.org/wiki/Unified_Video_Decoder#Format_support)[NVIDIA](https://developer.nvidia.com/video-encode-and-decode-gpu-support-matrix-new)

Note that with the `ffmpeg` feature, linking against a system-installed `ffmpeg` is supported, which may allow you to use specific CPU-based codecs not considered in this table.
### Quick Links

| Codec | CPU | AMD | NVIDIA | Intel[^1] |
| ----- | :-: | :-: | :----: | :---: |
| H.264 || ✔️ | ✔️ ||
| H.265 | ✔️ | ✔️ | ✔️ ||
| AV1 | ✔️ ||||
- [Documentation](https://colinmarc.github.io/magic-mirror)
- [Latest Server Release [mmserver-0.5.6]](https://github.com/colinmarc/magic-mirror/releases/tag/mmserver-v0.5.6)
- [Latest CLI Client Release [mmclient-0.4.1]](https://github.com/colinmarc/magic-mirror/releases/tag/mmclient-v0.4.1)
- [Latest macOS Client Release](https://github.com/colinmarc/magic-mirror-swiftui/releases/latest)
- [Discord](https://discord.gg/v22G644DzS)

[^1]: I don't have an Intel GPU available to test, and it's difficult to find information online about driver/card support for hardware encode. Please let me know how it goes!
4 changes: 4 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# autogenerated
content/reference
build/
public/
15 changes: 15 additions & 0 deletions docs/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
base_url = "https://colinmarc.github.io/magic-mirror"
theme = "anemone"
compile_sass = false
build_search_index = false

[markdown]
highlight_code = true

[extra]
twitter_card = false
header_nav = [
{ url = "/", name_en = "/home/"},
{ url = "https://github.com/colinmarc/magic-mirror", name_en = "/github/"},
{ url = "", name_en = "/discord/"},
]
45 changes: 45 additions & 0 deletions docs/content/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
+++
+++

# Magic Mirror 🪞✨

<picture>
<source srcset="header_dark.png" media="(prefers-color-scheme: dark)" />
<img src="header_light.png" />
</picture>

This page contains documentation for [Magic Mirror](github.com/colinmarc/magic-mirror),
an open-source game streaming and remote desktop tool for linux hosts.

### Download

These links always point to the latest release.

- 💾 [Server [mmserver-0.5.6]](https://github.com/colinmarc/magic-mirror/releases/tag/mmserver-v0.5.6)
- 💾 [Command-Line Client [mmclient-0.4.1]](https://github.com/colinmarc/magic-mirror/releases/tag/mmclient-v0.4.1)
- 💾 [macOS GUI Client](https://github.com/colinmarc/magic-mirror-swiftui/releases/latest)

### Setup Guides

Start here to get things up and running.

- ⚙️ [Server Setup](@/setup/server.md)
- ⚙️ [Client Setup](@/setup/client.md)
<!-- - ⚙️ [Running on a Cloud VPS](./setup/vps.md) -->
<!-- - ⚙️ [Troubleshooting and Known Issues](@/setup/troubleshooting.md) -->

### Reference

Autogenerated from the code.

- 📖 [Configuration Reference](@/reference/config.md)
- 📖 [Protocol Reference](@/reference/protocol.md)
- 📖 [Rustdoc for `mm-protocol`](./doc/mm_protocol)
- 📖 [Rustdoc for `mm-client-common`](./doc/mm_client_common)

### Resources

Get help, report issues, make friends.

- ⁉️ [Issue Tracker](https://github.com/colinmarc/magic-mirror/issues)
- 💬 [Discord Chat](https://discord.gg/v22G644DzS)
Binary file added docs/content/header_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/content/header_light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 50 additions & 0 deletions docs/content/setup/client.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
+++
title = "Client Setup"

[extra]
toc = true
+++

## macOS GUI Client

The native macOS client can be downloaded from [the releases page](https://github.com/colinmarc/magic-mirror-swiftui/releases/latest).

It should work out of the box on ARM and Intel Macs running macOS 10.14 or
later.

## Installing the commandline client

There is also a cross-platform commandline client, `mmclient`. You can download
it [here](https://github.com/colinmarc/magic-mirror/releases/tag/mmclient-v0.4.1).

The commandline client requires `ffmpeg` 6.0 or later to be installed on the
system. It also requires up-to-date Vulkan drivers.

## Building mmclient

The following are required to build the client and its dependencies:

```
rust (MSRV 1.77.2)
nasm
cmake
protoc
libxkbcommon (linux only)
libwayland-client (linux only)
alsa (linux only)
ffmpeg 6.x
```

Besides Rust itself, the following command will install everything on ubuntu:

```
apt install \
nasm cmake protobuf-compiler libxkbcommon-dev libwayland-dev libasound2-dev \
ffmpeg libavutil-dev libavformat-dev libavdevice-dev libavfilter-dev
```

Or using homebrew on macOS:

```
brew install nasm cmake ffmpeg@6 protobuf
```
Loading

0 comments on commit 279048f

Please sign in to comment.