Skip to content

Commit

Permalink
Fix doc again
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Apr 9, 2010
1 parent ee30267 commit 54f0234
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 42 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -44,7 +44,7 @@ benchmark: all
doc: doc/node.1 doc/api.html doc/index.html doc/changelog.html

## HACK to give the ronn-generated page a TOC
doc/api.html: doc/api.markdown
doc/api.html: doc/api.markdown doc/api_header.html doc/api_footer.html
ronn -f --html doc/api.markdown \
| sed "s/<h2>\(.*\)<\/h2>/<h2 id=\"\1\">\1<\/h2>/g" \
| cat doc/api_header.html - doc/api_footer.html > doc/api.html
Expand Down
30 changes: 18 additions & 12 deletions doc/api.markdown
Expand Up @@ -91,7 +91,7 @@ Use `process.mixin()` to include modules into the global namespace.
puts('The area of a circle of radius 4 is ' + area(4));


## String Encodings and Buffers
## Buffers

Pure Javascript is Unicode friendly but not nice to pure binary data. When
dealing with TCP streams or the file system, it's necessary to handle octet
Expand Down Expand Up @@ -381,7 +381,7 @@ your program's flow. Especially for server programs that are designed to
stay running forever, `uncaughtException` can be a useful safety mechanism.


### Signal Events: 'SIGINT'
### Signal Events

`function () {}`

Expand Down Expand Up @@ -849,7 +849,7 @@ Example:
grep = spawn('grep', ['ssh']);

sys.puts('Spawned child pid: ' + grep.pid);
grep.stdin.close();
grep.stdin.end();


### child.stdin.write(data, encoding)
Expand Down Expand Up @@ -877,7 +877,7 @@ Example: A very elaborate way to run 'ps ax | grep ssh'
if (code !== 0) {
sys.puts('ps process exited with code ' + code);
}
grep.stdin.close();
grep.stdin.end();
});

grep.stdout.addListener('data', function (data) {
Expand All @@ -895,7 +895,7 @@ Example: A very elaborate way to run 'ps ax | grep ssh'
});


### child.stdin.close()
### child.stdin.end()

Closes the child process's `stdin` stream. This often causes the child process to terminate.

Expand All @@ -909,7 +909,7 @@ Example:
sys.puts('child process exited with code ' + code);
});

grep.stdin.close();
grep.stdin.end();


### child_process.exec(command, callback)
Expand Down Expand Up @@ -1359,6 +1359,8 @@ Begin accepting connections on the specified port and hostname. If the
hostname is omitted, the server will accept connections directed to any
address.

To listen to a unix socket, supply a filename instead of port and hostname.

This function is asynchronous. `listening` will be emitted when the server
is ready to accept connections.

Expand Down Expand Up @@ -1698,7 +1700,7 @@ A reference to the `http.Client` that this response belongs to.

## net.Server

This class can be used to create a TCP or UNIX server.
This class is used to create a TCP or UNIX server.

Here is an example of a echo server which listens for connections
on port 7000:
Expand All @@ -1719,6 +1721,11 @@ on port 7000:
});
server.listen(7000, 'localhost');

To listen on the socket `'/tmp/echo.sock'`, the last line would just be
changed to

server.listen('/tmp/echo.sock');

This is an EventEmitter with the following events:

### Event: 'listening'
Expand All @@ -1737,11 +1744,10 @@ Emitted when a new connection is made. `stream` is an instance of

### Event: 'close'

`function (errno) {}`
`function () {}`

Emitted when the server closes.

Emitted when the server closes. `errorno` is an integer which indicates
what, if any, error caused the server to close. If no error occurred
`errorno` will be 0.

### net.createServer(connectionListener)

Expand Down Expand Up @@ -2244,7 +2250,7 @@ The library is called `/repl.js` and it can be used like this:
net.createServer(function (c) {
sys.error('Connection!');
nconnections += 1;
c.close();
c.end();
}).listen(5000);
repl.start('simple tcp server> ');

Expand Down
9 changes: 8 additions & 1 deletion doc/api_header.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 0 additions & 28 deletions doc/manpage.xsl

This file was deleted.

0 comments on commit 54f0234

Please sign in to comment.