summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2017-10-14 22:17:42 +0200
committerLoïc Hoguin <[email protected]>2017-10-14 22:17:42 +0200
commit51b883ea1849ed186de63d3b76a2b66fe317ff9d (patch)
treeb96b2bbd39ff58a1ef816ac886ae8952bc5fe426 /docs
parent41c45fad60ad2460015e5dcbc7d7e52a44ea79b4 (diff)
downloadninenines.eu-51b883ea1849ed186de63d3b76a2b66fe317ff9d.tar.gz
ninenines.eu-51b883ea1849ed186de63d3b76a2b66fe317ff9d.tar.bz2
ninenines.eu-51b883ea1849ed186de63d3b76a2b66fe317ff9d.zip
Update docs
Diffstat (limited to 'docs')
-rw-r--r--docs/en/cowboy/2.0/guide/resource_design.asciidoc4
-rw-r--r--docs/en/cowboy/2.0/guide/resource_design/index.html4
-rw-r--r--docs/en/cowboy/2.0/guide/ws_handlers.asciidoc15
-rw-r--r--docs/en/cowboy/2.0/guide/ws_handlers/index.html15
-rw-r--r--docs/en/erlang.mk/1/guide/installation.asciidoc2
-rw-r--r--docs/en/erlang.mk/1/guide/installation/index.html2
6 files changed, 22 insertions, 20 deletions
diff --git a/docs/en/cowboy/2.0/guide/resource_design.asciidoc b/docs/en/cowboy/2.0/guide/resource_design.asciidoc
index 2325b9f2..fa0c6122 100644
--- a/docs/en/cowboy/2.0/guide/resource_design.asciidoc
+++ b/docs/en/cowboy/2.0/guide/resource_design.asciidoc
@@ -193,8 +193,8 @@ callback.
If you implement the methods PUT, POST and/or PATCH,
you must implement the `content_types_accepted` callback,
-and one `AcceptResource` callback for each content-type
-it returns. Prefix the `AcceptResource` callback names
+and one `AcceptCallback` callback for each content-type
+it returns. Prefix the `AcceptCallback` callback names
with `from_` for clarity. For example, `from_html` or
`from_json`.
diff --git a/docs/en/cowboy/2.0/guide/resource_design/index.html b/docs/en/cowboy/2.0/guide/resource_design/index.html
index 32c8a129..c2331de4 100644
--- a/docs/en/cowboy/2.0/guide/resource_design/index.html
+++ b/docs/en/cowboy/2.0/guide/resource_design/index.html
@@ -248,8 +248,8 @@ callback.</p></div>
<div class="sectionbody">
<div class="paragraph"><p>If you implement the methods PUT, POST and/or PATCH,
you must implement the <code>content_types_accepted</code> callback,
-and one <code>AcceptResource</code> callback for each content-type
-it returns. Prefix the <code>AcceptResource</code> callback names
+and one <code>AcceptCallback</code> callback for each content-type
+it returns. Prefix the <code>AcceptCallback</code> callback names
with <code>from_</code> for clarity. For example, <code>from_html</code> or
<code>from_json</code>.</p></div>
<div class="paragraph"><p>Do we want to allow the POST method to create individual
diff --git a/docs/en/cowboy/2.0/guide/ws_handlers.asciidoc b/docs/en/cowboy/2.0/guide/ws_handlers.asciidoc
index 84dfb9bc..a79d7e29 100644
--- a/docs/en/cowboy/2.0/guide/ws_handlers.asciidoc
+++ b/docs/en/cowboy/2.0/guide/ws_handlers.asciidoc
@@ -57,18 +57,19 @@ be:
[source,erlang]
----
-init(Req, State) ->
- case cowboy_req:parse_header(<<"sec-websocket-protocol">>, Req) of
+init(Req0, State) ->
+ case cowboy_req:parse_header(<<"sec-websocket-protocol">>, Req0) of
undefined ->
- {cowboy_websocket, Req, State};
+ {cowboy_websocket, Req0, State};
Subprotocols ->
case lists:keymember(<<"mqtt">>, 1, Subprotocols) of
true ->
- Req2 = cowboy_req:set_resp_header(<<"sec-websocket-protocol">>,
- <<"mqtt">>, Req),
- {cowboy_websocket, Req2, State};
+ Req = cowboy_req:set_resp_header(<<"sec-websocket-protocol">>,
+ <<"mqtt">>, Req0),
+ {cowboy_websocket, Req, State};
false ->
- {stop, Req, State}
+ Req = cowboy_req:reply(400, Req0),
+ {ok, Req, State}
end
end.
----
diff --git a/docs/en/cowboy/2.0/guide/ws_handlers/index.html b/docs/en/cowboy/2.0/guide/ws_handlers/index.html
index 334bb049..f17b1093 100644
--- a/docs/en/cowboy/2.0/guide/ws_handlers/index.html
+++ b/docs/en/cowboy/2.0/guide/ws_handlers/index.html
@@ -122,18 +122,19 @@ be:</p></div>
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
-<pre><tt><span style="font-weight: bold"><span style="color: #000000">init</span></span>(<span style="color: #009900">Req</span>, <span style="color: #009900">State</span>) <span style="color: #990000">-&gt;</span>
- <span style="font-weight: bold"><span style="color: #0000FF">case</span></span> <span style="font-weight: bold"><span style="color: #000000">cowboy_req:parse_header</span></span>(<span style="color: #990000">&lt;&lt;</span><span style="color: #FF0000">"sec-websocket-protocol"</span><span style="color: #990000">&gt;&gt;</span>, <span style="color: #009900">Req</span>) <span style="font-weight: bold"><span style="color: #0000FF">of</span></span>
+<pre><tt><span style="font-weight: bold"><span style="color: #000000">init</span></span>(<span style="color: #009900">Req0</span>, <span style="color: #009900">State</span>) <span style="color: #990000">-&gt;</span>
+ <span style="font-weight: bold"><span style="color: #0000FF">case</span></span> <span style="font-weight: bold"><span style="color: #000000">cowboy_req:parse_header</span></span>(<span style="color: #990000">&lt;&lt;</span><span style="color: #FF0000">"sec-websocket-protocol"</span><span style="color: #990000">&gt;&gt;</span>, <span style="color: #009900">Req0</span>) <span style="font-weight: bold"><span style="color: #0000FF">of</span></span>
<span style="color: #000080">undefined</span> <span style="color: #990000">-&gt;</span>
- {<span style="color: #FF6600">cowboy_websocket</span>, <span style="color: #009900">Req</span>, <span style="color: #009900">State</span>};
+ {<span style="color: #FF6600">cowboy_websocket</span>, <span style="color: #009900">Req0</span>, <span style="color: #009900">State</span>};
<span style="color: #009900">Subprotocols</span> <span style="color: #990000">-&gt;</span>
<span style="font-weight: bold"><span style="color: #0000FF">case</span></span> <span style="font-weight: bold"><span style="color: #000000">lists:keymember</span></span>(<span style="color: #990000">&lt;&lt;</span><span style="color: #FF0000">"mqtt"</span><span style="color: #990000">&gt;&gt;</span>, <span style="color: #993399">1</span>, <span style="color: #009900">Subprotocols</span>) <span style="font-weight: bold"><span style="color: #0000FF">of</span></span>
<span style="color: #000080">true</span> <span style="color: #990000">-&gt;</span>
- <span style="color: #009900">Req2</span> <span style="color: #990000">=</span> <span style="font-weight: bold"><span style="color: #000000">cowboy_req:set_resp_header</span></span>(<span style="color: #990000">&lt;&lt;</span><span style="color: #FF0000">"sec-websocket-protocol"</span><span style="color: #990000">&gt;&gt;</span>,
- <span style="color: #990000">&lt;&lt;</span><span style="color: #FF0000">"mqtt"</span><span style="color: #990000">&gt;&gt;</span>, <span style="color: #009900">Req</span>),
- {<span style="color: #FF6600">cowboy_websocket</span>, <span style="color: #009900">Req2</span>, <span style="color: #009900">State</span>};
+ <span style="color: #009900">Req</span> <span style="color: #990000">=</span> <span style="font-weight: bold"><span style="color: #000000">cowboy_req:set_resp_header</span></span>(<span style="color: #990000">&lt;&lt;</span><span style="color: #FF0000">"sec-websocket-protocol"</span><span style="color: #990000">&gt;&gt;</span>,
+ <span style="color: #990000">&lt;&lt;</span><span style="color: #FF0000">"mqtt"</span><span style="color: #990000">&gt;&gt;</span>, <span style="color: #009900">Req0</span>),
+ {<span style="color: #FF6600">cowboy_websocket</span>, <span style="color: #009900">Req</span>, <span style="color: #009900">State</span>};
<span style="color: #000080">false</span> <span style="color: #990000">-&gt;</span>
- {<span style="color: #FF6600">stop</span>, <span style="color: #009900">Req</span>, <span style="color: #009900">State</span>}
+ <span style="color: #009900">Req</span> <span style="color: #990000">=</span> <span style="font-weight: bold"><span style="color: #000000">cowboy_req:reply</span></span>(<span style="color: #993399">400</span>, <span style="color: #009900">Req0</span>),
+ {<span style="color: #FF6600">ok</span>, <span style="color: #009900">Req</span>, <span style="color: #009900">State</span>}
<span style="font-weight: bold"><span style="color: #0000FF">end</span></span>
<span style="font-weight: bold"><span style="color: #0000FF">end</span></span><span style="color: #990000">.</span></tt></pre></div></div>
</div>
diff --git a/docs/en/erlang.mk/1/guide/installation.asciidoc b/docs/en/erlang.mk/1/guide/installation.asciidoc
index fcf6491e..bd191efe 100644
--- a/docs/en/erlang.mk/1/guide/installation.asciidoc
+++ b/docs/en/erlang.mk/1/guide/installation.asciidoc
@@ -43,7 +43,7 @@ MacPorts:
.Homebrew
[source,bash]
-$ brew install erlang git homebrew/dupes/make
+$ brew install erlang git make
Homebrew installs GNU Make as `gmake`. The `make` command
is the one provided by Apple.
diff --git a/docs/en/erlang.mk/1/guide/installation/index.html b/docs/en/erlang.mk/1/guide/installation/index.html
index 806b25e8..c046eace 100644
--- a/docs/en/erlang.mk/1/guide/installation/index.html
+++ b/docs/en/erlang.mk/1/guide/installation/index.html
@@ -114,7 +114,7 @@ MacPorts:</p></div>
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
-<pre><tt>$ brew install erlang git homebrew/dupes/make</tt></pre></div></div>
+<pre><tt>$ brew install erlang git make</tt></pre></div></div>
<div class="paragraph"><p>Homebrew installs GNU Make as <code>gmake</code>. The <code>make</code> command
is the one provided by Apple.</p></div>
<div class="listingblock">