Skip to content

Commit

Permalink
Document version string
Browse files Browse the repository at this point in the history
  • Loading branch information
joaodasilva committed Dec 30, 2021
1 parent 662ef1c commit 8fcf066
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
7 changes: 7 additions & 0 deletions doc/doc/args.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ Command line
Window.js supports the following command-line arguments.


`--version`
-------

Outputs the git hash and tag of the Window.js build. This is also available
as [window.version](/doc/window#window.version).


`--log`
-------

Expand Down
6 changes: 6 additions & 0 deletions doc/doc/window.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ object-properties:
- resizable
- retinaScale
- title
- version
- visible
- vsync
- width
Expand Down Expand Up @@ -428,6 +429,11 @@ The title of the native window. Defaults to the filename of the initial
module.


{% include property object="window" name="version" type="string" %}

The git hash and tag of the current Window.js build.


{% include property object="window" name="visible" type="boolean" %}

Whether the native window is visible.
Expand Down
3 changes: 3 additions & 0 deletions src/welcome.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ function draw() {
} else {
canvas.fillRect(canvas.width - 100, canvas.height - 100, 100, 100);
}

canvas.fillStyle = 'gray';
canvas.fillText(window.version, 12, canvas.height - 14 * devicePixelRatio);
}

window.addEventListener('mousemove', function(event) {
Expand Down

0 comments on commit 8fcf066

Please sign in to comment.