Skip to content

Commit 407a1a4

Browse files
authored
Merge pull request #393 from consideRatio/pr/transition-from-rst-to-myst
docs: convert .rst to MyST based markdown files
2 parents fb39fa7 + 63a073a commit 407a1a4

18 files changed

+588
-576
lines changed

.github/workflows/publish.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,13 @@ on:
1111
- "docs/**"
1212
- "contrib/**"
1313
- "**.md"
14-
- "**.rst"
1514
- ".github/workflows/*"
1615
- "!.github/workflows/publish.yaml"
1716
push:
1817
paths-ignore:
1918
- "docs/**"
2019
- "contrib/**"
2120
- "**.md"
22-
- "**.rst"
2321
- ".github/workflows/*"
2422
- "!.github/workflows/publish.yaml"
2523
branches-ignore:

.github/workflows/test.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,13 @@ on:
99
- "docs/**"
1010
- "contrib/**"
1111
- "**.md"
12-
- "**.rst"
1312
- ".github/workflows/*"
1413
- "!.github/workflows/test.yaml"
1514
push:
1615
paths-ignore:
1716
- "docs/**"
1817
- "contrib/**"
1918
- "**.md"
20-
- "**.rst"
2119
- ".github/workflows/*"
2220
- "!.github/workflows/test.yaml"
2321
branches-ignore:

docs/source/arbitrary-ports-hosts.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
(arbitrary-ports)=
2+
3+
# Accessing Arbitrary Ports or Hosts
4+
5+
If you already have a server running on localhost listening on
6+
a port, you can access it through the notebook at
7+
`<notebook-base>/proxy/<port>`.
8+
The URL will be rewritten to remove the above prefix.
9+
10+
You can disable URL rewriting by using
11+
`<notebook-base>/proxy/absolute/<port>` so your server will receive the full
12+
URL in the request.
13+
14+
This works for all ports listening on the local machine.
15+
16+
You can also specify arbitrary hosts in order to proxy traffic from
17+
another machine on the network `<notebook-base>/proxy/<host>:<port>`.
18+
19+
For security reasons the host must match an entry in the `host_allowlist` in your configuration.
20+
21+
## With JupyterHub
22+
23+
Let's say you are using a JupyterHub set up on a remote machine, and you have a
24+
process running on that machine listening on port 8080. If your hub URL is
25+
`myhub.org`, each user can access the service running on port 8080 with the URL
26+
`myhub.org/hub/user-redirect/proxy/8080`. The `user-redirect` will make sure
27+
that:
28+
29+
1. It provides a redirect to the correct URL for the particular
30+
user who is logged in.
31+
2. If a user is not logged in, it'll present them with a login
32+
screen. They'll be redirected there after completing authentication.
33+
34+
You can also set `c.Spawner.default_url` to `/proxy/8080` to have
35+
users be shown to your application directly after logging in -
36+
without ever seeing the notebook interface.
37+
38+
## Without JupyterHub
39+
40+
A very similar set up works when you don't use JupyterHub. You
41+
can construct the URL with `<notebook-url>/proxy/<port>`.
42+
43+
If your notebook url is `http://localhost:8888` and you have
44+
a process running listening on port 8080, you can access it with
45+
the URL `http://localhost:8888/proxy/8080`.
46+
47+
This is mostly useful for testing, since you can normally just
48+
access services on your local machine directly.
49+
50+
## From Notebook Extension
51+
52+
If you have a client side extension for the classic Jupyter Notebook
53+
interface (nbextension), you can construct the URL for accessing
54+
your service in this way:
55+
56+
```js
57+
define(["base/js/utils"], function (utils) {
58+
// Get base URL of current notebook server
59+
var base_url = utils.get_body_data("baseUrl");
60+
61+
// Construct URL of our proxied service
62+
var service_url = base_url + "proxy/" + port;
63+
64+
// Do stuff with your service_url
65+
});
66+
```
67+
68+
You can then make HTTP / Websocket requests as you wish from your
69+
code.
70+
71+
## From JupyterLab Extension
72+
73+
Accessing your service from a JupyterLab extension is similar to
74+
accessing it from a classic notebook extension.
75+
76+
```typescript
77+
import { PageConfig } from "@jupyterlab/coreutils";
78+
79+
// Get base URL of current notebook server
80+
let base_url = PageConfig.getBaseUrl();
81+
82+
// Construct URL of our proxied service
83+
let service_url = base_url + "proxy/" + port;
84+
85+
// Do stuff with your service_url
86+
```

docs/source/arbitrary-ports-hosts.rst

Lines changed: 0 additions & 93 deletions
This file was deleted.

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"sphinxext.rediraffe",
2626
]
2727
root_doc = "index"
28-
source_suffix = [".md", ".rst"]
28+
source_suffix = [".md"]
2929
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
3030

