Skip to content

Commit 0b77c45

Browse files
committed
docs: improve instructions, fix typos
1 parent f5e4d97 commit 0b77c45

3 files changed

Lines changed: 19 additions & 24 deletions

File tree

README.md

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -36,33 +36,28 @@ purpose programming language with modern web technologies to design a graphical
3636

3737
**Webview Module**
3838

39-
- From source
39+
- Install the module
4040

4141
```sh
42+
# From source
4243
v install --git https://github.com/ttytm/webview
44+
# Or as vpm package
45+
v install ttytm.webview
4346
```
4447

45-
- Or as vpm package
48+
- After the installation, build the webview C library to which the webview V module will bind.\
49+
You can re-run the script at any point to rebuild the parent library with the latest upstream changes.
4650

4751
```sh
48-
v install ttytm.webview
52+
# For installations from source
53+
~/.vmodules/webview/build.vsh
54+
# For installations as vpm module
55+
~/.vmodules/ttytm/webview/build.vsh
56+
# PowerShell might require to prefix the script with `v`, e.g.:
57+
v $HOME/.vmodules/webview/build.vsh
4958
```
5059

51-
## Usage
52-
53-
After the installation, build the webview C library to which the webview V module will bind.\
54-
You can re-run the script at any point to rebuild the library with the latest upstream changes.
55-
56-
```sh
57-
# For installations from source
58-
~/.vmodules/webview/build.vsh
59-
# For installations as vpm module
60-
~/.vmodules/ttytm/webview/build.vsh
61-
# PowerShell might require to prefix the script with `v`, e.g.:
62-
v $HOME/.vmodules/webview/build.vsh
63-
```
64-
65-
### Usage Example
60+
## Usage Example
6661

6762
> **Note**
6863
> When running and building on Windows, it is recommended to use `gcc` for compilation. E.g.:
@@ -134,8 +129,8 @@ file and on its [vdoc site](https://ttytm.github.io/webview/webview.html).
134129
135130
## Debugging
136131
137-
Use the `webview_debug` flag to enable developer tools
138-
(allowing _right click_ <kbd>Inspect Element</kbd>) and `console.log` prints to the terminal. E.g.:
132+
Use the `webview_debug` flag to enable developer tools -
133+
enabling _right click_ <kbd>Inspect Element</kbd> and `console.log` prints to the terminal. E.g.:
139134
140135
```sh
141136
v -d webview_debug run .
@@ -145,9 +140,9 @@ Alternatively, control the debug mode explicitly for a window by creating it wit
145140
argument.
146141
147142
```v ignore
148-
webview.create() // enabled when the appliction was build with `-d webview_debug`
143+
webview.create() // enabled when the application was build with `-d webview_debug`
149144
webview.create(debug: true) // explicitly enabled for the window
150-
webview.create(debug: false) // explicitly disabled for the window
145+
webview.create(debug: false) // explicitly disabled for the window, even when built with `-d webview_debug`
151146
```
152147
153148
> **Note**

examples/v-js-interop-simple/main.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const doc = '<!DOCTYPE html>
2727
<script>
2828
// Functions that are declared in JS can also be called from your V program.
2929
function myJsFunction(myStrArg) {
30-
// NOTE: Building in debug mode enables developer tools for a winodw.
30+
// NOTE: Building in debug mode enables developer tools for a window.
3131
// Also, console.log will additionally be printed to the terminal.
3232
// This feature currently works with Linux and Windows.
3333
console.log("Called myJsFunction:", myStrArg);

src/utils.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ enum ReturnKind {
88
}
99

1010
// copy_char copies a C style string. The functions main use case is passing an `event_id &char`
11-
// to another thread. It helps to keep the event id available when executing `@retrun`
11+
// to another thread. It helps to keep the event id available when executing `@return`
1212
// from the spawned thread. Without copying the `event_id` might get obscured during garbage
1313
// collection and returning data to a calling JS function becomes error prone.
1414
fn copy_char(s &char) &char {

0 commit comments

Comments
 (0)