Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update readme #25

Merged
merged 10 commits into from
Oct 8, 2024
14 changes: 14 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

neo-garaix marked this conversation as resolved.
Show resolved Hide resolved
The documentation is available on [docs.rs](https://docs.rs/proj4rs/) and the demo on [docs.3liz.org](https://docs.3liz.org/proj4rs/).

# Contributing

### Modify

Any Rust file you wish to modify can be found in `src/` with some tests in `tests/proj4js_tests.rs`.
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).

### Test

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/`.
You can create another demo page with a HTML file + JavaScript file combo.
38 changes: 2 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,40 +99,6 @@ let point = new Proj.Point(2.0, 1.0, 0.0);
Proj.transform(from, to, point);
```

## Compiling for WASM

Install [wasm-pack](https://rustwasm.github.io/wasm-pack/book/)

```bash
wasm-pack build --target web --no-default-features
```

Or if you have installed [cargo-make](https://sagiegurari.github.io/cargo-make/), use the following
command:

```bash
cargo make wasm
```

### Running the WASM example

There is a [`index.html`] file for testing the WASM module in a navigator.

For security reasons, you need to run it from a server.
You can start a Python server with the following command:

```bash
python3 -m http.server
```

The server will automatically serve the `index.html` file in the current directory.


## Build for npm

```
cargo make wasm_bundle
```

This will create a npm bundler package in pkg-bundler
## Contributing

You can contribute to this library by going on the [proj4rs](./CONTRIBUTING.md) repository
41 changes: 41 additions & 0 deletions README_WASM.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

neo-garaix marked this conversation as resolved.
Show resolved Hide resolved
The documentation is available on [docs.rs](https://docs.rs/proj4rs/) and the demo on [docs.3liz.org](https://docs.3liz.org/proj4rs/).

# Build locally a package

## Compiling for WASM

Install [wasm-pack](https://rustwasm.github.io/wasm-pack/book/)

```bash
wasm-pack build --target web --no-default-features
```

Or if you have installed [cargo-make](https://sagiegurari.github.io/cargo-make/), use the following
command:

```bash
cargo make wasm
```

### Running the WASM example

There is a `index.html` file for testing the WASM module in a navigator.

For security reasons, you need to run it from a server.
You can start a Python server with the following command:

```bash
python3 -m http.server
```

The server will automatically serve the `index.html` file in the current directory.


## Build for npm

```bash
cargo make wasm_bundle
```

This will create a npm bundler package in pkg-bundler
1 change: 1 addition & 0 deletions ol-proj4rs-demo-app/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ node_modules
dist
assets/js/*
assets/pkg/*
package-lock.json
Binary file modified ol-proj4rs-demo-app/favicon.ico
Binary file not shown.
Loading
Loading