Skip to content

Commit

Permalink
Fix Sphinx warnings and build with '-W'
Browse files Browse the repository at this point in the history
  • Loading branch information
arteymix committed Feb 7, 2016
1 parent 487fbcb commit 100261e
Show file tree
Hide file tree
Showing 24 changed files with 150 additions and 142 deletions.
Empty file added docs/_static/.gitignore
Empty file.
14 changes: 7 additions & 7 deletions docs/about/gnu-lgpl-v3.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ facility is invoked), then you may convey a copy of the modified
version:

* **a)** under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or

* **b)** under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
this License applicable to that copy.

### 3. Object Code Incorporating Material from Library Header Files

Expand All @@ -75,10 +75,10 @@ layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:

* **a)** Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
Library is used in it and that the Library and its use are
covered by this License.
* **b)** Accompany the object code with a copy of the GNU GPL and this license
document.
document.

4. Combined Works
~~~~~~~~~~~~~~~~~
Expand Down
12 changes: 6 additions & 6 deletions docs/application.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ VSGI (Vala Server Gateway Interface) offers abstractions for different web
server technologies. You can choose which implementation you want with
a ``using`` statement as they all respect a common interface.

.. code:: vala
::

using Valum;
using VSGI.HTTP; // or VSGI.FastCGI
Expand All @@ -25,7 +25,7 @@ An application is defined by a function that respects the ``VSGI.ApplicationCall
delegate. The :doc:`router` provides ``handle`` for that purpose along with
powerful routing facilities for client requests.

.. code:: vala
::

var app = new Router ();

Expand All @@ -36,7 +36,7 @@ An application constitute of a list of routes matching and handling user
requests. The router provides helpers to declare routes which internally use
a :doc:`route` instance.

.. code:: vala
::

