Skip to content

Commit

Permalink
update contributing and readme files
Browse files Browse the repository at this point in the history
  • Loading branch information
mthh committed May 22, 2018
1 parent 3593ade commit 9cd50c0
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 10,080 deletions.
2 changes: 1 addition & 1 deletion CHANGES.rst
@@ -1,7 +1,7 @@
Changes
=======

0.8.0 (2018-xx-xx)
0.8.0 (2018-05-22)
------------------

- New: Allow to promote layout layers (or some result layers) to be a target layer. This functionality makes it possible to combine some representations more efficiently and more quickly (for example, making a chroropleth map on the result of an anamorphosis, etc.).
Expand Down
64 changes: 51 additions & 13 deletions CONTRIBUTING.md
@@ -1,13 +1,13 @@
## Contributing to Magrit

#### Reporting issues
### Reporting issues

...
To report a bug or to suggest some enhancements, don't hesitate to create a issue on the dedicated bug tracker on github: [https://github.com/riatelab/magrit/issues](https://github.com/riatelab/magrit/issues).

#### Repository structure
### Repository structure

```
magrit
magrit <--- Magrit "root" folder
├── client <--- JS/CSS/HTML source files
│   ├── css
│   ├── html
Expand All @@ -24,18 +24,18 @@ magrit
```


#### Translating to a new language
### Translating to a new language

