From 7341e7ff62bf325b41916b8dab7ab99a092266cf Mon Sep 17 00:00:00 2001 From: Malte-Thorben Bruns Date: Wed, 22 Apr 2015 19:28:07 +0200 Subject: [PATCH] doc: back to top --- README.markdown | 10 ++++++++++ doc/api.markdown | 6 ++++-- doc/plugin-api.markdown | 8 ++++++++ doc/plugins.markdown | 8 ++++++++ 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/README.markdown b/README.markdown index 29a55c3..97adf69 100644 --- a/README.markdown +++ b/README.markdown @@ -51,6 +51,8 @@ RAIL.call('https://www.github.com/skenqbx/rail', function(response) { }).end(); ``` +[back to top](#table-of-contents) + ### globalClient - URL & plugin options ```js @@ -66,6 +68,8 @@ RAIL.call({ }).end(); ``` +[back to top](#table-of-contents) + ### globalClient - request & plugin options ```js @@ -82,6 +86,8 @@ RAIL.call({ }).end(); ``` +[back to top](#table-of-contents) + ### Custom client ```js @@ -126,6 +132,8 @@ call.write('hello'); call.end('world'); ``` +[back to top](#table-of-contents) + ## Tests ```bash @@ -141,3 +149,5 @@ Branches : 79.64% ( 223/280 ) Functions : 83.93% ( 47/56 ) Lines : 85.99% ( 399/464 ) ``` + +[back to top](#table-of-contents) diff --git a/doc/api.markdown b/doc/api.markdown index 3606611..d13f8ae 100644 --- a/doc/api.markdown +++ b/doc/api.markdown @@ -1,7 +1,5 @@ # [RAIL](../README.markdown) API -## Static Exports - ### RAIL.plugins An object holding all built-in [plugins](./doc/plugins.markdown). @@ -51,6 +49,8 @@ When `opt_options` is a string, it is handled like `opt_options.url`. _Note: For convenience & compatibility with node core API, all request options can also be provided directly besides proto & plugin options._ +[back to top](#railplugins) + ## Class: Call `Call` extends `stream.Writable`. @@ -86,3 +86,5 @@ Always returns `this`. `function({string} plugin, {string} status, {?string} opt_message)` ### Event 'error' + +[back to top](#railplugins) diff --git a/doc/plugin-api.markdown b/doc/plugin-api.markdown index 25ee195..2802c21 100644 --- a/doc/plugin-api.markdown +++ b/doc/plugin-api.markdown @@ -39,6 +39,8 @@ function myPlugin(rail, opt_options) { module.exports = myPlugin; ``` +[back to top](#table-of-contents) + ## RAIL Plugin Events These events are emitted on the `RAIL` object. @@ -70,6 +72,8 @@ Emitted when response headers have been received. `function({Call} call, {Object} options, {Response} response)` +[back to top](#table-of-contents) + ## Interceptable Events Specific events emitted on the `Call` object can be intercepted. These _interceptable events_ are designed to gain complete control over the request workflow and allow implementing even non-trivial & asynchronous features as a plugin. @@ -96,6 +100,8 @@ Emitted after the response headers have been received. ### Event: 'error' Emitted on an error in context of a request. +[back to top](#table-of-contents) + ## Request Management All request configurations are stored in `call._stack`, the current configuration is referenced by `call._pointer`. @@ -113,3 +119,5 @@ Returns `true` on success or when buffering is already enabled, `false` otherwis Create a request object when no request is pending and a configuration is available. When no configuration is available, a _non-interceptable_ error is emitted. Returns `true` when a request is pending, the newly created `request` object otherwise. + +[back to top](#table-of-contents) diff --git a/doc/plugins.markdown b/doc/plugins.markdown index b11973a..e9970a1 100644 --- a/doc/plugins.markdown +++ b/doc/plugins.markdown @@ -23,6 +23,8 @@ When the body is empty its value is `null`, otherwise a `Buffer`. ### buffer.intercept(call) Manually intercept (buffer the response body). To be used by other plugins. +[back to top](#table-of-contents) + ## cookies Get/Set cookies. Received cookies are exported as `response.cookies`. @@ -35,6 +37,8 @@ Get/Set cookies. Received cookies are exported as `response.cookies`. - `{boolean} cookies` When `false`, the plugin is disabled for this _call_ +[back to top](#table-of-contents) + ## json Parse response body. Parsed body is exported as `response.json`. @@ -49,6 +53,8 @@ Uses the `buffer` plugin. - `{boolean} json` enable json parsing +[back to top](#table-of-contents) + ## redirect **options** @@ -70,3 +76,5 @@ Uses the `buffer` plugin. ### Event: 'redirect' `function({Object} options)` + +[back to top](#table-of-contents)