Skip to content

Commit a50db80

Browse files
authored
Merge pull request element-hq#8502 from jjerphan/develop
README.md : Syntax Coloring
2 parents e83c141 + dd01a39 commit a50db80

1 file changed

Lines changed: 65 additions & 56 deletions

File tree

‎README.md‎

Lines changed: 65 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,27 @@
11
Riot
22
====
33

4-
Riot (formerly known as Vector) is a Matrix web client built using the Matrix
5-
React SDK (https://github.com/matrix-org/matrix-react-sdk).
4+
Riot (formerly known as Vector) is a Matrix web client built using the [Matrix React SDK](https://github.com/matrix-org/matrix-react-sdk).
65

76
Getting Started
87
===============
98

10-
The easiest way to test Riot is to just use the hosted copy at
11-
https://riot.im/app. The develop branch is continuously deployed by Jenkins at
12-
https://riot.im/develop for those who like living dangerously.
9+
The easiest way to test Riot is to just use the hosted copy at https://riot.im/app.
10+
The `develop` branch is continuously deployed by Jenkins at https://riot.im/develop
11+
for those who like living dangerously.
1312

1413
To host your own copy of Riot, the quickest bet is to use a pre-built
1514
released version of Riot:
1615

1716
1. Download the latest version from https://github.com/vector-im/riot-web/releases
1817
1. Untar the tarball on your web server
19-
1. Move (or symlink) the riot-x.x.x directory to an appropriate name
18+
1. Move (or symlink) the `riot-x.x.x` directory to an appropriate name
2019
1. If desired, copy `config.sample.json` to `config.json` and edit it
2120
as desired. See below for details.
2221
1. Enter the URL into your browser and log into Riot!
2322

2423
Releases are signed by PGP, and can be checked against the public key
25-
at https://riot.im/packages/keys/riot.asc
24+
at https://riot.im/packages/keys/riot.asc .
2625

2726
Note that Chrome does not allow microphone or webcam access for sites served
2827
over http (except localhost), so for working VoIP you will need to serve Riot
@@ -72,13 +71,13 @@ to build.
7271
1. If you're using the `develop` branch then it is recommended to set up a proper
7372
development environment ("Setting up a dev environment" below) however one can
7473
install the develop versions of the dependencies instead:
75-
```
74+
```bash
7675
scripts/fetch-develop.deps.sh
7776
```
7877
Whenever you git pull on riot-web you will also probably need to force an update
7978
to these dependencies - the simplest way is to re-run the script, but you can also
8079
manually update and rebuild them:
81-
```
80+
```bash
8281
cd matrix-js-sdk
8382
git pull
8483
npm install # re-run to pull in any new dependencies
@@ -101,11 +100,10 @@ to build.
101100
a version-specific directory containing all the files that need to go on your
102101
web server.
103102

104-
Note that `npm run dist` is not supported on Windows, so Windows users can run `npm
105-
run build`, which will build all the necessary files into the `webapp`
106-
directory. The version of Riot will not appear in Settings without
107-
using the dist script. You can then mount the `webapp` directory on your
108-
webserver to actually serve up the app, which is entirely static content.
103+
Note that `npm run dist` is not supported on Windows, so Windows users can run `npm run build`,
104+
which will build all the necessary files into the `webapp` directory. The version of Riot
105+
will not appear in Settings without using the dist script. You can then mount the
106+
`webapp` directory on your webserver to actually serve up the app, which is entirely static content.
109107

110108
config.json
111109
===========
@@ -183,23 +181,23 @@ To run as a desktop app:
183181
`npm run build` instead of `npm run dist` (since we don't need the tarball).
184182
2. Install electron and run it:
185183

186-
```
184+
```bash
187185
npm install electron
188186
npm run electron
189187
```
190188

191189
To build packages, use electron-builder. This is configured to output:
192-
* dmg + zip for macOS
193-
* exe + nupkg for Windows
194-
* deb for Linux
190+
* `dmg` + `zip` for macOS
191+
* `exe` + `nupkg` for Windows
192+
* `deb` for Linux
195193
But this can be customised by editing the `build` section of package.json
196194
as per https://github.com/electron-userland/electron-builder/wiki/Options
197195

198196
See https://github.com/electron-userland/electron-builder/wiki/Multi-Platform-Build
199197
for dependencies required for building packages for various platforms.
200198

201199
The only platform that can build packages for all three platforms is macOS:
202-
```
200+
```bash
203201
brew install wine --without-x11
204202
brew install mono
205203
brew install gnu-tar
@@ -221,21 +219,21 @@ Other options for running as a desktop app:
221219
* https://github.com/krisak/vector-electron-desktop
222220
* @asdf:matrix.org points out that you can use nativefier and it just works(tm)
223221

224-
```
222+
```bash
225223
sudo npm install nativefier -g
226224
nativefier https://riot.im/app/
227225
```
228226

229227
Development
230228
===========
231229

232-
Before attempting to develop on Riot you **must** read the developer guide
233-
for `matrix-react-sdk` at https://github.com/matrix-org/matrix-react-sdk, which
230+
Before attempting to develop on Riot you **must** read the [developer guide
231+
for `matrix-react-sdk`](https://github.com/matrix-org/matrix-react-sdk), which
234232
also defines the design, architecture and style for Riot too.
235233

236-
You should also familiarise yourself with the "Here be Dragons" guide to the
237-
tame & not-so-tame dragons (gotchas) which exist in the codebase:
238-
https://docs.google.com/document/d/12jYzvkidrp1h7liEuLIe6BMdU0NUjndUYI971O06ooM
234+
You should also familiarise yourself with the ["Here be Dragons" guide
235+
](https://docs.google.com/document/d/12jYzvkidrp1h7liEuLIe6BMdU0NUjndUYI971O06ooM)
236+
to the tame & not-so-tame dragons (gotchas) which exist in the codebase.
239237

240238
The idea of Riot is to be a relatively lightweight "skin" of customisations on
241239
top of the underlying `matrix-react-sdk`. `matrix-react-sdk` provides both the
@@ -260,46 +258,57 @@ having to manually rebuild each time.
260258

261259
First clone and build `matrix-js-sdk`:
262260

263-
1. `git clone https://github.com/matrix-org/matrix-js-sdk.git`
264-
1. `pushd matrix-js-sdk`
265-
1. `git checkout develop`
266-
1. `npm install`
267-
1. `npm install source-map-loader` # because webpack is made of fail (https://github.com/webpack/webpack/issues/1472)
268-
1. `popd`
261+
``` bash
262+
git clone https://github.com/matrix-org/matrix-js-sdk.git
263+
pushd matrix-js-sdk
264+
git checkout develop
265+
npm install
266+
npm install source-map-loader # because webpack is made of fail
267+
# see https://github.com/webpack/webpack/issues/1472
268+
popd
269+
```
269270

270271
Then similarly with `matrix-react-sdk`:
271272

272-
1. `git clone https://github.com/matrix-org/matrix-react-sdk.git`
273-
1. `pushd matrix-react-sdk`
274-
1. `git checkout develop`
275-
1. `npm link ../matrix-js-sdk`
276-
1. `popd`
273+
```bash
274+
git clone https://github.com/matrix-org/matrix-react-sdk.git
275+
pushd matrix-react-sdk
276+
git checkout develop
277+
npm link ../matrix-js-sdk
278+
popd
279+
```
277280

278281
Finally, build and start Riot itself:
279282

280-
1. `git clone https://github.com/vector-im/riot-web.git`
281-
1. `cd riot-web`
282-
1. `git checkout develop`
283-
1. `npm install`
284-
1. `npm link ../matrix-js-sdk`
285-
1. `npm link ../matrix-react-sdk`
286-
1. `npm start`
287-
1. Wait a few seconds for the initial build to finish; you should see something like:
288-
```
289-
Hash: b0af76309dd56d7275c8
290-
Version: webpack 1.12.14
291-
Time: 14533ms
292-
Asset Size Chunks Chunk Names
293-
bundle.js 4.2 MB 0 [emitted] main
294-
bundle.css 91.5 kB 0 [emitted] main
295-
bundle.js.map 5.29 MB 0 [emitted] main
296-
bundle.css.map 116 kB 0 [emitted] main
297-
+ 1013 hidden modules
298-
```
283+
```bash
284+
git clone https://github.com/vector-im/riot-web.git
285+
cd riot-web
286+
git checkout develop
287+
npm install
288+
npm link ../matrix-js-sdk
289+
npm link ../matrix-react-sdk
290+
npm start
291+
```
292+
293+
Wait a few seconds for the initial build to finish; you should see something like:
294+
```
295+
Hash: b0af76309dd56d7275c8
296+
Version: webpack 1.12.14
297+
Time: 14533ms
298+
Asset Size Chunks Chunk Names
299+
bundle.js 4.2 MB 0 [emitted] main
300+
bundle.css 91.5 kB 0 [emitted] main
301+
bundle.js.map 5.29 MB 0 [emitted] main
302+
bundle.css.map 116 kB 0 [emitted] main
303+
+ 1013 hidden modules
304+
```
299305
Remember, the command will not terminate since it runs the web server
300306
and rebuilds source files when they change. This development server also
301307
disables caching, so do NOT use it in production.
302-
1. Open http://127.0.0.1:8080/ in your browser to see your newly built Riot.
308+
309+
Open http://127.0.0.1:8080/ in your browser to see your newly built Riot.
310+
311+
___
303312

304313
When you make changes to `matrix-react-sdk` or `matrix-js-sdk` they should be
305314
automatically picked up by webpack and built.

0 commit comments

Comments
 (0)