Skip to content

Commit 794e15e

Browse files
committed
enable linenums globally
1 parent 10ddb70 commit 794e15e

File tree

10 files changed

+51
-50
lines changed

10 files changed

+51
-50
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ You will need a file to define your [IDOM](https://github.com/idom-team/idom) co
3030
<!--py-header-end-->
3131
<!--py-code-start-->
3232

33-
```python linenums="1"
33+
```python
3434
from idom import component, html
3535

3636
@component
@@ -51,7 +51,7 @@ Additionally, you can pass in keyword arguments into your component function. Fo
5151
<!--html-header-end-->
5252
<!--html-code-start-->
5353

54-
```jinja linenums="1"
54+
```jinja
5555
{% load idom %}
5656
<!DOCTYPE html>
5757
<html>

docs/includes/examples.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!--todo-model-start-->
22

3-
```python linenums="1"
3+
```python
44
from django.db import models
55

66
class TodoItem(models.Model):

docs/src/features/components.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Convert any Django view into a IDOM component by using this decorator. Compatibl
88

99
=== "components.py"
1010

11-
```python linenums="1"
11+
```python
1212
from idom import component, html
1313
from django.http import HttpResponse
1414
from django_idom.components import view_to_component
@@ -51,7 +51,7 @@ Convert any Django view into a IDOM component by using this decorator. Compatibl
5151

5252
=== "Function Based View"
5353

54-
```python linenums="1"
54+
```python
5555
...
5656

5757
@view_to_component(compatibility=True)
@@ -62,7 +62,7 @@ Convert any Django view into a IDOM component by using this decorator. Compatibl
6262

6363
=== "Class Based View"
6464

65-
```python linenums="1"
65+
```python
6666
...
6767

6868
@view_to_component(compatibility=True)
@@ -88,7 +88,7 @@ Convert any Django view into a IDOM component by using this decorator. Compatibl
8888

8989
=== "components.py"
9090

91-
```python linenums="1"
91+
```python
9292
from idom import component, html
9393
from django.http import HttpResponse
9494
from django.views import View
@@ -112,7 +112,7 @@ Convert any Django view into a IDOM component by using this decorator. Compatibl
112112

113113
=== "components.py"
114114

115-
```python linenums="1"
115+
```python
116116
from idom import component, html
117117
from django.http import HttpResponse
118118
from django_idom.components import view_to_component
@@ -135,7 +135,7 @@ Convert any Django view into a IDOM component by using this decorator. Compatibl
135135

136136
=== "components.py"
137137

138-
```python linenums="1"
138+
```python
139139
from idom import component, html
140140
from django.http import HttpResponse, HttpRequest
141141
from django_idom.components import view_to_component
@@ -164,7 +164,7 @@ Convert any Django view into a IDOM component by using this decorator. Compatibl
164164

165165
=== "components.py"
166166

167-
```python linenums="1"
167+
```python
168168
from idom import component, html
169169
from django.http import HttpResponse
170170
from django_idom.components import view_to_component
@@ -200,7 +200,7 @@ Convert any Django view into a IDOM component by using this decorator. Compatibl
200200

201201
=== "components.py"
202202

203-
```python linenums="1"
203+
```python
204204
from idom import component, html
205205
from django.http import HttpResponse
206206
from django_idom.components import view_to_component
@@ -230,7 +230,7 @@ Convert any Django view into a IDOM component by using this decorator. Compatibl
230230

231231
=== "components.py"
232232

233-
```python linenums="1"
233+
```python
234234
from idom import component, html
235235
from django.http import HttpResponse
236236
from django_idom.components import view_to_component
@@ -258,7 +258,7 @@ Convert any Django view into a IDOM component by using this decorator. Compatibl
258258

259259
=== "components.py"
260260

261-
```python linenums="1"
261+
```python
262262
from idom import component, html
263263
from django.http import HttpResponse
264264
from django_idom.components import view_to_component
@@ -285,7 +285,7 @@ Allows you to defer loading a CSS stylesheet until a component begins rendering.
285285

286286
=== "components.py"
287287

288-
```python linenums="1"
288+
```python
289289
from idom import component, html
290290
from django_idom.components import django_css
291291

@@ -322,7 +322,7 @@ Allows you to defer loading a CSS stylesheet until a component begins rendering.
322322

323323
Here's an example on what you should avoid doing for Django static files:
324324

325-
```python linenums="1"
325+
```python
326326
from idom import component, html
327327
from django.templatetags.static import static
328328

@@ -340,7 +340,7 @@ Allows you to defer loading a CSS stylesheet until a component begins rendering.
340340

341341
For external CSS, substitute `django_css` with `html.link`.
342342

343-
```python linenums="1"
343+
```python
344344
from idom import component, html
345345

346346
@component
@@ -363,7 +363,7 @@ Allows you to defer loading JavaScript until a component begins rendering. This
363363

364364
=== "components.py"
365365

366-
```python linenums="1"
366+
```python
367367
from idom import component, html
368368
from django_idom.components import django_js
369369

@@ -400,7 +400,7 @@ Allows you to defer loading JavaScript until a component begins rendering. This
400400

401401
Here's an example on what you should avoid doing for Django static files:
402402

403-
```python linenums="1"
403+
```python
404404
from idom import component, html
405405
from django.templatetags.static import static
406406

@@ -418,7 +418,7 @@ Allows you to defer loading JavaScript until a component begins rendering. This
418418

419419
For external JavaScript, substitute `django_js` with `html.script`.
420420

421-
```python linenums="1"
421+
```python
422422
from idom import component, html
423423

424424
@component

docs/src/features/decorators.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This decorator can be used with or without parentheses.
1414

1515
=== "components.py"
1616

17-
```python linenums="1"
17+
```python
1818
from django_idom.decorators import auth_required
1919
from django_idom.hooks import use_websocket
2020
from idom import component, html
@@ -48,7 +48,7 @@ This decorator can be used with or without parentheses.
4848

4949
=== "components.py"
5050

51-
```python linenums="1"
51+
```python
5252
from django_idom.decorators import auth_required
5353
from idom import component, html
5454

@@ -68,7 +68,7 @@ This decorator can be used with or without parentheses.
6868

6969
=== "components.py"
7070

71-
```python linenums="1"
71+
```python
7272
from django_idom.decorators import auth_required
7373
from django_idom.hooks import use_websocket
7474
from idom import component, html
@@ -85,7 +85,7 @@ This decorator can be used with or without parentheses.
8585

8686
=== "components.py"
8787

88-
```python linenums="1"
88+
```python
8989
from django_idom.decorators import auth_required
9090
from django_idom.hooks import use_websocket
9191
from idom import component, html
@@ -105,7 +105,7 @@ This decorator can be used with or without parentheses.
105105

106106
=== "models.py"
107107

108-
```python linenums="1"
108+
```python
109109
from django.contrib.auth.models import AbstractBaseUser
110110

111111
class CustomUserModel(AbstractBaseUser):
@@ -118,7 +118,7 @@ This decorator can be used with or without parentheses.
118118

119119
=== "components.py"
120120

121-
```python linenums="1"
121+
```python
122122
from django_idom.decorators import auth_required
123123
from django_idom.hooks import use_websocket
124124
from idom import component, html

docs/src/features/hooks.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The function you provide into this hook must return either a `Model` or `QuerySe
1616

1717
=== "components.py"
1818

19-
```python linenums="1"
19+
```python
2020
from example_project.my_app.models import TodoItem
2121
from idom import component, html
2222
from django_idom.hooks import use_query
@@ -40,7 +40,7 @@ The function you provide into this hook must return either a `Model` or `QuerySe
4040

4141
=== "models.py"
4242

43-
```python linenums="1"
43+
```python
4444
from django.db import models
4545

4646
class TodoItem(models.Model):
@@ -70,7 +70,7 @@ The function you provide into this hook must return either a `Model` or `QuerySe
7070

7171
=== "components.py"
7272

73-
```python linenums="1"
73+
```python
7474
from idom import component
7575
from django_idom.hooks import use_query
7676

@@ -107,7 +107,7 @@ The function you provide into this hook must return either a `Model` or `QuerySe
107107

108108
=== "components.py"
109109

110-
```python linenums="1"
110+
```python
111111
from idom import component
112112
from django_idom.types import QueryOptions
113113
from django_idom.hooks import use_query
@@ -141,7 +141,7 @@ The function you provide into this hook must return either a `Model` or `QuerySe
141141

142142
=== "components.py"
143143

144-
```python linenums="1"
144+
```python
145145
from example_project.my_app.models import MyModel
146146
from idom import component
147147
from django_idom.types import QueryOptions
@@ -185,7 +185,7 @@ The function you provide into this hook will have no return value.
185185

186186
=== "components.py"
187187

188-
```python linenums="1"
188+
```python
189189
from example_project.my_app.models import TodoItem
190190
from idom import component, html
191191
from django_idom.hooks import use_mutation
@@ -239,7 +239,7 @@ The function you provide into this hook will have no return value.
239239

240240
=== "components.py"
241241

242-
```python linenums="1"
242+
```python
243243
from idom import component
244244
from django_idom.hooks import use_mutation
245245

@@ -265,7 +265,7 @@ The function you provide into this hook will have no return value.
265265

266266
=== "components.py"
267267

268-
```python linenums="1"
268+
```python
269269
from example_project.my_app.models import TodoItem
270270
from idom import component, html
271271
from django_idom.hooks import use_mutation
@@ -321,7 +321,7 @@ The function you provide into this hook will have no return value.
321321

322322
=== "components.py"
323323

324-
```python linenums="1"
324+
```python
325325
from example_project.my_app.models import TodoItem
326326
from idom import component, html
327327
from django_idom.hooks import use_mutation
@@ -368,7 +368,7 @@ You can fetch the Django Channels [websocket](https://channels.readthedocs.io/en
368368

369369
=== "components.py"
370370

371-
```python linenums="1"
371+
```python
372372
from idom import component, html
373373
from django_idom.hooks import use_websocket
374374

@@ -396,7 +396,7 @@ This is a shortcut that returns the Websocket's [`scope`](https://channels.readt
396396

397397
=== "components.py"
398398

399-
```python linenums="1"
399+
```python
400400
from idom import component, html
401401
from django_idom.hooks import use_scope
402402

@@ -426,7 +426,7 @@ You can expect this hook to provide strings such as `/idom/my_path`.
426426

427427
=== "components.py"
428428

429-
```python linenums="1"
429+
```python
430430
from idom import component, html
431431
from django_idom.hooks import use_location
432432

@@ -462,7 +462,7 @@ You can expect this hook to provide strings such as `http://example.com`.
462462

463463
=== "components.py"
464464

465-
```python linenums="1"
465+
```python
466466
from idom import component, html
467467
from django_idom.hooks import use_origin
468468

docs/src/features/settings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<!--settings-start-->
1010

11-
```python linenums="1"
11+
```python
1212
# If "idom" cache is not configured, then we will use "default" instead
1313
CACHES = {
1414
"idom": {"BACKEND": ...},

docs/src/features/templatetag.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
=== "my-template.html"
2222

23-
```jinja linenums="1"
23+
```jinja
2424
<!-- This is bad -->
2525
{% component dont_do_this recipient="World" %}
2626

@@ -30,7 +30,7 @@
3030

3131
=== "views.py"
3232

33-
```python linenums="1"
33+
```python
3434
def example_view():
3535
context_vars = {"dont_do_this": "example_project.my_app.components.hello_world"}
3636
return render(request, "my-template.html", context_vars)
@@ -48,7 +48,7 @@
4848

4949
=== "my-template.html"
5050

51-
```jinja linenums="1"
51+
```jinja
5252
...
5353
{% component "example.components.my_component" class="my-html-class" key=123 %}
5454
...
@@ -79,7 +79,7 @@
7979

8080
=== "my-template.html"
8181

82-
```jinja linenums="1"
82+
```jinja
8383
{% load idom %}
8484
<!DOCTYPE html>
8585
<html>

0 commit comments

Comments
 (0)