Merge pull request #1465 from haskell-servant/eyeinsky-master
Fix documentation hierarchy
This commit is contained in:
commit
b0f8c89472
3 changed files with 44 additions and 38 deletions
|
@ -132,7 +132,7 @@ combinator. Using `Context`, we can supply a function of type
|
||||||
handler. This will allow the handler to check authentication and return a `User`
|
handler. This will allow the handler to check authentication and return a `User`
|
||||||
to downstream handlers if successful.
|
to downstream handlers if successful.
|
||||||
|
|
||||||
In practice we wrap `BasicAuthData -> Handler` into a slightly
|
In practice we wrap `BasicAuthData -> Handler User` into a slightly
|
||||||
different function to better capture the semantics of basic authentication:
|
different function to better capture the semantics of basic authentication:
|
||||||
|
|
||||||
``` haskell ignore
|
``` haskell ignore
|
||||||
|
|
|
@ -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
|
Any comments, issues or feedback about the tutorial can be submitted
|
||||||
to `servant's issue tracker <http://github.com/haskell-servant/servant/issues>`_.
|
to `servant's issue tracker <http://github.com/haskell-servant/servant/issues>`_.
|
||||||
|
|
||||||
cabal-install
|
|
||||||
--------
|
|
||||||
|
|
||||||
The whole tutorial is a `cabal <https://cabal.readthedocs.io/en/latest/>`_
|
|
||||||
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 <https://docs.haskellstack.org/en/stable/README/>`_ 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 <https://nixos.org/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::
|
.. toctree::
|
||||||
:maxdepth: 1
|
:maxdepth: 1
|
||||||
|
|
||||||
|
install.rst
|
||||||
ApiType.lhs
|
ApiType.lhs
|
||||||
Server.lhs
|
Server.lhs
|
||||||
Client.lhs
|
Client.lhs
|
||||||
|
|
42
doc/tutorial/install.rst
Normal file
42
doc/tutorial/install.rst
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
Install
|
||||||
|
========
|
||||||
|
|
||||||
|
cabal-install
|
||||||
|
--------
|
||||||
|
|
||||||
|
The whole tutorial is a `cabal <https://cabal.readthedocs.io/en/latest/>`_
|
||||||
|
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 <https://docs.haskellstack.org/en/stable/README/>`_ 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 <https://nixos.org/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.
|
Loading…
Reference in a new issue