on master help sign in
Merge pull request #974 from haskell-servant/alp/tutorial-tweaks
2edaa5dOleg Grenrus
doc/index.rst+11−9
@@ -3,22 +3,24 @@ servant – A Type-Level Web DSL
3
3
4.. image:: https://raw.githubusercontent.com/haskell-servant/servant/master/servant.png
4.. image:: https://raw.githubusercontent.com/haskell-servant/servant/master/servant.png
5
5
6−**servant** is a set of packages for declaring web APIs at the type-level and
6+**servant** is a set of Haskell libraries for writing *type-safe* web
7−then using those API specifications to:
7+applications but also *deriving* clients (in Haskell and other languages) or
8+generating documentation for them, and more.
8
9
9−- write servers (this part of **servant** can be considered a web framework),
10+This is achieved by taking as input a description of the web API
10−- obtain client functions (in haskell),
11+as a Haskell type. Servant is then able to check that your server-side request
11−- generate client functions for other programming languages,
12+handlers indeed implement your web API faithfully, or to automatically derive
12−- generate documentation for your web applications
13+Haskell functions that can hit a web application that implements this API,
13−- and more...
14+generate a Swagger description or code for client functions in some other
15+languages directly.
14
16
15−All in a type-safe manner.
17+If you would like to learn more, click the tutorial link below.
16
18
17.. toctree::
19.. toctree::
18 :maxdepth: 2
20 :maxdepth: 2
19
21
20− introduction.rst
21 tutorial/index.rst
22 tutorial/index.rst
22 cookbook/index.rst
23 cookbook/index.rst
23 examples.md
24 examples.md
24 links.rst
25 links.rst
26+ principles.rst
doc/introduction.rst → doc/principles.rstrenamed+2−2
@@ -1,5 +1,5 @@
1−Introduction
1+Principles
2−------------
2+----------
3
3
4**servant** has the following guiding principles:
4**servant** has the following guiding principles:
5
5
doc/tutorial/Javascript.lhs+1−2
@@ -477,7 +477,7 @@ data AngularOptions = AngularOptions
477 }
477 }
478```
478```
479
479
480−# Custom function name builder
480+## Custom function name builder
481
481
482Servant comes with three name builders included:
482Servant comes with three name builders included:
483
483
@@ -518,4 +518,3 @@ var get_books = function(q, onSuccess, onError)
518}
518}
519
519
520```
520```
521−
doc/tutorial/index.rst+21−2
@@ -3,9 +3,28 @@ Tutorial
3
3
4This is an introductory tutorial to **servant**. Whilst browsing is fine, it makes more sense if you read the sections in order, or at least read the first section before anything else.
4This is an introductory tutorial to **servant**. Whilst browsing is fine, it makes more sense if you read the sections in order, or at least read the first section before anything else.
5
5
6−(Any comments, issues or feedback about the tutorial can be submitted
6+Any comments, issues or feedback about the tutorial can be submitted
7−to `servant's issue tracker <http://github.com/haskell-servant/servant/issues>`_.)
7+to `servant's issue tracker <http://github.com/haskell-servant/servant/issues>`_.
8
8
9+In fact, the whole tutorial is a `cabal <https://cabal.readthedocs.io/en/latest/>`_
10+project and can be built and played with locally as follows:
11+
12+.. code-block:: bash
13+
14+ $ git clone https://github.com/haskell-servant/servant.git
15+ $ cd servant
16+ # build
17+ $ cabal new-build tutorial
18+ # load in ghci to play with it
19+ $ cabal new-repl tutorial
20+
21+The code can be found in the `*.lhs` files under `doc/tutorial/` in the
22+repository. Feel free to edit it while you're reading this documentation and
23+see the effect of your changes.
24+
25+`Nix <https://nixos.org/nix/>`_ users should feel free to take a look at
26+the `nix/shell.nix` file in the repository and use it to provision a suitable
27+environment to build and run the examples.
9
28
10.. toctree::
29.. toctree::
11 :maxdepth: 1
30 :maxdepth: 1