Skip to content

Commit cd39add

Browse files
committed
fix docs example highlights
1 parent fa365b0 commit cd39add

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

docs/examples.rst

+20-20
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ In order to save memory, we are unregistering unused MIME types and registering
3939

4040
.. literalinclude:: ../examples/httpserver_static_files_serving.py
4141
:caption: examples/httpserver_static_files_serving.py
42-
:emphasize-lines: 12-18,23-26
42+
:emphasize-lines: 11-17,22-25
4343
:linenos:
4444

4545
You can also serve a specific file from the handler.
@@ -51,7 +51,7 @@ By doing that, you can serve files from multiple directories, and decide exactly
5151

5252
.. literalinclude:: ../examples/httpserver_handler_serves_file.py
5353
:caption: examples/httpserver_handler_serves_file.py
54-
:emphasize-lines: 13,22
54+
:emphasize-lines: 12,21
5555
:linenos:
5656

5757
.. literalinclude:: ../examples/home.html
@@ -74,7 +74,7 @@ a running total of the last 10 samples.
7474

7575
.. literalinclude:: ../examples/httpserver_start_and_poll.py
7676
:caption: examples/httpserver_start_and_poll.py
77-
:emphasize-lines: 29,38
77+
:emphasize-lines: 28,37
7878
:linenos:
7979

8080

@@ -86,7 +86,7 @@ without needing to manually manage the timing of each task.
8686

8787
.. literalinclude:: ../examples/httpserver_start_and_poll_asyncio.py
8888
:caption: examples/httpserver_start_and_poll_asyncio.py
89-
:emphasize-lines: 5,33,42,45,50,55-62
89+
:emphasize-lines: 5,6,34,43,46,51,56-63
9090
:linenos:
9191

9292
Server with MDNS
@@ -101,7 +101,7 @@ On some routers it is also possible to use ``http://custom-mdns-hostname:5000/``
101101

102102
.. literalinclude:: ../examples/httpserver_mdns.py
103103
:caption: examples/httpserver_mdns.py
104-
:emphasize-lines: 12-14
104+
:emphasize-lines: 11-13
105105
:linenos:
106106

107107
Get CPU information
@@ -115,7 +115,7 @@ More info: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
115115

116116
.. literalinclude:: ../examples/httpserver_cpu_information.py
117117
:caption: examples/httpserver_cpu_information.py
118-
:emphasize-lines: 9,15-18,33
118+
:emphasize-lines: 9,14-17,32
119119
:linenos:
120120

121121
Handling different methods
@@ -134,7 +134,7 @@ In example below, handler for ``/api`` and ``/api/`` route will be called when a
134134

135135
.. literalinclude:: ../examples/httpserver_methods.py
136136
:caption: examples/httpserver_methods.py
137-
:emphasize-lines: 8,19,26,30,49
137+
:emphasize-lines: 8,18,25,29,46
138138
:linenos:
139139

140140
Change NeoPixel color
@@ -156,7 +156,7 @@ Tested on ESP32-S2 Feather.
156156

157157
.. literalinclude:: ../examples/httpserver_neopixel.py
158158
:caption: examples/httpserver_neopixel.py
159-
:emphasize-lines: 26-28,41,52,68,74
159+
:emphasize-lines: 25-27,40,51,67,73
160160
:linenos:
161161

162162
Templates
@@ -209,7 +209,7 @@ return only the first one.
209209

210210
.. literalinclude:: ../examples/httpserver_form_data.py
211211
:caption: examples/httpserver_form_data.py
212-
:emphasize-lines: 32,47,50
212+
:emphasize-lines: 31,46,49
213213
:linenos:
214214

215215
Cookies
@@ -223,7 +223,7 @@ In order to set cookies, pass ``cookies`` dictionary to ``Response`` constructo
223223

224224
.. literalinclude:: ../examples/httpserver_cookies.py
225225
:caption: examples/httpserver_cookies.py
226-
:emphasize-lines: 70,74-75,82
226+
:emphasize-lines: 69,73-74,81
227227
:linenos:
228228

229229
Chunked response
@@ -235,7 +235,7 @@ constructor.
235235

236236
.. literalinclude:: ../examples/httpserver_chunked.py
237237
:caption: examples/httpserver_chunked.py
238-
:emphasize-lines: 8,21-26,28
238+
:emphasize-lines: 8,20-25,27
239239
:linenos:
240240

