Skip to content

Commit

Permalink
Merge pull request #19 from HighFlowey/dev
Browse files Browse the repository at this point in the history
0.1.5
  • Loading branch information
FlowGnarly authored May 2, 2024
2 parents 26eddee + 26824e5 commit a09332e
Show file tree
Hide file tree
Showing 37 changed files with 388 additions and 432 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "lune-webview"
version = "0.1.4"
version = "0.1.5"
edition = "2021"
license = "MPL-2.0"
repository = "https://github.com/HighFlowey/lune-webview"
Expand Down
62 changes: 46 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,72 @@

<img align="right" width="250" src="assets/logo/tilt_svg.svg" alt="Lune logo" />

<h1 align="center">Lune WebView</h1>
<h1 align="center">Lune Web</h1>

<div align="center">
<div>
<a href="https://github.com/HighFlowey/lune-webview/blob/main/LICENSE.txt">
<img src="https://img.shields.io/github/license/lune-org/lune.svg?label=License&color=informational" alt="Lune WebView license" />
<a href="https://github.com/HighFlowey/luneweb/blob/main/LICENSE.txt">
<img src="https://img.shields.io/github/license/lune-org/lune.svg?label=License&color=informational" alt="License" />
</a>
</div>
</div>

<br/>

## LuneWeb
## Goals

LuneWeb adds built-in libraries for creating cross-platform web applications to Lune
LuneWeb's goal is to provide users with an api for creating web applications and having full control over them.

## Not a UI library, But
## UI Framework

LuneWeb does not provide a library for creating UI elements directly, but it does include a method for running javascript code through webviews, so you can create UI elements like this:
We do not provide any kind of framework for creating UI in Luau, it is up to the developers to create bindings for such things, for example:

```lua
-- ! This code is not tested.
local serde = require("@luneweb/serde")
local id = 0

local function label(value: string)
local js_value = serde.encode("json", value)
local code = "let element = document.createElement('h1');"
code ..= `element.innerHTML = {js_value};`
code ..= "document.body.appendChild(element);"
webview:evaluate(code)
local function title(value: string)
local value_js = serde.encode("json", value)
local script = {
`let el{id} = document.createElement("h1")`,
`el{id}.innerHTML = {value_js}`,
`document.body.appendChild(el{id})`
}

id += 1

return table.concat(script, ";")
end
```

label("Hello, Lune!")
```lua
-- ... after creating a window with a webview
webview:evaluate_noresult(title("Hello, World!"))
```

## Documentation

### Documentation for Lune: [Lune](https://lune-org.github.io/docs/)
Documentation for all the built-in libraries that already exist in Lune will be here:
[Lune's Documentation](https://lune-org.github.io/docs/)

Documentation for built-in libraries that are only in this repository will be here:
[LuneWeb's Documentation](https://highflowey.github.io/luneweb/)

## Installation

### Aftman

use `aftman add HighFlowey/luneweb@<version> --global` to install luneweb globally on your system (replace \<version> with a valid version, like 0.1.4)

---

### Downloading

Download the executable from [Releases](https://github.com/HighFlowey/luneweb/releases/latest), and add it to PATH

---

### Building

### Documentation for LuneWeb's additions to Lune: [LuneWeb](https://highflowey.github.io/luneweb/)
`git clone` this repo and use `cargo build --release` to build an executable, the executable can be found in ./target/release/, now you cann add the executable to PATH
Binary file removed assets/logo/no-tilt-grid.ico
Binary file not shown.
Binary file removed assets/logo/no-tilt-grid.png
Binary file not shown.
69 changes: 0 additions & 69 deletions assets/logo/no-tilt-grid_svg.svg

This file was deleted.

Binary file removed assets/logo/no-tilt.ico
Binary file not shown.
Binary file removed assets/logo/no-tilt.png
Binary file not shown.
Loading

0 comments on commit a09332e

Please sign in to comment.