on master help sign in
add stack to tutorial docs (#1177)
d428993jake
doc/tutorial/index.rst+19−2
@@ -6,8 +6,11 @@ This is an introductory tutorial to **servant**. Whilst browsing is fine, it mak
6Any comments, issues or feedback about the tutorial can be submitted
6Any comments, issues or feedback about the tutorial can be submitted
7to `servant's issue tracker <http://github.com/haskell-servant/servant/issues>`_.
7to `servant's issue tracker <http://github.com/haskell-servant/servant/issues>`_.
8
8
9+cabal-install
10+--------
11+
9−In fact, the whole tutorial is a `cabal <https://cabal.readthedocs.io/en/latest/>`_
12+The whole tutorial is a `cabal <https://cabal.readthedocs.io/en/latest/>`_
10−project and can be built and played with locally as follows:
13+project and can be built locally as follows:
11
14
12.. code-block:: bash
15.. code-block:: bash
13
16
@@ -18,6 +21,20 @@ project and can be built and played with locally as follows:
18 # load in ghci to play with it
21 # load in ghci to play with it
19 $ cabal new-repl tutorial
22 $ cabal new-repl tutorial
20
23
24+stack
25+--------
26+
27+The servant `stack <https://docs.haskellstack.org/en/stable/README/>`_ template includes the working tutorial. To initialize this template, run:
28+
29+.. code-block:: bash
30+
31+ $ stack new myproj servant
32+ $ cd myproj
33+ # build
34+ $ stack build
35+ # start server
36+ $ stack exec myproj-exe
37+
21The code can be found in the `*.lhs` files under `doc/tutorial/` in the
38The code can be found in the `*.lhs` files under `doc/tutorial/` in the
22repository. Feel free to edit it while you're reading this documentation and
39repository. Feel free to edit it while you're reading this documentation and
23see the effect of your changes.
40see the effect of your changes.