Skip to content
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

Transform to modern sphinx framework #9

Draft
wants to merge 20 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Deploy Sphinx documentation

on:
push:
branches: [master]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y python3 python3-pip
pip install -r requirements.txt
- name: Build documentation
working-directory: docs
run: make html
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
source: "docs/_build/html"
branch: gh-pages
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
node_modules
_book

# Sphinx
.venv
_build
11 changes: 0 additions & 11 deletions .gitlab-ci.yml

This file was deleted.

6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"yaml.schemas": {
"https://squidfunk.github.io/mkdocs-material/schema.json": "mkdocs.yml",
"https://json.schemastore.org/github-workflow.json": "file:///c%3A/Users/Dennis/Projects/itch-docs/.github/workflows/deploy.yml"
}
}
18 changes: 7 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# The itch book

<!-- start add-to-docs -->

This book is a living documentation for [the itch.io app](https://itch.io/app).

Its intended audience includes:
Expand All @@ -13,16 +15,10 @@ Its intended audience includes:
If you find a typo, a factual inaccuracy, or an important caveat not covered in
this book, feel free to submit a pull request to the [GitHub repository](https://github.com/itchio/itch-docs).

<!-- end add-to-docs -->

## Note to developer

This book is build using the opensource
[Gitbook](https://github.com/GitbookIO/gitbook-cli) tool. Sadly it's abandoned
so building this file currently involves a little patch. See
`release/ci-book.js`

If you about to change something about the build process, make a new tag and
push that first so we have a backup of the compiled output incase we need to
roll back quickly. Tagged releases are pushed to separate folder on the docs
bucket.
## Note to developers

This documentation is built using [Sphinx](https://github.com/sphinx-doc/sphinx) which is using python.
Activate a virtual environment with `.venv/Scripts/activate` and install the dependencies with `pip install -r requirements.txt`.
Creating the compiled output then is as simple as running `make html` in the `docs` directory.
56 changes: 0 additions & 56 deletions SUMMARY.md

This file was deleted.

7 changes: 0 additions & 7 deletions book.json

This file was deleted.

20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
6 changes: 5 additions & 1 deletion appendix/README.md → docs/appendix/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@ While this book is focused on the itch app, we felt like some subjects slightly
* [Acknowledgements](./acknowledgements.md)
* [Building Linux software into a prefix](./building-into-a-prefix.md)

```{toctree}
:hidden:


acknowledgements
building-into-a-prefix
```
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
41 changes: 41 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = "Itch.io App"
copyright = (
"2024, Amos Wenger, leafo and the community on GitHub"
)
author = "Amos Wenger, leafo and the community on GitHub"
release = "0.1"

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = ["myst_parser", "sphinx_tippy", "sphinx.ext.githubpages"]

templates_path = ["_templates"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]


# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = "furo"
html_static_path = ["_static"]
html_title = "Itch.io App"

html_theme_options = {
"light_css_variables": {
"color-brand-primary": "#8E3737",
"color-brand-content": "#8E3737",
},
"dark_css_variables": {
"color-brand-primary": "#ea4d4d",
"color-brand-content": "#ea4d4d",
},
}
8 changes: 7 additions & 1 deletion developing/README.md → docs/developing/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@

# Contributor guide

Since itch is open-source, and we maintain it actively, anyone can contribute
to it in various ways! This chapter describes how.

```{toctree}
:hidden:

help
behind-the-scenes
```
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@

This section describes a few things that are done behind the curtain so that the app can function. You don't need to learn about them to use the app or contribute to it, but it's cool to have somewhere canonical where it's documented.

```{toctree}
:hidden:

continuous-deployment
../using/installing/dependencies
```
8 changes: 5 additions & 3 deletions developing/data-flow.md → docs/developing/data-flow.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
orphan: true
---
# Data Flow

itch follows the [Redux](http://redux.js.org/index.html) design pattern — to understand the rest of this page,
you need to be familiar with it. The basics are as follows:

Expand Down Expand Up @@ -91,6 +96,3 @@ interact with | || | render to
|| things that cross it are JSON
|| payloads sent asynchronously via IPC
```



6 changes: 4 additions & 2 deletions developing/diego.md → docs/developing/diego.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@

---
orphan: true
---
# diego

diego is our diagnostics mercenary: it attempts to dump information about the
Operating System, CPU and Graphics Card to a log file when someone tries to
install a game.

You can [read its source](../app/util/diego.js), or look at these example outputs
You can read its source (`app/util/diego.js`), or look at these example outputs


## Example outputs
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Environment Variables

These environment variables will change the behavior of the app:

* `DEVTOOLS=1` — start with Chromium Devtools open — useful when something goes
Expand All @@ -12,4 +14,3 @@ These environment variables will change the behavior of the app:
* `ITCH_EMULATE_OFFLINE=1` - simulate a network outage. This only affects itch, not butler.

See the [Performance hacking](/developing/performance.md) section for other environment variables that impact the app.

Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
## Setting up itch for development
# Setting up itch for development

itch is built in TypeScript and runs inside of Electron.

To get started, install the latest [node.js](https://nodejs.org/)

> Linux distributions tend to ship outdated node.js versions
>
> Use the nodesource [binary distributions](https://github.com/nodesource/distributions/) to get an up-to-date one.
```{caution}
Linux distributions tend to ship outdated node.js versions

Use the nodesource [binary distributions](https://github.com/nodesource/distributions/) to get an up-to-date one.
```

Then, clone the [https://github.com/itchio/itch](https://github.com/itchio/itch) repository somewhere.

Expand All @@ -16,7 +18,9 @@ Install the javascript dependencies by running this command from within the `itc
$ npm install
```

> For native modules, you'll need a compiler toolchain: Visual Studio 2015 on Windows, gcc/clang on Linux/macOS. See the [node-gyp](https://github.com/nodejs/node-gyp) page for more information on this.
```{note}
For native modules, you'll need a compiler toolchain: Visual Studio 2015 on Windows, gcc/clang on Linux/macOS. See the [node-gyp](https://github.com/nodejs/node-gyp) page for more information on this.
```

Finally, start the app!

Expand Down Expand Up @@ -179,4 +183,3 @@ We check the quality of the app's code by two kinds of tests:
* [Integration Tests](integration-tests.md), which test interactions

Check out the pages linked above to learn more about what their purpose is, when and how they're run, and how they're written.

10 changes: 10 additions & 0 deletions developing/help.md → docs/developing/help.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# What you can do to help

```{toctree}
:hidden:

getting-started
unit-tests
integration-tests
environment-variables
performance
```

If you like our work and want to help us make it even better, here are things you can do.

## Test games with the app
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ They make sure that all of the code, together, makes meaningful interactions hap

The app is tested as a whole using a homegrown golang runner that speaks webdriver to the app.

### Running integration tests
## Running integration tests

It looks deceptively simple:

Expand All @@ -22,14 +22,11 @@ If you're an itch.io employee, poke Amos about it to get set up. If you're not,

We'll take care of that part!

### Writing an integration test
## Writing an integration test

Scenarios live in `integration-tests`, along with some support code that makes it all tick. They're also explicitly listed in `integration-tests/main.go`.

These resources can be useful:

* The [webdriver API docs](http://webdriver.io/api.html)
* Existing tests!



File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,3 @@ export GoodComponent extends React.PureComponent<any, any> {
```

More details in [this medium article](https://medium.com/@esamatti/react-js-pure-render-performance-anti-pattern-fb88c101332f)

1 change: 0 additions & 1 deletion developing/unit-tests.md → docs/developing/unit-tests.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Unit tests

Unit tests are for checking that a specific, well-isolated bit of code does what
Expand Down
19 changes: 19 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
hide-toc: true
---

# Itch.io App Documentation

```{include} ../README.md
:start-after: <!-- start add-to-docs -->
:end-before: <!-- end add-to-docs -->
```

```{toctree}
:hidden:

using/README.md
integrating/README.md
developing/README
appendix/README.md
```
Loading