Skip to content

Commit 6f1f9c1

Browse files
committed
docs: apply rst-to-myst on previously renamed files
1 parent 99c493a commit 6f1f9c1

File tree

8 files changed

+405
-389
lines changed

8 files changed

+405
-389
lines changed
Lines changed: 35 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,87 @@
1-
.. _arbitrary-ports:
1+
(arbitrary-ports)=
22

3-
==================================
4-
Accessing Arbitrary Ports or Hosts
5-
==================================
3+
# Accessing Arbitrary Ports or Hosts
64

75
If you already have a server running on localhost listening on
86
a port, you can access it through the notebook at
9-
``<notebook-base>/proxy/<port>``.
7+
`<notebook-base>/proxy/<port>`.
108
The URL will be rewritten to remove the above prefix.
119

1210
You can disable URL rewriting by using
13-
``<notebook-base>/proxy/absolute/<port>`` so your server will receive the full
11+
`<notebook-base>/proxy/absolute/<port>` so your server will receive the full
1412
URL in the request.
1513

1614
This works for all ports listening on the local machine.
1715

1816
You can also specify arbitrary hosts in order to proxy traffic from
19-
another machine on the network ``<notebook-base>/proxy/<host>:<port>``.
17+
another machine on the network `<notebook-base>/proxy/<host>:<port>`.
2018

21-
For security reasons the host must match an entry in the ``host_allowlist`` in your configuration.
19+
For security reasons the host must match an entry in the `host_allowlist` in your configuration.
2220

23-
With JupyterHub
24-
===============
21+
## With JupyterHub
2522

2623
Let's say you are using a JupyterHub set up on a remote machine,
2724
and you have a process running on that machine listening on port
28-
8080. If your hub URL is ``myhub.org``, each user can
25+
8080\. If your hub URL is `myhub.org`, each user can
2926
access the service running on port 8080 with the URL
30-
``myhub.org/hub/user-redirect/proxy/8080``. The ``user-redirect``
27+
`myhub.org/hub/user-redirect/proxy/8080`. The `user-redirect`
3128
will make sure that:
3229

33-
#. It provides a redirect to the correct URL for the particular
30+
1. It provides a redirect to the correct URL for the particular
3431
user who is logged in
35-
#. If a user is not logged in, it'll present them with a login
32+
2. If a user is not logged in, it'll present them with a login
3633
screen. They'll be redirected there after completing authentication.
3734

38-
You can also set ``c.Spawner.default_url`` to ``/proxy/8080`` to have
35+
You can also set `c.Spawner.default_url` to `/proxy/8080` to have
3936
users be shown to your application directly after logging in -
4037
without ever seeing the notebook interface.
4138

42-
Without JupyterHub
43-
==================
39+
## Without JupyterHub
4440

4541
A very similar set up works when you don't use JupyterHub. You
46-
can construct the URL with ``<notebook-url>/proxy/<port>``.
42+
can construct the URL with `<notebook-url>/proxy/<port>`.
4743

48-
If your notebook url is ``http://localhost:8888`` and you have
44+
If your notebook url is `http://localhost:8888` and you have
4945
a process running listening on port 8080, you can access it with
50-
the URL ``http://localhost:8888/proxy/8080``.
46+
the URL `http://localhost:8888/proxy/8080`.
5147

5248
This is mostly useful for testing, since you can normally just
5349
access services on your local machine directly.
5450

55-
From Notebook Extension
56-
=======================
51+
## From Notebook Extension
5752

5853
If you have a client side extension for the classic Jupyter Notebook
5954
interface (nbextension), you can construct the URL for accessing
6055
your service in this way:
6156

