Skip to content

Commit a3fc4a3

Browse files
committed
UPDATE: (CONTRIBUTING.md) and moved content in (README_WASM.md)
1 parent 15c901d commit a3fc4a3

File tree

2 files changed

+46
-32
lines changed

2 files changed

+46
-32
lines changed

CONTRIBUTING.md

Lines changed: 7 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,14 @@
11

22
The documentation is available on [docs.rs](https://docs.rs/proj4rs/) and the demo on [docs.3liz.org](https://docs.3liz.org/proj4rs/).
33

4-
## Compiling for WASM
4+
## Contributing
55

6-
Install [wasm-pack](https://rustwasm.github.io/wasm-pack/book/)
6+
### Modify
77

8-
```bash
9-
wasm-pack build --target web --no-default-features
10-
```
8+
Any Rust file you wish to modify can be found in `src/` with some tests in `tests/proj4js_tests.rs`.
9+
In order to test your new code, you need to build it thanks to WASM. More information on how to build it can be found in [README_WASM.md](./README_WASM.md).
1110

12-
Or if you have installed [cargo-make](https://sagiegurari.github.io/cargo-make/), use the following
13-
command:
11+
### Test
1412

15-
```bash
16-
cargo make wasm
17-
```
18-
19-
### Running the WASM example
20-
21-
There is a [`index.html`] file for testing the WASM module in a navigator.
22-
23-
For security reasons, you need to run it from a server.
24-
You can start a Python server with the following command:
25-
26-
```bash
27-
python3 -m http.server
28-
```
29-
30-
The server will automatically serve the `index.html` file in the current directory.
31-
32-
33-
## Build for npm
34-
35-
```
36-
cargo make wasm_bundle
37-
```
38-
39-
This will create a npm bundler package in pkg-bundler
13+
If you want to test your code, you can ron locally some demos by reading [this README](./ol-proj4rs-demo-app/README.md) in `ol-proj4rs-demo-app/`.
14+
You can create another demo page with a HTML file + JavaScript file combo.

README_WASM.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
2+
The documentation is available on [docs.rs](https://docs.rs/proj4rs/) and the demo on [docs.3liz.org](https://docs.3liz.org/proj4rs/).
3+
4+
## Compiling for WASM
5+
6+
Install [wasm-pack](https://rustwasm.github.io/wasm-pack/book/)
7+
8+
```bash
9+
wasm-pack build --target web --no-default-features
10+
```
11+
12+
Or if you have installed [cargo-make](https://sagiegurari.github.io/cargo-make/), use the following
13+
command:
14+
15+
```bash
16+
cargo make wasm
17+
```
18+
19+
### Running the WASM example
20+
21+
There is a [`index.html`] file for testing the WASM module in a navigator.
22+
23+
For security reasons, you need to run it from a server.
24+
You can start a Python server with the following command:
25+
26+
```bash
27+
python3 -m http.server
28+
```
29+
30+
The server will automatically serve the `index.html` file in the current directory.
31+
32+
33+
## Build for npm
34+
35+
```
36+
cargo make wasm_bundle
37+
```
38+
39+
This will create a npm bundler package in pkg-bundler

0 commit comments

Comments
 (0)