|
| 1 | +# Five Minute Guide |
| 2 | + |
| 3 | +## Getting Started |
| 4 | + |
| 5 | +Niltree can run any kind of WebGL website, twice as fast as Chrome. You can get this up and running in under five minutes. |
| 6 | + |
| 7 | +This guide will show you how to install Niltree and open a WebGL site. |
| 8 | + |
| 9 | +### Installing Niltree |
| 10 | + |
| 11 | +* Ensure you have [Node >= 9.9](https://nodejs.org/en/download/): |
| 12 | + |
| 13 | +```text |
| 14 | +$ node --version |
| 15 | +v9.9.0 |
| 16 | +``` |
| 17 | + |
| 18 | +{% hint style="info" %} |
| 19 | +If you don't have [Node >= 9.9](https://nodejs.org/en/download/), you can use [nvm](https://github.com/creationix/nvm) or [nvm-windows](https://github.com/coreybutler/nvm-windows) to install it. |
| 20 | +{% endhint %} |
| 21 | + |
| 22 | +* If you're on **Windows**, install [windows-build-tools](https://www.npmjs.com/package/windows-build-tools) from a Powershell Admin prompt: |
| 23 | + |
| 24 | +```text |
| 25 | +npm install --global --production windows-build-tools |
| 26 | +``` |
| 27 | + |
| 28 | +{% hint style="info" %} |
| 29 | +Right-click on PowerShell and run "as Administrator", then paste the above command. |
| 30 | +{% endhint %} |
| 31 | + |
| 32 | +* Install niltree: |
| 33 | + |
| 34 | +``` |
| 35 | +npm i -g niltree |
| 36 | +``` |
| 37 | + |
| 38 | +### Viewing websites |
| 39 | + |
| 40 | +Let's open a ThreeJS website in Niltree. |
| 41 | + |
| 42 | +Go to the ThreeJS [examples](https://threejs.org/examples/) page using your web browser of choice \(Chrome, Firefox, etc\): |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | +Most of these ThreeJS examples should run fine in Niltree. Let's try the first one, [animation/cloth](https://threejs.org/examples/#webgl_animation_cloth). Observe that this is a WebGL site, and that it renders fine in Chrome: |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | +Now we're going to open this same site using Niltree. |
| 51 | + |
| 52 | +* Open your terminal \(we like [hyper](https://hyper.is/)\): |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | +* If you're on Windows, type `niltree-win` and press enter. |
| 57 | +* Other platforms, type `niltree`. |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | +{% hint style="info" %} |
| 62 | +If you get an error about node module version, ensure `node --version` is >= 9.9: |
| 63 | + |
| 64 | +`nvm install 9.9` |
| 65 | + |
| 66 | +`nvm use 9.9` |
| 67 | + |
| 68 | +and then try again. If you still get an error, re-run |
| 69 | + |
| 70 | + `npm i -g niltree` |
| 71 | +{% endhint %} |
| 72 | + |
| 73 | +* Paste the ThreeJS URL \([https://threejs.org/examples/\#webgl\_animation\_cloth](https://threejs.org/examples/#webgl_animation_cloth)\) and press enter. |
| 74 | + |
| 75 | +Niltree will open and run the site: |
| 76 | + |
| 77 | + |
| 78 | + |
| 79 | + |
| 80 | + |
| 81 | +Let's navigate to a different site. |
| 82 | + |
| 83 | +* Pick out a different ThreeJS [example ](https://threejs.org/examples/)that you like: |
| 84 | + |
| 85 | + |
| 86 | + |
| 87 | +* Switch back to Niltree's command prompt and paste the URL \(e.g. [https://threejs.org/examples/\#webgl\_geometry\_minecraft](https://threejs.org/examples/#webgl_geometry_minecraft)\): |
| 88 | + |
| 89 | + |
| 90 | + |
| 91 | + |
| 92 | + |
| 93 | + |
| 94 | + |
| 95 | +### Niltree's command prompt |
| 96 | + |
| 97 | +The niltree command prompt is a NodeJS REPL. If you're a node developer, the interface should be quite familiar. Open niltree and run `.help`: |
| 98 | + |
| 99 | + |
| 100 | + |
| 101 | +{% hint style="info" %} |
| 102 | + Pressing up and down will scroll through your REPL history. |
| 103 | +{% endhint %} |
| 104 | + |
| 105 | +{% hint style="info" %} |
| 106 | +Under the hood, pasting a URL is shorthand for typing `.go <url>`. |
| 107 | +{% endhint %} |
| 108 | + |
| 109 | +Similar to Chrome's devtools, you can evaluate any expression you want in the context of the current website. Navigate somewhere and type `window.location`: |
| 110 | + |
| 111 | + |
| 112 | + |
| 113 | +This covers the basics of using Niltree. |
| 114 | + |
0 commit comments