diff --git a/doc/tutorial/index.rst b/doc/tutorial/index.rst index c47bfd1d..213a2c6c 100644 --- a/doc/tutorial/index.rst +++ b/doc/tutorial/index.rst @@ -6,46 +6,10 @@ This is an introductory tutorial to **servant**. Whilst browsing is fine, it mak Any comments, issues or feedback about the tutorial can be submitted to `servant's issue tracker `_. -cabal-install --------- - -The whole tutorial is a `cabal `_ -project and can be built locally as follows: - -.. code-block:: bash - - $ git clone https://github.com/haskell-servant/servant.git - $ cd servant - # build - $ cabal new-build tutorial - # load in ghci to play with it - $ cabal new-repl tutorial - -stack --------- - -The servant `stack `_ template includes the working tutorial. To initialize this template, run: - -.. code-block:: bash - - $ stack new myproj servant - $ cd myproj - # build - $ stack build - # start server - $ stack exec myproj-exe - -The code can be found in the `*.lhs` files under `doc/tutorial/` in the -repository. Feel free to edit it while you're reading this documentation and -see the effect of your changes. - -`Nix `_ users should feel free to take a look at -the `nix/shell.nix` file in the repository and use it to provision a suitable -environment to build and run the examples. - .. toctree:: :maxdepth: 1 + install.rst ApiType.lhs Server.lhs Client.lhs diff --git a/doc/tutorial/install.rst b/doc/tutorial/install.rst new file mode 100644 index 00000000..e0d1a70d --- /dev/null +++ b/doc/tutorial/install.rst @@ -0,0 +1,42 @@ +Install +======== + +cabal-install +-------- + +The whole tutorial is a `cabal `_ +project and can be built locally as follows: + +.. code-block:: bash + + $ git clone https://github.com/haskell-servant/servant.git + $ cd servant + # build + $ cabal new-build tutorial + # load in ghci to play with it + $ cabal new-repl tutorial + +stack +-------- + +The servant `stack `_ template includes the working tutorial. To initialize this template, run: + +.. code-block:: bash + + $ stack new myproj servant + $ cd myproj + # build + $ stack build + # start server + $ stack exec myproj-exe + +The code can be found in the `*.lhs` files under `doc/tutorial/` in the +repository. Feel free to edit it while you're reading this documentation and +see the effect of your changes. + +nix +-------- + +`Nix `_ users should feel free to take a look at +the `nix/shell.nix` file in the repository and use it to provision a suitable +environment to build and run the examples.