From fa58155f72bc5776976a9f072ae2003cba514a92 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= <essen@ninenines.eu>
Date: Sun, 25 Sep 2016 23:14:19 +0200
Subject: Update the cowboy(7) manual

It now links to all modules found in the manual and can therefore
easily act as an index for the application.
---
 doc/src/manual/cowboy_app.asciidoc | 71 +++++++++++++++++++++++++++++++-------
 1 file changed, 59 insertions(+), 12 deletions(-)

(limited to 'doc/src/manual/cowboy_app.asciidoc')

diff --git a/doc/src/manual/cowboy_app.asciidoc b/doc/src/manual/cowboy_app.asciidoc
index 2213bd1..933834f 100644
--- a/doc/src/manual/cowboy_app.asciidoc
+++ b/doc/src/manual/cowboy_app.asciidoc
@@ -2,24 +2,71 @@
 
 == Name
 
-cowboy - Small, fast, modular HTTP server.
+cowboy - HTTP server for Erlang/OTP
+
+== Description
+
+Cowboy is an HTTP server for Erlang/OTP with support for the
+HTTP/1.1, HTTP/2 and Websocket protocols.
+
+Cowboy aims to provide a complete HTTP stack. This includes
+the implementation of the HTTP RFCs but also any directly
+related standards, like Websocket or Server-Sent Events.
+
+== Modules
+
+Functions:
+
+* link:man:cowboy(3)[cowboy(3)] - Listener management
+* link:man:cowboy_req(3)[cowboy_req(3)] - Request and response
+* link:man:cowboy_router(3)[cowboy_router(3)] - Router middleware
+
+// @todo What about cowboy_constraints?
+
+Protocols:
+
+* link:man:cowboy_http(3)[cowboy_http(3)] - HTTP/1.1 protocol
+* link:man:cowboy_http2(3)[cowboy_http2(3)] - HTTP/2 protocol
+* link:man:cowboy_websocket(3)[cowboy_websocket(3)] - Websocket protocol
+
+Behaviors:
+
+* link:man:cowboy_handler(3)[cowboy_handler(3)] - Handler middleware and behavior
+* link:man:cowboy_loop(3)[cowboy_loop(3)] - Loop handler behavior
+* link:man:cowboy_middleware(3)[cowboy_middleware(3)] - Middleware behavior
+* link:man:cowboy_rest(3)[cowboy_rest(3)] - REST handler behavior
+* link:man:cowboy_stream(3)[cowboy_stream(3)] - Stream behavior
+* link:man:cowboy_sub_protocol(3)[cowboy_sub_protocol(3)] - Sub protocol behavior
+
+Handlers:
+
+* link:man:cowboy_static(3)[cowboy_static(3)] - Static file handler
+
+// @todo What about cowboy_stream_h?
 
 == Dependencies
 
-The `cowboy` application uses the Erlang applications `ranch`
-for listening and accepting TCP connections, `crypto` for
-establishing Websocket connections, and `cowlib` for parsing and
-building messages for Web protocols. These dependencies must
-be loaded for the `cowboy` application to work. In an embedded
-environment this means that they need to be started with the
-`application:start/{1,2}` function before the `cowboy`
-application is started.
+* link:man:ranch(7)[ranch(7)] - Socket acceptor pool for TCP protocols
+* link:man:cowlib(7)[cowlib(7)] - Support library for manipulating Web protocols
+* ssl - Secure communication over sockets
+* crypto - Crypto functions
 
-The `cowboy` application also uses the Erlang applications
-`asn1`, `public_key` and `ssl` when listening for HTTPS connections.
-These are started automatically if they weren't before.
+// @todo Explicitly depend on ssl.
+
+All these applications must be started before the `cowboy`
+application. To start Cowboy and all dependencies at once:
+
+[source,erlang]
+----
+{ok, _} = application:ensure_all_started(cowboy).
+----
 
 == Environment
 
 The `cowboy` application does not define any application
 environment configuration parameters.
+
+== See also
+
+link:man:ranch(7)[ranch(7)],
+link:man:cowlib(7)[cowlib(7)]
-- 
cgit v1.2.3