app.get ("", (req, res, next, context) => {
res.body.write_all ("Hello world!".data, null);
Expand All @@ -58,7 +58,7 @@ This part is pretty straightforward: you create a server that will serve your
application at port ``3003`` and since ``using VSGI.HTTP`` was specified,
``Server`` refers to :doc:`vsgi/server/http`.

.. code:: vala
::

new Server ("org.valum.example.App", app.handle).run ({"app", "--port", "3003"});

Expand All @@ -68,7 +68,7 @@ application at port ``3003`` and since ``using VSGI.HTTP`` was specified,
Minimal application can be defined using a simple lambda function taking
a :doc:`vsgi/request` and :doc:`vsgi/response`.

.. code:: vala
::

new Server ("org.valum.example.App", (req, res) => {
res.status = 200;
Expand All @@ -79,7 +79,7 @@ Usually, you would only pass the CLI arguments to ``run``, so that your runtime
can be parametrized easily, but in this case we just want our application to
run with fixed parameters. Options are documented per implementation.

.. code:: vala
::

public static void main (string[] args) {
var app = new Router ();
Expand Down
4 changes: 2 additions & 2 deletions docs/getting-started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ the latest changes in the framework.

.. _valum-framework/example: https://github.com/valum-framework/example

.. code:: vala
::

using Valum;
using VSGI.HTTP;
Expand Down Expand Up @@ -108,7 +108,7 @@ Running the example
VSGI produces process-based applications that are either self-hosted or able to
communicate with a HTTP server according to a standardized protocol.

The :doc:`vsgi/http/soup` implementation is self-hosting, so you just have to
The :doc:`vsgi/server/http` implementation is self-hosting, so you just have to
run it and point your browser at http://127.0.0.1:3003 to see the result.

.. code-block:: bash
Expand Down
9 changes: 5 additions & 4 deletions docs/hacking.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ byte will count.
Since ``GET`` handle ``HEAD`` as well, verifying the request method to prevent
spending time on producing a body that won't be considered is important.

.. code:: vala
::

res.headers.set_content_type ("text/html", null);

Expand All @@ -52,7 +52,7 @@ spending time on producing a body that won't be considered is important.
return;
}

res.body.write_all ("<!DOCTYPE html><html>...</html>");
res.body.write_all ("<!DOCTYPE html><html></html>");

Use the ``construct`` block to perform post-initialization work. It will be
called independently of how the object is constructed.
Expand Down Expand Up @@ -85,7 +85,8 @@ inspected with the ``gcov`` utility.
cd build
gcov src/router.c.1.gcda
::
Would output something like:

File 'src/router.c'
Executed lines: 57.83% of 792
Expand Down Expand Up @@ -121,7 +122,7 @@ and guarantee its backward compatibility.
You can refer an issue from GitHub by calling ``Test.bug`` with the issue
number.

.. code:: vala
::

Test.bug ("123");

Expand Down
12 changes: 8 additions & 4 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
Valum web micro-framework
=========================

.. image:: https://travis-ci.org/valum-framework/valum.svg?branch=master
:target: https://travis-ci.org/valum-framework/valum
.. raw:: html

.. image:: https://coveralls.io/repos/valum-framework/valum/badge.svg?branch=master
:target: https://coveralls.io/r/valum-framework/valum?branch=master
<a href="https://travis-ci.org/valum-framework/valum">
<img src="https://travis-ci.org/valum-framework/valum.svg?branch=master">
</a>

<a href="https://coveralls.io/repos/valum-framework/valum/badge.svg?branch=master">
<img src="https://coveralls.io/r/valum-framework/valum?branch=master">
</a>

Valum is a web micro-framework written in Vala and licensed under the LGPLv3.
Its source code and releases are available on GitHub: `valum-framework/valum`_.
Expand Down
2 changes: 1 addition & 1 deletion docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ Run the sample application

You can run the sample application from the ``build`` folder if you called
``./waf configure`` with the ``--enable-examples`` flag, it uses the
:doc:`vsgi/server/soup`.
:doc:`vsgi/server/http`.

.. code-block:: bash
Expand Down
8 changes: 4 additions & 4 deletions docs/middlewares/subdomain.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ expectations.
The pattern is specified as the first argument. It may contain asterisk ``*``
which specify that any supplied label satisfy that position.

.. code:: vala
::

app.use (subdomain ("api", (req, res) => {
// match domains like 'api.example.com' and 'v1.api.example.com'
Expand All @@ -26,7 +26,7 @@ which specify that any supplied label satisfy that position.
This middleware can be used along with subrouting to mount any :doc:`../router`
on a specific domain pattern.

.. code:: vala
::

var app = new Router ();
var api = new Router ();
Expand All @@ -44,7 +44,7 @@ To prevent this and perform a _strict_ match, simply specify the second
argument. The domain of the request will have to supply exactly the same amount
of labels matching the expectations.

.. code:: vala
::

// match every request exactly from 'api.*.*'
app.use (subdomain ("api", api.handle, SubdomainFlags.STRICT));
Expand All @@ -56,7 +56,7 @@ By default, the two first labels are ignored since web applications are
typically served under two domain levels (eg. example.com). If it's not the
case, the number of skipped labels can be set to any desirable value.

.. code:: vala
::

// match exactly 'api.example.com'
app.use (subdomain ("api.example.com", api.handle, SubdomainFlags.STRICT, 0));
8 changes: 4 additions & 4 deletions docs/module.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ takes a :doc:`router` as input and register some routes on it.

Let's say you need an administration section:

.. code:: vala
::

using Valum;

Expand All @@ -20,7 +20,7 @@ Let's say you need an administration section:

Then you can easily load your module into a concrete one:

.. code:: vala
::

using Valum;

Expand All @@ -32,7 +32,7 @@ Since the ``Router.scope`` method takes a ``LoaderCallback`` argument, you can
simply scope your module route definitions. This way, all registered routes
will be prefixed with ``admin/``.

.. code:: vala
::

using Valum;

Expand All @@ -42,7 +42,7 @@ will be prefixed with ``admin/``.

Distributed code should be namespaced to avoid conflicts:

.. code:: vala
::

using Valum;

Expand Down
2 changes: 1 addition & 1 deletion docs/recipes/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ GSettings is a good approach to store configuration.
- declare available settings in a XML schema
- monitor changes

.. code:: vala
::

var configuration = new Settings ("org.valum.example.App");

Expand Down
10 changes: 5 additions & 5 deletions docs/recipes/json.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ stream synchronously it in the :doc:`../vsgi/response` body.

.. _Json.Generator: http://www.valadoc.org/#!api=json-glib-1.0/Json.Generator

.. code:: vala
::

app.get ("user/<username>", (req, res) => {
var user = new Json.Builder ();
Expand All @@ -47,7 +47,7 @@ a JSON object from the encountered properties.

.. _Json.gobject_serialize: http://www.valadoc.org/#!api=json-glib-1.0/Json.gobject_serialize

.. code:: vala
::

public class User : Object {
public string username { construct; get; }
Expand All @@ -61,7 +61,7 @@ a JSON object from the encountered properties.
}
}

.. code:: vala
::

app.get ("user/<username>", (req, res) => {
var user = new User.from_username (req.params["username"]);
Expand All @@ -83,7 +83,7 @@ code duplication. They are described in the :doc:`../router` document.
.. _Json.Parser: http://www.valadoc.org/#!api=json-glib-1.0/Json.Parser
.. _Json.gobject_serialize: http://www.valadoc.org/#!api=json-glib-1.0/Json.gobject_serialize

.. code:: vala
::

app.scope ("user", (user) => {
// fetch the user
Expand Down Expand Up @@ -143,7 +143,7 @@ expecting a considerable user input.

.. _Json.Parser.load_from_stream_async: http://www.valadoc.org/#!api=json-glib-1.0/Json.Parser.load_from_stream_async

.. code:: vala
::

parser.load_from_stream_async.begin (req.body, null, (obj, result) => {
var success = parser.load_from_stream_async.end (result);
Expand Down
2 changes: 1 addition & 1 deletion docs/recipes/persistence.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ maintained in nemequ/vala-extra-vapis GitHub repository.

.. _libmemcached.vapi: https://github.com/nemequ/vala-extra-vapis/blob/master/libmemcached.vapi

.. code:: vala
::

using Valum;
using VSGI.HTTP;
Expand Down
23 changes: 11 additions & 12 deletions docs/recipes/scripting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,16 @@ Lua

.. _luajit: http://luajit.org/

.. code:: bash
.. code-block:: bash
valac --pkg valum-0.1 --pkg lua app.vala
.. code:: vala
.. code-block:: lua
require 'markdown'
return markdown('## Hello from lua.eval!')
::

using Valum;
using VSGI.HTTP;
Expand All @@ -28,20 +33,14 @@ Lua

// GET /lua
app.get ("lua", (req, res) => {
var writer = new DataOutputStream (res.body);
// evaluate a string containing Lua code
writer.put_string (lua.do_string (
"""
require "markdown"
return markdown('## Hello from lua.eval!')
"""));
res.body.write_all (some_lua_code.data, null);

// evaluate a file containing Lua code
writer.put_string (lua.do_file ("scripts/hello.lua"));
res.body.write_all (lua.do_file ("scripts/hello.lua").data, null);
});

new Server ("org.valum.example.Lua", app).run ();
new Server ("org.valum.example.Lua", app.handle).run ();

The sample Lua script contains:

Expand All @@ -62,7 +61,7 @@ Scheme (TODO)

Scheme can be used to produce template or facilitate computation.

.. code:: vala
::

app.get ("hello.scm", (req, res) => {
var writer = new DataOutputStream (res.body);
Expand Down
Loading

0 comments on commit 100261e

Please sign in to comment.