62-
.. code:: js
57+
```js
58+
define(['base/js/utils'], function(utils) {
59+
// Get base URL of current notebook server
60+
var base_url = utils.get_body_data('baseUrl');
6361

64-
define(['base/js/utils'], function(utils) {
65-
// Get base URL of current notebook server
66-
var base_url = utils.get_body_data('baseUrl');
62+
// Construct URL of our proxied service
63+
var service_url = base_url + 'proxy/' + port;
6764

68-
// Construct URL of our proxied service
69-
var service_url = base_url + 'proxy/' + port;
70-
71-
// Do stuff with your service_url
72-
});
65+
// Do stuff with your service_url
66+
});
67+
```
7368

7469
You can then make HTTP / Websocket requests as you wish from your
7570
code.
7671

77-
From JupyterLab Extension
78-
=========================
72+
## From JupyterLab Extension
7973

8074
Accessing your service from a JupyterLab extension is similar to
8175
accessing it from a classic notebook extension.
8276

83-
.. code:: typescript
84-
85-
import { PageConfig } from '@jupyterlab/coreutils';
77+
```typescript
78+
import { PageConfig } from '@jupyterlab/coreutils';
8679

87-
// Get base URL of current notebook server
88-
let base_url = PageConfig.getBaseUrl()
80+
// Get base URL of current notebook server
81+
let base_url = PageConfig.getBaseUrl()
8982

90-
// Construct URL of our proxied service
91-
let service_url = base_url + 'proxy/' + port;
83+
// Construct URL of our proxied service
84+
let service_url = base_url + 'proxy/' + port;
9285

93-
// Do stuff with your service_url
86+
// Do stuff with your service_url
87+
```

docs/source/convenience/new.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
1-
.. _convenience/new:
1+
(convenience-new)=
22

3-
================================
4-
Making a new convenience package
5-
================================
3+
# Making a new convenience package
64

7-
There is a `cookiecutter <https://github.com/cookiecutter/cookiecutter>`_
5+
There is a [cookiecutter](https://github.com/cookiecutter/cookiecutter)
86
template provided in this repo that can be used to make new packages.
97

10-
.. code:: bash
11-
12-
pip install cookiecutter
13-
cookiecutter contrib/template -o contrib/
8+
```bash
9+
pip install cookiecutter
10+
cookiecutter contrib/template -o contrib/
11+
```
1412

1513
This should ask you a bunch of questions, and generate a directory
1614
named after your project with a python package. From there, you should:
1715

18-
#. Edit the ``__init__.py`` file to fill in the command used to start your
16+
1. Edit the `__init__.py` file to fill in the command used to start your
1917
process, any environment variables, and title of the launcher icon
20-
21-
#. (Optionally) Add a square svg icon for your launcher in the ``icons``
18+
2. (Optionally) Add a square svg icon for your launcher in the `icons`
2219
subfolder, with the same name as your project.

docs/source/convenience/packages/theia.md

Lines changed: 0 additions & 1 deletion
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/examples.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
1-
.. _examples:
1+
(examples)=
22

3-
========
4-
Examples
5-
========
3+
# Examples
64

7-
If you are looking for examples on how to configure ``jupyter-server-proxy``, you might want to check existing
5+
If you are looking for examples on how to configure `jupyter-server-proxy`, you might want to check existing
86
projects on GitHub, such as:
97

10-
- `jupyter-pgweb-proxy <https://github.com/illumidesk/jupyter-pgweb-proxy>`_: Run `pgweb <https://github.com/sosedoff/pgweb>`_ (cross-platform PostgreSQL client)
11-
- `jupyter-pluto-proxy <https://github.com/illumidesk/jupyter-pluto-proxy>`_: Run `Pluto.jl <https://github.com/fonsp/Pluto.jl>`_ (notebooks for Julia)
12-
- `jupyterserverproxy-openrefine <https://github.com/psychemedia/jupyterserverproxy-openrefine>`_: Run `OpenRefine <https://openrefine.org/>`_ (tool for working with messy data)
13-
- `gator <https://github.com/mamba-org/gator>`_: Run the Mamba Navigator (JupyterLab-based standalone application)
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)
1412