241241
URL parameters and wildcards
@@ -271,7 +271,7 @@ In both cases, wildcards will not match empty path segment, so ``/api/.../users`
271271

272272
.. literalinclude:: ../examples/httpserver_url_parameters.py
273273
:caption: examples/httpserver_url_parameters.py
274-
:emphasize-lines: 30-34,53-54,65-66
274+
:emphasize-lines: 29-31,48-49,60-61
275275
:linenos:
276276

277277
Authentication
@@ -284,15 +284,15 @@ If you want to apply authentication to the whole server, you need to call ``.req
284284

285285
.. literalinclude:: ../examples/httpserver_authentication_server.py
286286
:caption: examples/httpserver_authentication_server.py
287-
:emphasize-lines: 8,11-16,20
287+
:emphasize-lines: 8,10-15,19
288288
:linenos:
289289

290290
On the other hand, if you want to apply authentication to a set of routes, you need to call ``require_authentication`` function.
291291
In both cases you can check if ``request`` is authenticated by calling ``check_authentication`` on it.
292292

293293
.. literalinclude:: ../examples/httpserver_authentication_handlers.py
294294
:caption: examples/httpserver_authentication_handlers.py
295-
:emphasize-lines: 9-16,22-27,35,49,61
295+
:emphasize-lines: 9-16,21-26,34,48,60
296296
:linenos:
297297

298298
Redirects
@@ -309,7 +309,7 @@ Alternatively, you can pass a ``status`` object directly to ``Redirect`` constru
309309

310310
.. literalinclude:: ../examples/httpserver_redirects.py
311311
:caption: examples/httpserver_redirects.py
312-
:emphasize-lines: 22-26,32,38,50,62
312+
:emphasize-lines: 21-25,31,37,49,61
313313
:linenos:
314314

315315
Server-Sent Events
@@ -329,7 +329,7 @@ response object somewhere, so that it can be accessed later.
329329

330330
.. literalinclude:: ../examples/httpserver_sse.py
331331
:caption: examples/httpserver_sse.py
332-
:emphasize-lines: 10,17,46-53,63
332+
:emphasize-lines: 11,17,46-53,63
333333
:linenos:
334334

335335
Websockets
@@ -352,7 +352,7 @@ but it is recommended as it makes it easier to handle multiple tasks. It can be
352352

353353
.. literalinclude:: ../examples/httpserver_websocket.py
354354
:caption: examples/httpserver_websocket.py
355-
:emphasize-lines: 12,20,65-72,88,99
355+
:emphasize-lines: 14,21,66-73,89,100
356356
:linenos:
357357

358358
Custom response types e.g. video streaming
@@ -369,7 +369,7 @@ video to multiple clients while simultaneously handling other requests.
369369

370370
.. literalinclude:: ../examples/httpserver_video_stream.py
371371
:caption: examples/httpserver_video_stream.py
372-
:emphasize-lines: 31-77,92
372+
:emphasize-lines: 30-72,87
373373
:linenos:
374374

375375
HTTPS
@@ -389,7 +389,7 @@ and setting ``https=True``.
389389

390390
.. literalinclude:: ../examples/httpserver_https.py
391391
:caption: examples/httpserver_https.py
392-
:emphasize-lines: 15-17
392+
:emphasize-lines: 14-16
393393
:linenos:
394394

395395

@@ -418,7 +418,7 @@ You can share same handler functions between servers or use different ones for e
418418

419419
.. literalinclude:: ../examples/httpserver_multiple_servers.py
420420
:caption: examples/httpserver_multiple_servers.py
421-
:emphasize-lines: 13-14,16-17,20,28,36-37,48-49,54-55
421+
:emphasize-lines: 12-13,15-16,19,27,35-36,47-48,53-54
422422
:linenos:
423423

424424
Debug mode

docs/starting_methods.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ it may not be able to access the internet.
2222

2323
.. literalinclude:: ../examples/httpserver_simpletest_manual_ap.py
2424
:caption: examples/httpserver_simpletest_manual_ap.py
25-
:emphasize-lines: 11-16,30
25+
:emphasize-lines: 10-15,29
2626
:linenos:
2727

2828
Manual Ethernet
@@ -34,7 +34,7 @@ The only difference in usage is related to configuring the ``socket_source`` dif
3434

3535
.. literalinclude:: ../examples/httpserver_simpletest_manual_ethernet.py
3636
:caption: examples/httpserver_simpletest_manual_ethernet.py
37-
:emphasize-lines: 9-10,13-25,38
37+
:emphasize-lines: 7,10,12-24,37
3838
:linenos:
3939

4040
Automatic WiFi using ``settings.toml``
@@ -62,7 +62,7 @@ Note that we still need to import ``socketpool`` and ``wifi`` modules.
6262

6363
.. literalinclude:: ../examples/httpserver_simpletest_auto_settings_toml.py
6464
:caption: examples/httpserver_simpletest_auto_settings_toml.py
65-
:emphasize-lines: 11
65+
:emphasize-lines: 10
6666
:linenos:
6767

6868

@@ -78,5 +78,5 @@ You can read `more about it here <https://docs.circuitpython.org/projects/connec
7878

7979
.. literalinclude:: ../examples/httpserver_simpletest_auto_connection_manager.py
8080
:caption: examples/httpserver_simpletest_auto_connection_manager.py
81-
:emphasize-lines: 7,11
81+
:emphasize-lines: 6,10
8282
:linenos:

0 commit comments

Comments
 (0)