3131

docs/source/convenience/new.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
(convenience:new)=
2+
3+
# Making a new convenience package
4+
5+
There is a [cookiecutter](https://github.com/cookiecutter/cookiecutter)
6+
template provided in this repo that can be used to make new packages.
7+
8+
```bash
9+
pip install cookiecutter
10+
cookiecutter contrib/template -o contrib/
11+
```
12+
13+
This should ask you a bunch of questions, and generate a directory
14+
named after your project with a python package. From there, you should:
15+
16+
1. Edit the `__init__.py` file to fill in the command used to start your
17+
process, any environment variables, and title of the launcher icon.
18+
2. (Optionally) Add a square svg icon for your launcher in the `icons`
19+
subfolder, with the same name as your project.

docs/source/convenience/new.rst

Lines changed: 0 additions & 22 deletions
This file was deleted.
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Theia IDE
2+
3+
[Theia](https://theia-ide.org/) is a configurable web based IDE
4+
built with components from [Visual Studio Code](https://code.visualstudio.com/).
5+
6+
This package is a plugin for [jupyter-server-proxy](https://jupyter-server-proxy.readthedocs.io/)
7+
that lets you run an instance of theia alongside your notebook, primarily
8+
in a JupyterHub / Binder environment.
9+
10+
## Installing Theia
11+
12+
1. [Install the Yarn package manager](https://classic.yarnpkg.com/en/docs/install/) with one of the available
13+
methods.
14+
15+
2. Theia is highly configurable, so you need to decide which features you want
16+
in your theia install. Make a `package.json` with the list of extensions you want,
17+
following [the instructions here](https://theia-ide.org/docs/composing_applications/).
18+
19+
Here is an example:
20+
21+
```js
22+
{
23+
"private": true,
24+
"dependencies": {
25+
"@theia/callhierarchy": "latest",
26+
"@theia/editor-preview": "latest",
27+
"@theia/file-search": "latest",
28+
"@theia/git": "latest",
29+
"@theia/json": "latest",
30+
"@theia/languages": "latest",
31+
"@theia/markers": "latest",
32+
"@theia/merge-conflicts": "latest",
33+
"@theia/messages": "latest",
34+
"@theia/mini-browser": "latest",
35+
"@theia/monaco": "latest",
36+
"@theia/navigator": "latest",
37+
"@theia/outline-view": "latest",
38+
"@theia/preferences": "latest",
39+
"@theia/preview": "latest",
40+
"@theia/python": "latest",
41+
"@theia/search-in-workspace": "latest",
42+
"@theia/terminal": "latest",
43+
"@theia/textmate-grammars": "latest",
44+
"@theia/typescript": "latest",
45+
"typescript": "latest",
46+
"yarn": "^1.12.3"
47+
},
48+
"devDependencies": {
49+
"@theia/cli": "latest"
50+
}
51+
}
52+
```
53+
54+
3. Run the following commands in the same location as your package.json file
55+
to install all packages & build theia.
56+
57+
```bash
58+
yarn
59+
yarn theia build
60+
```
61+
62+
This should set up theia to run and be built.
63+
64+
4. Add the `node_modules/.bin` directory to your `$PATH`, so `jupyter-theia-proxy` can
65+
find the `theia` command.
66+
67+
```bash
68+
export PATH="$(pwd)/node_modules/.bin:${PATH}"
69+
```

docs/source/convenience/packages/theia.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/source/examples.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
(examples)=
2+
3+
# Examples
4+
5+
If you are looking for examples on how to configure `jupyter-server-proxy`, you might want to check existing
6+
projects on GitHub, such as:
7+
8+
- [jupyter-pgweb-proxy](https://github.com/illumidesk/jupyter-pgweb-proxy): Run [pgweb](https://github.com/sosedoff/pgweb) (cross-platform PostgreSQL client)
9+
- [jupyter-pluto-proxy](https://github.com/illumidesk/jupyter-pluto-proxy): Run [Pluto.jl](https://github.com/fonsp/Pluto.jl) (notebooks for Julia)
10+
- [jupyterserverproxy-openrefine](https://github.com/psychemedia/jupyterserverproxy-openrefine): Run [OpenRefine](https://openrefine.org/) (tool for working with messy data)
11+
- [gator](https://github.com/mamba-org/gator): Run the Mamba Navigator (JupyterLab-based standalone application)
12+
13+
Projects can also add the `jupyter-server-proxy` topic to the GitHub repository to make it more discoverable:
14+
[https://github.com/topics/jupyter-server-proxy](https://github.com/topics/jupyter-server-proxy)

docs/source/examples.rst

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)