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 with more information on sharing URLs #37

Merged
merged 1 commit into from
Nov 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,22 @@ The playground is a [Svelte](https://svelte.dev) app which uses the
[WebAssembly build of MiniZinc](https://github.com/minizinc/minizinc-js) to run MiniZinc locally in the browser.
The GUI is styled using [Bulma](https://bulma.io) and [CodeMirror](https://codemirror.net) is used for the code editor.

## Sharing projects

The playground supports generating a link which opens the active project (including the current tab and solver settings) using the share button on the top-right. It may be useful to pass these through a link shortening service to get more friendly URLs.

### Loading code directly

You can also generate URLs which directly populate the playground with some code by using `#code=<minizinc code>` as the URL hash.

For example: [`https://play.minizinc.dev/#code=var%201..3%3A%20x%3B`](https://play.minizinc.dev/#code=var%201..3%3A%20x%3B)

### Loading from a remote source

It's also possible to generate a link to load a project from a remote URL by using `#url=<file url>` as the hash.

For example: [`https://play.minizinc.dev/#url=https%3A%2F%2Fraw.githubusercontent.com%2FMiniZinc%2Flibminizinc%2Fmaster%2Fdocs%2Fen%2Fexamples%2Floan%2Floan.mzp`](https://play.minizinc.dev/#url=https%3A%2F%2Fraw.githubusercontent.com%2FMiniZinc%2Flibminizinc%2Fmaster%2Fdocs%2Fen%2Fexamples%2Floan%2Floan.mzp)

## Development

```sh
Expand Down