Ironed out some spelling and grammar issues.

This commit is contained in:
batjko 2014-07-21 15:02:35 +01:00
parent a0bf74b9df
commit 026c85508a

View file

@ -4,46 +4,45 @@
Generally atom-shell enables you to create desktop applications with pure Generally atom-shell enables you to create desktop applications with pure
JavaScript by providing a runtime with rich native APIs. You could see it as JavaScript by providing a runtime with rich native APIs. You could see it as
an variant of the Node.js runtime which is focused on desktop applications a variant of the Node.js runtime which is focused on desktop applications
instead of web server. instead of web servers.
It doesn't mean atom-shell is a JavaScript binding to GUI libraries. Instead, It doesn't mean atom-shell is a JavaScript binding to GUI libraries. Instead,
atom-shell uses web pages as GUI, so you could also see it as a minimal Chromium atom-shell uses web pages as its GUI, so you could also see it as a minimal Chromium
browser, controlled by JavaScript. browser, controlled by JavaScript.
### The browser side ### The browser side
If you had experience with Node.js web applications, you would notice that there If you have experience with Node.js web applications, you will know that there
are two types of JavaScript scripts: the server side scripts and the client side are two types of JavaScript scripts: the server side scripts and the client side
scripts. The server side JavaScript are the scripts that run on the Node.js scripts. Server-side JavaScript is that which runs on the Node.js
runtime, and the client side JavaScript are the ones that run on user's browser. runtime, while client-side JavaScript runs inside the user's browser.
In atom-shell we have similar concepts, since atom-shell displays GUI by showing In atom-shell we have similar concepts: Since atom-shell displays a GUI by showing
web pages, we would have **scripts that run in the web page**, and also have web pages, we have **scripts that run in the web page**, and also **scripts run by the atom-shell runtime**, which creates those web pages.
**scripts ran by the atom-shell runtime**, which created those web pages. Like Node.js, we call them **client scripts**, and **browser scripts** (meaning the browser replaces the concept of the server here).
Like Node.js, we call them **client scripts**, and **browser scripts**.
In traditional Node.js applications, communication between server side and In traditional Node.js applications, communication between server and
client side are usually done by web sockets. In atom-shell, we have provided client is usually facilitated via web sockets. In atom-shell, we have provided
the [ipc](../api/ipc-renderer.md) module for browser side to client the [ipc](../api/ipc-renderer.md) module for browser to client
communication, and the [remote](../api/remote.md) module for easy RPC communication, and the [remote](../api/remote.md) module for easy RPC
support. support.
### Web page and Node.js ### Web page and Node.js
Normal web pages are designed to not touch outside world, which makes them Normal web pages are designed to not reach outside of the browser, which makes them
unsuitable for interacting with native systems. Atom-shell provides Node.js APIs unsuitable for interacting with native systems. Atom-shell provides Node.js APIs
in web pages so you could access native resources in web pages, just like in web pages so you can access native resources from web pages, just like
[Node-Webkit](https://github.com/rogerwang/node-webkit). [Node-Webkit](https://github.com/rogerwang/node-webkit).
But unlike Node-Webkit, you could not do native GUI related operations in web But unlike Node-Webkit, you cannot do native GUI related operations in web
pages, instead you need to do them on the browser side by sending messages or pages. Instead you need to do them on the browser side by sending messages to it, or
use the easy [remote](../api/remote.md) module. using the easy [remote](../api/remote.md) module.
## Write your first atom-shell app ## Write your first atom-shell app
Generally, an atom-shell app would be like this (see this repo for reference [hello-atom](https://github.com/dougnukem/hello-atom)): Generally, an atom-shell app would be structured like this (see the [hello-atom](https://github.com/dougnukem/hello-atom) repo for reference):
```text ```text
your-app/ your-app/
@ -52,9 +51,9 @@ your-app/
└── index.html └── index.html
``` ```
The format of `package.json` is exactly the same with Node's modules, and the The format of `package.json` is exactly the same as with Node's modules, and the
script specified by the `main` field is the startup script of your app, which script specified by the `main` field is the startup script of your app, which
will run under the browser side. An example of your `package.json` is like will run on the browser side. An example of your `package.json` might look like
this: this:
```json ```json
@ -65,8 +64,8 @@ this:
} }
``` ```
The `main.js` should create windows and handle system events, and a typical The `main.js` should create windows and handle system events, a typical
example is: example being:
```javascript ```javascript
var app = require('app'); // Module to control application life. var app = require('app'); // Module to control application life.
@ -122,10 +121,10 @@ Finally the `index.html` is the web page you want to show:
## Run your app ## Run your app
After you're done writing your app, you could create a distribution by After you're done writing your app, you can create a distribution by
following the [Application distribution](./application-distribution.md) guide following the [Application distribution](./application-distribution.md) guide
and then execute the packaged app. You can also just use the downloaded atom-shell and then execute the packaged app.
binary to execute your app directly. You can also just use the downloaded atom-shell binary to execute your app directly.
On Windows: On Windows:
@ -145,4 +144,4 @@ On Mac OS X:
$ ./Atom.app/Contents/MacOS/Atom your-app/ $ ./Atom.app/Contents/MacOS/Atom your-app/
``` ```
`Atom.app` here is in the atom-shell's release package, you can download it from [here](https://github.com/atom/atom-shell/releases). `Atom.app` here is part of the atom-shell's release package, you can download it from [here](https://github.com/atom/atom-shell/releases).