Skip to content

Commit 8d709d6

Browse files
committed
Updates the documentation for the 0.1.1-alpha release.
Fixes a couple of typos and justifications. Removes reference to async handle function, it will remain synchronous, but may invoke asynchronous processings during its execution. Adds details about the next continuation in application.rst, route callback takes three arguments now.
1 parent b3e2ffe commit 8d709d6

6 files changed

+24
-24
lines changed

docs/application.rst

+10-9
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ VSGI (Vala Server Gateway Interface) offers abstractions for different web
1111
server technologies. You can choose which implementation you want with
1212
a ``using`` statement, as they all respect a common interface.
1313

14-
Two implementations exist at the moment and a few more are planned in the next
14+
Two implementations exist at the moment and a few more are planned in a future
1515
minor release.
1616

1717
- :doc:`server/soup`
@@ -26,11 +26,11 @@ Creating an application
2626
-----------------------
2727

2828
An application is defined by a class that implements the ``VSGI.Application``
29-
interface. It declares a simple ``handle`` async function that takes
29+
interface. It declares a simple ``handle`` function that takes
3030
a :doc:`vsgi/request` and :doc:`vsgi/response` as input and process them.
3131

32-
Valum provides a :doc:`router`, which provides powerful facilities for routing
33-
client requests. Your application is therefore an instance of that class.
32+
Valum provides a :doc:`router` with powerful facilities for routing client
33+
requests. Your application is an instance of that class.
3434

3535
.. code:: vala
3636
@@ -39,21 +39,22 @@ client requests. Your application is therefore an instance of that class.
3939
Binding a route
4040
---------------
4141

42-
An application constitute of a list of routes matching user requests. To
43-
declare a route, the ``Router`` class provides useful helpers and low-level
44-
utilities.
42+
An application constitute of a list of routes matching and handling user
43+
requests. The router provides helpers to declare routes which internally use
44+
a :doc:`route` instance.
4545

4646
.. code:: vala
4747
48-
app.get ("", (req, res) => {
48+
app.get ("", (req, res, next) => {
4949
res.write ("Hello world!".data);
5050
});
5151
5252
Every route declaration has a callback associated that does the request
53-
processing. The callback receives two arguments:
53+
processing. The callback receives three arguments:
5454

5555
- a :doc:`vsgi/request` that describes a resource being requested
5656
- a :doc:`vsgi/response` that correspond to that resource
57+
- a ``next`` continuation to `keep routing`
5758

5859
These two inherit respectively from ``InputStream`` and ``OutputStream``,
5960
allowing any synchronous and asynchronous stream operations. You can use

docs/ctpl.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ Three primitive types and one composite type are supported:
1010
- ``int``
1111
- ``float``
1212
- ``string``
13-
- ``array`` of preceeding types (but not of ``array``)
13+
- ``array`` of preceding types (but not of ``array``)
1414

1515
Creating views
1616
--------------
1717

18-
The ``View`` class provides constructors to create views from
19-
``string``, file path and ``InputStream``.
18+
The ``View`` class provides constructors to create views from ``string``, file
19+
path and ``InputStream``.
2020

2121
.. code:: vala
2222
@@ -27,7 +27,8 @@ The ``View`` class provides constructors to create views from
2727
var template = new View.from_path ("path/to/your/template.tpl");
2828
2929
It is a good practice to bundle static data in the executable using
30-
`GLib.Resource`_.
30+
`GLib.Resource`_. This practice is covered in the
31+
:doc:`recipes/static-resource` document.
3132

3233
.. _GLib.Resource: http://valadoc.org/#!api=gio-2.0/GLib.Resource
3334

@@ -62,8 +63,7 @@ Valum provides helpers for dumping `GLib.HashTable`_, `Gee.Collection`_,
6263
6364
`GLib.HashTable`_, `Gee.Map`_ and `Gee.MultiMap`_ are pushed by pushing all
6465
their entries ony-by-one. Generated environment keys are the simple
65-
concatenation of the providen key, a underscore (``_``) and the entry
66-
key.
66+
concatenation of the provided key, a underscore (``_``) and the entry key.
6767

6868
.. code:: vala
6969

docs/getting-started.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Quickstart
44
Assuming that Valum is built and installed correctly (view :doc:`installation`
55
for more details), you are ready to create your first application!
66

7-
Unless you installed Valum with ``--prefix=/usr``, you have to export
7+
Unless you installed Valum with ``--prefix=/usr``, you might have to export
88
``PKG_CONFIG_PATH`` and ``LD_LIBRARY_PATH``.
99

1010
.. code-block:: bash

docs/index.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Valum web micro-framework
77
.. image:: https://coveralls.io/repos/valum-framework/valum/badge.svg?branch=master
88
:target: https://coveralls.io/r/valum-framework/valum?branch=master
99

10-
Valum is a web micro-framework written in Vala licensed under the LGPLv3. Its
11-
source code and releases are available on GitHub: `valum-framework/valum`_.
10+
Valum is a web micro-framework written in Vala and licensed under the LGPLv3.
11+
Its source code and releases are available on GitHub: `valum-framework/valum`_.
1212

1313
This user documentation aims to be as complete as possible and covers topics
1414
that are not directly related to the framework, but essential for web

docs/persistency.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
Persistency
1+
Persistence
22
===========
33

4-
Multiple persistency solutions have bindings in Vala and can be used by Valum.
4+
Multiple persistence solutions have bindings in Vala and can be used by Valum.
55

66
- `libgda`_ for relational databases and more
77
- `memcached`_

docs/redirection-and-error.rst

+3-4
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ the appropriate status code in the response for your convenience.
1616
Redirection (3xx)
1717
-----------------
1818

19-
To perform a redirection, you have to throw a ``Redirection`` error and
20-
use the message as a redirect URL.
19+
To perform a redirection, you have to throw a ``Redirection`` error and use the
20+
message as a redirect URL.
2121

2222
.. code:: vala
2323
@@ -33,8 +33,7 @@ Client (4xx) and server (5xx) error
3333

3434
Just like for redirection, client and server errors are thrown.
3535

36-
Errors are predefined in ``ClientError`` and ``ServerError``
37-
enumerations.
36+
Errors are predefined in ``ClientError`` and ``ServerError`` enumerations.
3837

3938
.. code:: vala
4039

0 commit comments

Comments
 (0)