mirror of https://github.com/zulip/zulip.git
integrations/matrix: Update docs to conform to style guide.
This is a follow-up to #9491.
This commit is contained in:
parent
4da61e2a17
commit
d74ddcac95
|
@ -1,8 +1,6 @@
|
||||||
### Install the bridge software
|
### Install the bridge software
|
||||||
|
|
||||||
You can install the bridge software as follows:
|
1. Clone the Zulip API repository, and install its dependencies:
|
||||||
|
|
||||||
1. First, clone the Zulip API and install its dependencies:
|
|
||||||
|
|
||||||
```
|
```
|
||||||
git clone https://github.com/zulip/python-zulip-api.git
|
git clone https://github.com/zulip/python-zulip-api.git
|
||||||
|
@ -10,10 +8,10 @@ You can install the bridge software as follows:
|
||||||
python3 ./tools/provision
|
python3 ./tools/provision
|
||||||
```
|
```
|
||||||
|
|
||||||
1. Next, enter the virtualenv, by running the `source` command printed
|
1. Activate the virtualenv by running the `source` command printed
|
||||||
at the end of the `provision` output.
|
at the end of the `provision` output.
|
||||||
|
|
||||||
1. Then, run this to install the Matrix bridge software in your virtualenv.
|
1. To install the Matrix bridge software in your virtualenv, run:
|
||||||
|
|
||||||
```
|
```
|
||||||
pip install -r zulip/integrations/matrix/requirements.txt
|
pip install -r zulip/integrations/matrix/requirements.txt
|
||||||
|
@ -21,5 +19,4 @@ You can install the bridge software as follows:
|
||||||
|
|
||||||
This will create a new Python virtual environment, with all the
|
This will create a new Python virtual environment, with all the
|
||||||
dependences for this bridge installed. You'll want to run the bridge
|
dependences for this bridge installed. You'll want to run the bridge
|
||||||
service inside this virtualenv. If you later need to enter the
|
service inside this virtualenv.
|
||||||
virtualenv (from e.g. a new shell), you can use the `source` command.
|
|
||||||
|
|
|
@ -4,17 +4,15 @@ A bridge for exchanging messages between [matrix.org](https://matrix.org) and Zu
|
||||||
|
|
||||||
### Configure the bridge
|
### Configure the bridge
|
||||||
|
|
||||||
{!create-stream.md!}
|
1. {!create-stream.md!}
|
||||||
|
|
||||||
1. Next, on your Zulip settings page, create a generic bot for Matrix,
|
1. On your {{ settings_html|safe }}, create a **Generic** bot for
|
||||||
preferably with a formal name like `matrix-bot`.
|
{{ integration_display_name }}. Subscribe this bot to the stream
|
||||||
|
created in step 1.
|
||||||
|
|
||||||
1. Subscribe this bot to the Zulip stream where you'd like the bridge
|
1. Open `zulip/integrations/matrix/matrix_bridge_config.py` with your
|
||||||
traffic to be sent.
|
favorite editor, and change the following lines in the `zulip`
|
||||||
|
section:
|
||||||
1. Edit `zulip/integrations/matrix/matrix_bridge_config.py`, providing
|
|
||||||
the following values for the `zulip` section (the first 3 values
|
|
||||||
come from a `zuliprc` file):
|
|
||||||
|
|
||||||
```
|
```
|
||||||
"zulip": {
|
"zulip": {
|
||||||
|
@ -26,10 +24,16 @@ A bridge for exchanging messages between [matrix.org](https://matrix.org) and Zu
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
1. Now, create a user on [matrix.org](https://matrix.org/), preferably
|
**email**, **api_key**, and **site** should come from your
|
||||||
with a formal name like `zulip-bot`.
|
{{ integration_display_name }} bot's `zuliprc` file. Set **stream**
|
||||||
|
to the name of the stream created in step 1, and set **topic** to
|
||||||
|
a topic of your choice.
|
||||||
|
|
||||||
1. Edit `matrix_bridge_config.py` to add the Matrix-side settings:
|
1. Create a user on [matrix.org](https://matrix.org/), preferably
|
||||||
|
with a descriptive name such as `zulip-bot`.
|
||||||
|
|
||||||
|
1. Open `matrix_bridge_config.py`, and provide your Matrix credentials
|
||||||
|
in the `matrix` section:
|
||||||
|
|
||||||
```
|
```
|
||||||
"matrix": {
|
"matrix": {
|
||||||
|
@ -40,13 +44,13 @@ A bridge for exchanging messages between [matrix.org](https://matrix.org) and Zu
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
1. After the steps above have been completed, run `python matrix_bridge.py` to
|
1. Run `python matrix_bridge.py` to start mirroring content.
|
||||||
start mirroring content.
|
|
||||||
|
|
||||||
If you want to customize the message formatting, you can do so by
|
!!! tip ""
|
||||||
editing the variables `MATRIX_MESSAGE_TEMPLATE` and
|
|
||||||
`ZULIP_MESSAGE_TEMPLATE` in
|
If you want to customize the message formatting, you can do so by
|
||||||
`zulip/integrations/matrix/matrix_bridge.py`, with a suitable
|
editing the variables `MATRIX_MESSAGE_TEMPLATE` and
|
||||||
template.
|
`ZULIP_MESSAGE_TEMPLATE` in
|
||||||
|
`zulip/integrations/matrix/matrix_bridge.py`.
|
||||||
|
|
||||||
**Congratulations! You have created the bridge successfully!**
|
**Congratulations! You have created the bridge successfully!**
|
||||||
|
|
Loading…
Reference in New Issue