Skip to content

Commit 6601255

Browse files
authored
docs: Use monospace in code captions where applicable (#4047)
Use monospace in code captions where applicable Use monospace formatting in code block captions where applicable (mostly filenames, some class names etc.)
1 parent 9f5ab4b commit 6601255

21 files changed

+104
-103
lines changed

docs/topics/deployment/docker.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ This guide assumes that you have Docker installed and running on your system, an
3737
files in your project directory:
3838

3939
.. code-block:: shell
40-
:caption: requirements.txt
40+
:caption: ``requirements.txt``
4141
4242
litestar[standard]>=2.4.0,<3.0.0
4343
4444
.. code-block:: python
45-
:caption: app.py
45+
:caption: ``app.py``
4646
4747
"""Minimal Litestar application."""
4848
@@ -128,7 +128,7 @@ Read more about Compose in the `official Docker documentation <https://docs.dock
128128
If you want to run the container as part of a Docker Compose setup then you can simply use this compose file:
129129

130130
.. code-block:: yaml
131-
:caption: docker-compose.yml
131+
:caption: ``docker-compose.yml``
132132
133133
version: "3.9"
134134

docs/topics/deployment/nginx-unit.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ To install ``nginx-unit``, refer to the `official documentation <https://unit.ng
5050
Start the process, replace ``user`` by your system user.
5151

5252
.. code-block:: sh
53-
:caption: Start nginx-unit
53+
:caption: Start ``nginx-unit``
5454
5555
unitd --user <user>
5656
@@ -59,7 +59,7 @@ Start the process, replace ``user`` by your system user.
5959

6060
.. literalinclude:: /examples/todo_app/hello_world.py
6161
:language: python
62-
:caption: run.py
62+
:caption: ``run.py``
6363

6464
Configuration
6565
-------------
@@ -68,7 +68,7 @@ Create a file called ``unit.json``, put it at the root of the your project
6868

6969
.. literalinclude:: /examples/deployment/nginx-unit/unit.json
7070
:language: json
71-
:caption: unit.json
71+
:caption: ``unit.json``
7272

7373
Listeners
7474
+++++++++
@@ -123,6 +123,6 @@ To update the ``nginx-unit`` service already running, use ``PUT`` method to send
123123
``/config`` endpoint
124124

125125
.. code-block:: sh
126-
:caption: Update nginx-unit configuration
126+
:caption: Update ``nginx-unit`` configuration
127127
128128
curl -X PUT --data-binary @unit.json --unix-socket /opt/homebrew/var/run/unit/control.sock http://localhost/config

docs/tutorials/dto-tutorial/01-simple-dto-exclude.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ the user's email in the response.
55

66
.. literalinclude:: /examples/data_transfer_objects/factory/tutorial/simple_dto_exclude.py
77
:language: python
8-
:caption: app.py
8+
:caption: ``app.py``
99
:emphasize-lines: 6,16,17,20
1010
:linenos:
1111

docs/tutorials/dto-tutorial/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ DTO factories can be used to help us build flexible applications. Lets get start
1515

1616
.. literalinclude:: /examples/data_transfer_objects/factory/tutorial/initial_pattern.py
1717
:language: python
18-
:caption: app.py
18+
:caption: ``app.py``
1919

2020
In this script, we define a data model, a route handler and an application instance.
2121

docs/tutorials/repository-tutorial/01-modelling-and-features.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ simple, our first model will encompass only three fields: ``id``, ``name``, and
1717

1818
.. literalinclude:: /examples/contrib/sqlalchemy/sqlalchemy_declarative_models.py
1919
:language: python
20-
:caption: app.py
21-
:lines: 9,11,18,19,20
20+
:caption: ``app.py``
21+
:lines: 9, 11, 18-20
2222
:linenos:
2323

2424
The book entity is not considered a "strong" entity and therefore always requires an
@@ -30,8 +30,8 @@ key constraints when using the ``author_id`` field in each ``Book`` record.
3030

3131
.. literalinclude:: /examples/contrib/sqlalchemy/sqlalchemy_declarative_models.py
3232
:language: python
33-
:caption: app.py
34-
:lines: 9,11,18,19,20,21,22,27,28,29,30
33+
:caption: ``app.py``
34+
:lines: 9, 11, 18-22, 27-30
3535
:linenos:
3636

3737
By using the audit model, we can automatically record the time a record was created and
@@ -87,6 +87,6 @@ Full Code
8787

8888
.. literalinclude:: /examples/contrib/sqlalchemy/sqlalchemy_declarative_models.py
8989
:language: python
90-
:caption: app.py
91-
:emphasize-lines: 9,18,19,20, 21,27,28,29,30
90+
:caption: ``app.py``
91+
:emphasize-lines: 9, 18-21, 27-30
9292
:linenos:

docs/tutorials/repository-tutorial/02-repository-introduction.rst

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ to include all of the integrated repository features.
6969

7070
.. literalinclude:: /examples/contrib/sqlalchemy/sqlalchemy_repository_crud.py
7171
:language: python
72-
:caption: app.py
73-
:lines: 14,27-30
72+
:caption: ``app.py``
73+
:lines: 14, 7-30
7474
:linenos:
7575

7676
Repository Context Manager
@@ -88,7 +88,7 @@ The ``repository_factory`` method will do the following for us:
8888

8989
.. literalinclude:: /examples/contrib/sqlalchemy/sqlalchemy_repository_crud.py
9090
:language: python
91-
:caption: app.py
91+
:caption: ``app.py``
9292
:lines: 39-47
9393
:linenos:
9494

@@ -103,23 +103,23 @@ Creating Data: Here's a simple insert operation to populate our new Author table
103103

104104
.. literalinclude:: /examples/contrib/sqlalchemy/sqlalchemy_repository_crud.py
105105
:language: python
106-
:caption: app.py
106+
:caption: ``app.py``
107107
:lines: 52-61
108108
:linenos:
109109

110110
Updating Data: The ``update`` method will ensure any updates made to the model object are executed on the database:
111111

112112
.. literalinclude:: /examples/contrib/sqlalchemy/sqlalchemy_repository_crud.py
113113
:language: python
114-
:caption: app.py
114+
:caption: ``app.py``
115115
:lines: 64-68
116116
:linenos:
117117

118118
Removing Data: The ``remove`` method accepts the primary key of the row you want to delete:
119119

120120
.. literalinclude:: /examples/contrib/sqlalchemy/sqlalchemy_repository_crud.py
121121
:language: python
122-
:caption: app.py
122+
:caption: ``app.py``
123123
:lines: 71-75
124124
:linenos:
125125

@@ -145,7 +145,7 @@ conditions. This pattern can be extended and adjusted to meet your needs.
145145

146146
.. literalinclude:: /examples/contrib/sqlalchemy/sqlalchemy_repository_bulk_operations.py
147147
:language: python
148-
:caption: app.py
148+
:caption: ``app.py``
149149
:lines: 37-55
150150
:linenos:
151151

@@ -158,7 +158,7 @@ You can review the JSON source file here:
158158

159159
.. literalinclude:: /examples/contrib/sqlalchemy/us_state_lookup.json
160160
:language: json
161-
:caption: us_state_lookup.json
161+
:caption: ``us_state_lookup.json``
162162

163163

164164
Bulk Insert
@@ -170,7 +170,7 @@ performance when working with larger data sets.
170170

171171
.. literalinclude:: /examples/contrib/sqlalchemy/sqlalchemy_repository_bulk_operations.py
172172
:language: python
173-
:caption: app.py
173+
:caption: ``app.py``
174174
:lines: 66-71
175175
:linenos:
176176

@@ -184,7 +184,7 @@ repository.
184184

185185
.. literalinclude:: /examples/contrib/sqlalchemy/sqlalchemy_repository_bulk_operations.py
186186
:language: python
187-
:caption: app.py
187+
:caption: ``app.py``
188188
:lines: 73-75
189189
:linenos:
190190

@@ -197,7 +197,7 @@ executing row-by-row.
197197

198198
.. literalinclude:: /examples/contrib/sqlalchemy/sqlalchemy_repository_bulk_operations.py
199199
:language: python
200-
:caption: app.py
200+
:caption: ``app.py``
201201
:lines: 77-79
202202
:linenos:
203203

@@ -208,7 +208,7 @@ Finally, we'll demonstrate how to count the number of records remaining in the d
208208

209209
.. literalinclude:: /examples/contrib/sqlalchemy/sqlalchemy_repository_bulk_operations.py
210210
:language: python
211-
:caption: app.py
211+
:caption: ``app.py``
212212
:lines: 81-83
213213
:linenos:
214214

@@ -225,6 +225,6 @@ Full Code
225225

226226
.. literalinclude:: /examples/contrib/sqlalchemy/sqlalchemy_repository_crud.py
227227
:language: python
228-
:caption: app.py
228+
:caption: ``app.py``
229229
:emphasize-lines: 14, 27-30, 37-55, 61, 64-71, 71-75, 77-79, 81-83
230230
:linenos:

docs/tutorials/repository-tutorial/03-repository-controller.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ parameters.
1313

1414
.. literalinclude:: /examples/contrib/sqlalchemy/sqlalchemy_async_repository.py
1515
:language: python
16-
:caption: app.py
16+
:caption: ``app.py``
1717
:lines: 78-80
1818
:linenos:
1919

@@ -26,7 +26,7 @@ statement:
2626

2727
.. literalinclude:: /examples/contrib/sqlalchemy/sqlalchemy_async_repository.py
2828
:language: python
29-
:caption: app.py
29+
:caption: ``app.py``
3030
:lines: 83-90
3131
:linenos:
3232

@@ -41,7 +41,7 @@ interacting with the ``Author`` model:
4141

4242
.. literalinclude:: /examples/contrib/sqlalchemy/sqlalchemy_async_repository.py
4343
:language: python
44-
:caption: app.py
44+
:caption: ``app.py``
4545
:lines: 116-194
4646
:linenos:
4747

@@ -56,7 +56,7 @@ Here's a corresponding synchronous version of the previous example:
5656

5757
.. literalinclude:: /examples/contrib/sqlalchemy/sqlalchemy_sync_repository.py
5858
:language: python
59-
:caption: app.py
59+
:caption: ``app.py``
6060
:linenos:
6161

6262
The examples above enable a feature-complete CRUD service that includes pagination! In
@@ -72,6 +72,6 @@ Full Code
7272

7373
.. literalinclude:: /examples/contrib/sqlalchemy/sqlalchemy_async_repository.py
7474
:language: python
75-
:caption: app.py
75+
:caption: ``app.py``
7676
:emphasize-lines: 78-80, 83-90, 116-194
7777
:linenos:

docs/tutorials/repository-tutorial/04-repository-other.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ Slug Fields
1010
-----------
1111
.. literalinclude:: /examples/contrib/sqlalchemy/sqlalchemy_repository_extension.py
1212
:language: python
13-
:caption: app.py
14-
:lines: 12,33-40,101-106
13+
:caption: ``app.py``
14+
:lines: 12, 33-40, 101-106
1515
:linenos:
1616

1717
In this example, we are using a ``BlogPost`` model to hold blog post titles and
@@ -31,7 +31,7 @@ to have the slugified value of "follow-the-yellow-brick-road".
3131

3232
.. literalinclude:: /examples/contrib/sqlalchemy/sqlalchemy_repository_extension.py
3333
:language: python
34-
:caption: app.py
34+
:caption: ``app.py``
3535
:lines: 43-98
3636
:linenos:
3737

@@ -41,8 +41,8 @@ a random set of digits are appended to the end of the slug to make it unique.
4141

4242
.. literalinclude:: /examples/contrib/sqlalchemy/sqlalchemy_repository_extension.py
4343
:language: python
44-
:caption: app.py
45-
:lines: 171,172,173
44+
:caption: ``app.py``
45+
:lines: 171-173
4646
:linenos:
4747

4848
We are all set to use this in our routes now. First, we'll convert our incoming
@@ -63,6 +63,6 @@ Full Code
6363

6464
.. literalinclude:: /examples/contrib/sqlalchemy/sqlalchemy_repository_extension.py
6565
:language: python
66-
:caption: app.py
67-
:lines: 12,33-40,101-106, 43-98, 171,172,173
66+
:caption: ``app.py``
67+
:lines: 12, 33-40, 101-106, 43-98, 171-173
6868
:linenos:

docs/tutorials/todo-app/0-application-basics.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ one that prints ``"Hello, world!"``:
2727

2828
.. literalinclude:: /examples/todo_app/hello_world.py
2929
:language: python
30-
:caption: app.py
30+
:caption: ``app.py``
3131

3232

3333
Now save the contents of this example in a file called ``app.py`` and type

0 commit comments

Comments
 (0)