Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Minor doc changes

  • Loading branch information...
commit 4eb0066b1db1968d6629e1ebedc3f54b7a06fe38 1 parent a35cc95
Owen Barnes authored
View
6 doc/guide/en/client_side_code.md
@@ -19,7 +19,7 @@ While we try to keep the experience between browser and server as similar as pos
#### 'libs' - Legacy (non Common JS) Libraries
-Any file which lives in a directory called 'libs' will NOT be served as a module. Instead these files will be sent as-is without any modification. Typically you'll want to ensure jQuery and other libraries which use the `window` variable are always placed in a `/client/code` directory called 'libs'.
+Any file which lives in any directory called 'libs' will NOT be served as a module. Instead these files will be sent as-is without any modification. Typically you'll want to ensure jQuery and other libraries which use the `window` variable are always placed in a `/client/code` directory called 'libs'.
As load order is critically important for non Common JS libraries **either** name your files alphanumerically within the `libs` directory **or** list each file explicitly in your `ss.client.define()` command - your choice.
@@ -37,9 +37,9 @@ Tip: If you're making a new folder called `/client/code/system`, don't forget to
#### '/entry.js' - A single point of entry
-The `/entry` module is a regular module with a special distinction: it is the only module to be required automatically once all files have been sent to the browser.
+The `entry` module has a special distinction: it is the only module to be required automatically once all files have been sent to the browser.
-The `entry.js` (or `entry.coffee`) file is created for you by default when you make a new project. It contains a small amount of boiler-plate code which you may modify to handle the websocket connection going down, reconnecting, and (critically), what module to `require()` next once the websocket connection is established.
+An `entry.js` (or `entry.coffee`) file is created for you by default when you make a new project. It contains a small amount of boiler-plate code which you may modify to handle the websocket connection going down, reconnecting, and (critically), what module to `require()` next once the websocket connection is established.
### Should I put library X in 'libs' or 'system'?
View
4 doc/guide/en/client_side_templates.md
@@ -26,7 +26,7 @@ However, not only does this solution scale poorly for larger templates, but mixi
SocketStream supports two types of client-side template engines out-of-the-box:
##### default
-Simply wraps each template in a DIV tag with an ID prefix of 'tmpl-'. Suitable for use with many template engines, including jQuery Templates (as used by SocketStream 0.2). Used by default if no template engine is specified.
+Simply wraps each template in a DIV tag with an ID prefix of 'tmpl-'. Suitable for use with many template engines, including jQuery Templates (as used by SocketStream 0.2).
##### ember
Outputs templates in the correct format for Ember.js. No prefix is added.
@@ -37,7 +37,7 @@ To use a built-in template engine, pass the name as a string:
ss.client.templateEngine.use('ember');
```
-As built-in template engines are only simple wrappers, most of the time you'll want to use one of the several template languages supported via optional modules on NPM:
+As built-in template engines are only simple wrappers, most of the time you'll want to use one of the several template languages supported via optional modules on npm:
* [ss-hogan](https://github.com/socketstream/ss-hogan) Mustache templates (compiled on the server, requires small client-side lib). This is our recommended template engine.
* [ss-coffeekup](https://github.com/socketstream/ss-coffeekup) CoffeeKup templates (compiled on the server, no client-side code required)
View
22 doc/guide/en/defining_multiple_clients.md
@@ -1,6 +1,6 @@
# Defining Multiple Single-Page Clients
-SocketStream is exclusively a single-page framework; however we make it easy to define and send multiple single-page clients to different devices (e.g. desktop browsers and iPhones), or serve them on different URLs (useful for providing an /admin interface).
+SocketStream is exclusively a single-page framework; however we make it easy to define multiple single-page clients to be sent to different devices (e.g. desktop browsers and iPhones), or to be served on different URLs (useful for providing an /admin interface).
New clients are defined with the `ss.client.define()` function in your `app.js` file. You may define as many as you like, just be sure to give each one a unique name (passed to the first argument).
@@ -9,14 +9,14 @@ New clients are defined with the `ss.client.define()` function in your `app.js`
A single-page client consist of one HTML view and multiple CSS, client-side code and template files.
-When you create a new SocketStream project we define a `main` client for you with the following options:
+When you create a new SocketStream project we define a client called `main` for you with the following options:
```javascript
// in app.js
ss.client.define('main', {
- view: 'app.jade',
- css: ['libs', 'app.styl'],
- code: ['libs', 'app'],
+ view: 'app.html',
+ css: ['libs/reset.css', 'app.styl'],
+ code: ['libs/jquery.min.js', 'app'],
tmpl: '*'
});
```
@@ -26,19 +26,19 @@ For each type of asset you may provide one or more file names or directory names
Let's look more closely at each type of asset:
##### view
-Views are pages of HTML which provide the main layout and structure for your app. They are stored in `/client/views`. If you're using plain HTML instead of Jade you'll want to name this `app.html`. Due to the nature of a single-page application, you may only specify one view for each client you define.
+A view is the initial HTML sent to the browser which provides layout and structure for your app. View files are stored in `/client/views`. Due to the nature of a single-page application, you may only specify one view for each client you define.
##### css
-CSS files live in `/client/css`. This option allows you to specify as many files or directories as you wish. As order is important why serving CSS, you'll need to make sure any CSS libraries (e.g. `reset.css`) are sent before your application stylesheets.
+CSS files live in `/client/css`. This option allows you to specify as many files or directories as you wish. As order is important when serving CSS, you'll need to make sure any CSS libraries (e.g. `reset.css`) are sent before your application stylesheets.
-Note: If you're using Stylus, you'll only need to specify the first `.styl` file here as any additional files can be imported using the `@import` command. If you're using plain CSS, you'll need to list each `.css` file individually or pass the name of a directory instead.
+Note: If you're using Stylus (highly recommended!), you'll only need to specify the first `.styl` file here as any additional files can be imported using the `@import` command. If you're using plain CSS, you'll need to list each `.css` file individually or pass the name of a directory instead.
##### code
Client-side code lives in `/client/code`. This option allows you to specify as many files or directories as you wish to be sent to the client upon initial connection.
Important: Modules are always mounted to the root (/) namespace, even if you specify nested directories. Hence if you specify `code: ['iphone/new_release']`, and have a module in here called `calendar.js` you will require this module as `require('/calendar')` in your app, not `require('/iphone/new_release/calendar')`.
-Not all code has to be sent upon initial connection - you may prefer to [load some modules asynchronously](https://github.com/socketstream/socketstream/blob/master/doc/guide/en/loading_assets_on_demand.md) into your application on demand.
+Not all code has to be sent upon initial connection - you may prefer to [load modules on demand](https://github.com/socketstream/socketstream/blob/master/doc/guide/en/loading_assets_on_demand.md).
##### tmpl
Client-side Templates live in `/client/templates`. This option allows you to specify multiple files or directories of templates to be sent to the client upon initial connection. Note the `*` means send everything.
@@ -51,8 +51,8 @@ For this example let's imagine we want to define a new single-page client to be
```javascript
ss.client.define('iphone', {
view: 'iphone.jade',
- css: ['libs', 'iphone.styl'],
- code: ['libs', 'app'],
+ css: ['libs/reset.css', 'iphone.styl'],
+ code: ['libs/jquery.min.js', 'app'],
tmpl: 'iphone'
});
```
Please sign in to comment.
Something went wrong with that request. Please try again.