15-
Projects can also add the ``jupyter-server-proxy`` topic to the GitHub repository to make it more discoverable:
16-
`https://github.com/topics/jupyter-server-proxy <https://github.com/topics/jupyter-server-proxy>`_
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/index.md

Lines changed: 41 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,75 @@
1-
================================================
2-
Welcome to Jupyter Server Proxy's documentation!
3-
================================================
1+
# Welcome to Jupyter Server Proxy's documentation!
42

53
Jupyter Server Proxy lets you run arbitrary external processes (such
64
as RStudio, Shiny Server, syncthing, PostgreSQL, etc) alongside your
75
notebook, and provide authenticated web access to them.
86

9-
.. note::
10-
11-
This project used to be called **nbserverproxy**. if you have an older
12-
version of nbserverproxy installed, remember to uninstall it before installing
13-
jupyter-server-proxy - otherwise they may conflict
7+
:::{note}
8+
This project used to be called **nbserverproxy**. if you have an older
9+
version of nbserverproxy installed, remember to uninstall it before installing
10+
jupyter-server-proxy - otherwise they may conflict
11+
:::
1412

1513
The primary use cases are:
1614

17-
#. Use with JupyterHub / Binder to allow launching users into web
15+
1. Use with JupyterHub / Binder to allow launching users into web
1816
interfaces that have nothing to do with Jupyter - such as RStudio,
1917
Shiny, or OpenRefine.
20-
#. Allow access from frontend javascript (in classic notebook or
18+
2. Allow access from frontend javascript (in classic notebook or
2119
JupyterLab extensions) to access web APIs of other processes
22-
running locally in a safe manner. This is used by the `JupyterLab
23-
extension <https://github.com/dask/dask-labextension>`_ for
24-
`dask <https://www.dask.org/>`_.
25-
26-
27-
Contents
28-
========
20+
running locally in a safe manner. This is used by the [JupyterLab
21+
extension](https://github.com/dask/dask-labextension) for
22+
[dask](https://www.dask.org/).
2923

30-
.. toctree::
31-
:maxdepth: 2
24+
## Contents
3225

33-
install
34-
server-process
35-
launchers
36-
arbitrary-ports-hosts
26+
```{toctree}
27+
:maxdepth: 2
3728
29+
install
30+
server-process
31+
launchers
32+
arbitrary-ports-hosts
33+
```
3834

39-
Convenience packages for popular applications
40-
=============================================
35+
## Convenience packages for popular applications
4136

4237
This repository contains various python packages
43-
set up with appropriate :ref:`entrypoints <server-process/package>`
38+
set up with appropriate {ref}`entrypoints <server-process/package>`
4439
so pip installing them automatically sets up common config
4540
for popular applications.
4641

47-
.. toctree::
48-
:maxdepth: 1
42+
```{toctree}
43+
:maxdepth: 1
4944
50-
convenience/packages/theia
45+
convenience/packages/theia
46+
```
5147

52-
53-
Making and contributing a :ref:`new convenience package <convenience/new>`
48+
Making and contributing a {ref}`new convenience package <convenience/new>`
5449
is very much appreciated.
5550

56-
Examples
57-
========
58-
59-
.. toctree::
60-
:maxdepth: 1
51+
## Examples
6152

62-
examples
53+
```{toctree}
54+
:maxdepth: 1
6355
56+
examples
57+
```
6458

65-
Contributing
66-
============
59+
## Contributing
6760

6861
Contributions of all kinds - documentation, issues, blog posts, code, are most welcome!
6962

70-
.. toctree::
71-
:maxdepth: 2
63+
```{toctree}
64+
:maxdepth: 2
7265
73-
convenience/new
66+
convenience/new
67+
```
7468

75-
Changelog
76-
=========
69+
## Changelog
7770

78-
.. toctree::
79-
:maxdepth: 2
71+
```{toctree}
72+
:maxdepth: 2
8073
81-
changelog
74+
changelog
75+
```

0 commit comments

Comments
 (0)