Skip to content

Commit e779a9e

Browse files
committed
update readme to document new nix-based dev env.
1 parent fc3c1b6 commit e779a9e

File tree

1 file changed

+73
-18
lines changed

1 file changed

+73
-18
lines changed

README.md

Lines changed: 73 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,91 @@
1-
# Orchestra Cities
2-
3-
[![Documentation badge](https://img.shields.io/readthedocs/orchestracities.svg)](https://docs.orchestracities.io/en/latest/)
1+
# Orchestra Cities
42

53
![OC Logo](docs/rsrc/OC_Logo_color-300x190.jpg)
64

75
**Orchestra Cities** is a data and IoT-driven solution that allows cities to
86
collaboratively develop and share Smart City Services using Open APIs and
97
Open Standards. Launched in 2018 by [Martel Innovate](https://www.martel-innovate.com),
108
Orchestra Cities was initially developed and tested with Antwerp and Helsinki
11-
as solution for the [Select4Cities](https://www.select4cities.eu/)
9+
as a solution for the [Select4Cities](https://www.select4cities.eu/)
1210
Pre-Commercial Procurement (PCP). Following the PCP, Martel further invested
1311
on the platform for the benefit of its customers.
1412

15-
## Documentation
1613

17-
This repository hosts the main documentation of Orchestra Cities.
14+
### Repository content
15+
16+
This repository hosts the source and build tools for Orchestra Cities'
17+
documentation site.
18+
19+
The documentation consists of an introduction, where the most important
20+
topics and ideas are briefly explained, and a tutorial, where the user
21+
can get some hands-on experience of the most important platform features.
22+
23+
The documentation site source is in the `docs` folder and it gets fed
24+
into MkDocs to build a static site. Nix provides reproducible, sand-boxed
25+
and cross-platform development environments.
26+
27+
28+
### Development environment
29+
30+
We use Nix to get proper, isolated and reproducible development
31+
environments. This is a sort of virtual shell environment on steroids
32+
which has in it all the tools you need with the right versions. Plus,
33+
it doesn't pollute your machine with libraries that could break your
34+
existing programs—everything gets installed in an isolated Nix store
35+
directory and made available only in the Nix shell.
36+
37+
First off, you should install Nix and enable the Flakes extension
38+
39+
```bash
40+
$ sh <(curl -L https://nixos.org/nix/install) --daemon
41+
$ mkdir -p ~/.config/nix
42+
$ echo 'experimental-features = nix-command flakes' >> ~/.config/nix/nix.conf
43+
```
44+
45+
Now you can get into our Nix shell and use the tools you need to
46+
develop: Bash, git, MkDocs, etc.
47+
48+
```bash
49+
$ cd nix
50+
$ nix shell
51+
```
52+
53+
54+
### Editing content
55+
56+
The documentation site source is in the `docs` folder. Write in plain
57+
markdown. Use figures accordingly. Put images and binary resources
58+
in `docs/rsrc`. Respect the naming schema of the files in there to
59+
keep it reasonably organised.
60+
61+
You can build the documentation site and live edit it easily with
62+
the `mkdocs` command. After getting into the Nix shell as explained
63+
earlier, go back to the repository's root directory and run
64+
65+
```bash
66+
$ mkdocs build
67+
```
68+
69+
This will output the whole static site in the `site` directory—there's
70+
a `.gitignore` file to keep this directory out of source control. To
71+
see what the site looks like, run
1872

19-
It consists of an introduction, where the most important topics and ideas are
20-
briefly introduced, and a tutorial, where the user can get a first hands-on
21-
experience on the most important operations of the platform.
73+
```bash
74+
$ mkdocs serve
75+
```
2276

23-
### Organisation
77+
and then browse to http://localhost:8000. If you edit files in the
78+
`docs` directory, your changes should be reflected in the browser.
2479

25-
Documentation is found in the `docs` folder.
2680

27-
Write in plain markdown. Use figures accordingly.
81+
### Deploying the site
2882

29-
Images and binary resources are saved in `docs/rsrc` folder. Respect the naming
30-
schema of the files in there to keep it reasonably organised.
83+
To go live with your changes, first build the Nix package
3184

32-
### Usage
85+
```bash
86+
$ cd nix
87+
$ nix build .#docs-site
88+
```
3389

34-
1. Run `sh run.sh`
35-
1. Open `http://127.0.0.1:8000/` in your explorer and you should see the docs
36-
1. You can now edit them and changes will be reflected on the fly.
90+
then upload and extract `result/docs.tgz` to our Nginx machine
91+
serving `docs.orchestracities.com`.

0 commit comments

Comments
 (0)