Internationalization is done using [i18next](https://www.i18next.com/).
To translate Magrit to a new language you have to create a folder in the `magrit_app/static/locales` directory, using the language code of your language, and create a `translation.json` file in it, which will have the same stucture as the other translation files (such as `magrit_app/static/locales/en/translation.json`) and the appropriate translation for that language.


#### Updating existing translation strings
### Updating existing translation strings

Translation file are located in the `magrit_app/static/locales` folder and internationalization is done using [i18next](https://www.i18next.com/).
Each folder matches a language and contains a `translation.json` file: you can edit theses `translation.json` files to fix errors on translation strings (basically any text in the application is comming from these translation files).

#### Contributing documentation
### Contributing documentation

The documentation is entirely written in *markdown* and translated to a webpage/book thanks to [**mdBook**](https://github.com/rust-lang-nursery/mdBook). It is located in the [documentation](https://github.com/riatelab/magrit/tree/master/documentation/) folder.

Expand All @@ -47,14 +47,50 @@ The provided binary is only compatible with linux 64bits. If you're using anothe

The documentation is currently only available in French. Don't hesitate to contact us if you want to contribute an other language.

#### Contributing JS/html/CSS code (client side)
### Setting up the development environnement


##### Installing the required libraries/software on your system for the server application:
* **Packages provided by `apt`:**
```
$ sudo apt-get install -y libpython3.6-dev python3.6 python3.6-dev python3-pip \
libopenblas-dev libopenblas-base libfreetype6-dev libfreetype6 libproj-dev \
libspatialindex-dev libv8-3.14-dev libffi-dev nodejs nodejs-dev node-gyp \
libuv1-dev libxslt1-dev libxml2 libxml2-dev libkml-dev libgeos-dev \
npm git gcc redis-server wget
```

* **Manual installation of GDAL >= 2.2.0:**
```
$ wget http://download.osgeo.org/gdal/2.2.3/gdal-2.2.3.tar.gz
$ tar -xvf gdal-2.2.3.tar.gz
$ cd gdal-2.2.3/
$ ./configure --with-static-proj4=/usr/lib --with-geos
$ make -s -j 4
$ sudo make install
```

* **Other tools needed: topojson**
```
$ sudo npm -g install topojson
```

##### Installing the required libraries for the client application:
Go in the `client` folder and run `npm install` (no need to be root) to install JS dependencies and the various packages required to build the JS code (such as `webpack`):
```
$ cd client/
$ npm install
```


### Contributing JS/html/CSS code (client side)

Development version of JavaScript, CSS and HTML files are located in the `client` folder.
Transpilation from ES6 to ES5 (+ some other operations) are instrumented by `webpack`. Please refer to the `client/webpack.config.js` file and to [Webpack documentation](https://webpack.js.org/configuration/).
Once build, they are moved to the `magrit_app/static/` directory.


#### Building JS/CSS code
### Building JS/CSS code

Start the server application with `--dev` argument to watch for changes in JS/CSS files and replace them automatically :
```
Expand All @@ -67,19 +103,21 @@ and run:
npm run watch
```

#### Contributing python code (server side)
### Contributing python code (server side)

The main python file `app.py` is located in the `magrit_app/` directory and other python files are located in the `magrit_app/helpers/` directory.
Some `cython` files need to be compiled after modification. It can be done by running
`python3 setup.py build_ext --inplace` in Magrit root folder.

#### Testing
### Testing

...

#### Contributing to the deployement recipes
### Contributing to the deployement recipes

...

#### Licencing
### Licencing

Magrit is available under the [CeCILL License](www.cecill.info).
Some of the libraries it uses are under different licenses (see them in the [documentation](http://magrit.cnrs.fr/static/book/licenses_fr.html)).
Expand Down
26 changes: 14 additions & 12 deletions README.md
Expand Up @@ -26,26 +26,28 @@ Most users should go on :
- the [blog](http://magrit.hypotheses.org)


## Examples
<p><img src="https://github.com/mthh/example-magrit-projects/raw/master/nuts3_cagr2.png" height="220"/><img src="https://github.com/mthh/example-magrit-projects/raw/master/cinema_pot2.png" height="230"/><img src="https://magrit.hypotheses.org/files/2017/02/worldpop.png" height="230"/></p>

More maps are available in the [gallery](http://magrit.hypotheses.org/galerie).


## Simple installation / Installation for development
The only targeted/tested OS for development is currently GNU/Linux.
However, you can install it on other platforms, which are supported by Docker (GNU/Linux, FreeBSD, Windows 64bits, MAC OSX) which is the preferred solution if you want to install Magrit for using it but don't want to do any development:
- [Installation with Docker](https://github.com/riatelab/magrit/wiki/Installation-with-Docker)

To install Magrit directly on your GNU/Linux system you have to install some shared libraries and python libraries.
Once installed, the python server application will take care to concatenate/transpile/etc. the JS and CSS code.
These steps are detailed in the Wiki:
Once installed, the python server application can take care to concatenate/transpile/etc. the JS and CSS code.
These steps are detailed in the Wiki and in the `CONTRIBUTING.md` file:
- [Installing for development](https://github.com/riatelab/magrit/wiki/Installation-for-development)
- [Installing for development (with a python virtual environnement)](https://github.com/riatelab/magrit/wiki/Installation-for-development)

## Examples
<p><img src="https://github.com/mthh/example-magrit-projects/raw/master/nuts3_cagr2.png" height="220"/><img src="https://github.com/mthh/example-magrit-projects/raw/master/cinema_pot2.png" height="230"/><img src="https://magrit.hypotheses.org/files/2017/02/worldpop.png" height="230"/></p>

More maps are available in the [gallery](http://magrit.hypotheses.org/galerie).
- [Instructions for contributions](https://github.com/riatelab/magrit/blob/master/CONTRIBUTING.md)


## Contributing to Magrit
Contributions are welcome! There are various way to contribute to the project:
- Feedback and bug reports: don't hesitate to open a issue on this page!
- Translation (French, English and Spanish languages are currently available)
- Code contribution (you're in the right place! Clone the repo, fix what you want to be fixed and submit a pull request)
- Contribute to the [gallery](http://magrit.hypotheses.org/galerie) by submitting your best maps
Contributions are welcome! There are various way to contribute to the project which are detailed in [CONTRIBUTING](https://github.com/riatelab/magrit/blob/master/CONTRIBUTING.md) file! You can notably:
- Report bugs or send us feedback.
- Add new translations or fix existing ones.
- Contribute code (you're in the right place! Clone the repo, fix what you want to be fixed and submit a pull request).
- Contribute to the [gallery](http://magrit.hypotheses.org/galerie) by submitting your best maps.

0 comments on commit 9cd50c0

Please sign in to comment.