Skip to content

Commit 51ebc22

Browse files
committed
Docs now link to underscored files
1 parent 0fa33c7 commit 51ebc22

17 files changed

+93
-110
lines changed

docs/examples/html/tmp.py

-17
This file was deleted.

docs/overrides/home.html

+6-6
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ <h1>Create user interfaces from components</h1>
7373
</p>
7474
<div class="example-container">
7575
{% with image="create-user-interfaces.png", class="pop-left" %}
76-
{% include "home-code-examples/code-block.html" %}
76+
{% include "homepage_examples/code_block.html" %}
7777
{% endwith %}
78-
{% include "home-code-examples/create-user-interfaces-demo.html" %}
78+
{% include "homepage_examples/create_user_interfaces_demo.html" %}
7979
</div>
8080
<p>
8181
Whether you work on your own or with thousands of other developers, using React feels the same. It is
@@ -94,9 +94,9 @@ <h1>Write components with pure Python code</h1>
9494
</p>
9595
<div class="example-container">
9696
{% with image="write-components-with-python.png", class="pop-left" %}
97-
{% include "home-code-examples/code-block.html" %}
97+
{% include "homepage_examples/code_block.html" %}
9898
{% endwith %}
99-
{% include "home-code-examples/write-components-with-python-demo.html" %}
99+
{% include "homepage_examples/write_components_with_python_demo.html" %}
100100

101101
</div>
102102
</div>
@@ -110,9 +110,9 @@ <h1>Add interactivity wherever you need it</h1>
110110
</p>
111111
<div class="example-container">
112112
{% with image="add-interactivity.png" %}
113-
{% include "home-code-examples/code-block.html" %}
113+
{% include "homepage_examples/code_block.html" %}
114114
{% endwith %}
115-
{% include "home-code-examples/add-interactivity-demo.html" %}
115+
{% include "homepage_examples/add_interactivity_demo.html" %}
116116
</div>
117117
<p>
118118
You don't have to build your whole page in ReactPy. Add React to your existing HTML page, and render

docs/overrides/home-code-examples/add-interactivity.py renamed to docs/overrides/homepage_examples/add_interactivity.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def searchable_video_list(videos):
1818

1919
return html._(
2020
search_input(
21-
{"onChange": lambda new_text: set_search_text(new_text)},
21+
{"onChange": lambda event: set_search_text(event["target"]["value"])},
2222
value=search_text,
2323
),
2424
video_list(

docs/src/learn/add-reactpy-to-a-django-project.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Add `#!python "reactpy_django"` to [`INSTALLED_APPS`](https://docs.djangoproject
2929
=== "settings.py"
3030

3131
```python
32-
{% include "../../examples/python/configure-installed-apps.py" %}
32+
{% include "../../examples/python/configure_installed_apps.py" %}
3333
```
3434

3535
??? warning "Enable ASGI and Django Channels (Required)"
@@ -42,13 +42,13 @@ Add `#!python "reactpy_django"` to [`INSTALLED_APPS`](https://docs.djangoproject
4242
2. Add `#!python "daphne"` to `#!python INSTALLED_APPS`.
4343

4444
```python linenums="0"
45-
{% include "../../examples/python/configure-channels-installed-app.py" %}
45+
{% include "../../examples/python/configure_channels_installed_app.py" %}
4646
```
4747

4848
3. Set your `#!python ASGI_APPLICATION` variable.
4949

5050
```python linenums="0"
51-
{% include "../../examples/python/configure-channels-asgi-app.py" %}
51+
{% include "../../examples/python/configure_channels_asgi_app.py" %}
5252
```
5353

5454
??? info "Configure ReactPy settings (Optional)"
@@ -64,7 +64,7 @@ Add ReactPy HTTP paths to your `#!python urlpatterns` in your [`urls.py`](https:
6464
=== "urls.py"
6565

6666
```python
67-
{% include "../../examples/python/configure-urls.py" %}
67+
{% include "../../examples/python/configure_urls.py" %}
6868
```
6969

7070
## Step 4: Configure `asgi.py`
@@ -74,7 +74,7 @@ Register ReactPy's WebSocket using `#!python REACTPY_WEBSOCKET_ROUTE` in your [`
7474
=== "asgi.py"
7575

7676
```python
77-
{% include "../../examples/python/configure-asgi.py" %}
77+
{% include "../../examples/python/configure_asgi.py" %}
7878
```
7979

8080
??? info "Add `#!python AuthMiddlewareStack` (Optional)"
@@ -88,7 +88,7 @@ Register ReactPy's WebSocket using `#!python REACTPY_WEBSOCKET_ROUTE` in your [`
8888
In these situations will need to ensure you are using `#!python AuthMiddlewareStack`.
8989

9090
```python linenums="0"
91-
{% include "../../examples/python/configure-asgi-middleware.py" start="# start" %}
91+
{% include "../../examples/python/configure_asgi_middleware.py" start="# start" %}
9292
```
9393

9494
??? question "Where is my `asgi.py`?"

docs/src/reference/components.md

+24-24
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ This allows you to embedded any number of client-side PyScript components within
1919
=== "components.py"
2020

2121
```python
22-
{% include "../../examples/python/pyscript-ssr-parent.py" %}
22+
{% include "../../examples/python/pyscript_ssr_parent.py" %}
2323
```
2424

2525
=== "root.py"
2626

2727
```python
28-
{% include "../../examples/python/pyscript-ssr-child.py" %}
28+
{% include "../../examples/python/pyscript_ssr_child.py" %}
2929
```
3030

3131
=== "my_template.html"
3232

3333
```jinja
34-
{% include "../../examples/html/pyscript-ssr-parent.html" %}
34+
{% include "../../examples/html/pyscript_ssr_parent.html" %}
3535
```
3636

3737
??? example "See Interface"
@@ -53,7 +53,7 @@ This allows you to embedded any number of client-side PyScript components within
5353
=== "my_template.html"
5454

5555
```jinja
56-
{% include "../../examples/html/pyscript-setup.html" %}
56+
{% include "../../examples/html/pyscript_setup.html" %}
5757
```
5858

5959
<!--pyscript-setup-required-end-->
@@ -65,19 +65,19 @@ This allows you to embedded any number of client-side PyScript components within
6565
=== "components.py"
6666

6767
```python
68-
{% include "../../examples/python/pyscript-component-multiple-files-root.py" %}
68+
{% include "../../examples/python/pyscript_component_multiple_files_root.py" %}
6969
```
7070

7171
=== "root.py"
7272

7373
```python
74-
{% include "../../examples/python/pyscript-multiple-files-root.py" %}
74+
{% include "../../examples/python/pyscript_multiple_files_root.py" %}
7575
```
7676

7777
=== "child.py"
7878

7979
```python
80-
{% include "../../examples/python/pyscript-multiple-files-child.py" %}
80+
{% include "../../examples/python/pyscript_multiple_files_child.py" %}
8181
```
8282

8383
??? question "How do I display something while the component is loading?"
@@ -89,15 +89,15 @@ This allows you to embedded any number of client-side PyScript components within
8989
=== "components.py"
9090

9191
```python
92-
{% include "../../examples/python/pyscript-component-initial-object.py" %}
92+
{% include "../../examples/python/pyscript_component_initial_object.py" %}
9393
```
9494

9595
However, you can also use a string containing raw HTML.
9696

9797
=== "components.py"
9898

9999
```python
100-
{% include "../../examples/python/pyscript-component-initial-string.py" %}
100+
{% include "../../examples/python/pyscript_component_initial_string.py" %}
101101
```
102102

103103
??? question "Can I use a different name for my root component?"
@@ -107,13 +107,13 @@ This allows you to embedded any number of client-side PyScript components within
107107
=== "components.py"
108108

109109
```python
110-
{% include "../../examples/python/pyscript-component-root.py" %}
110+
{% include "../../examples/python/pyscript_component_root.py" %}
111111
```
112112

113113
=== "main.py"
114114

115115
```python
116-
{% include "../../examples/python/pyscript-root.py" %}
116+
{% include "../../examples/python/pyscript_root.py" %}
117117
```
118118

119119
---
@@ -171,7 +171,7 @@ Compatible with sync or async [Function Based Views](https://docs.djangoproject.
171171
=== "components.py"
172172

173173
```python
174-
{% include "../../examples/python/vtc-cbv.py" %}
174+
{% include "../../examples/python/vtc_cbv.py" %}
175175
```
176176

177177
=== "views.py"
@@ -187,7 +187,7 @@ Compatible with sync or async [Function Based Views](https://docs.djangoproject.
187187
=== "components.py"
188188

189189
```python
190-
{% include "../../examples/python/vtc-args.py" %}
190+
{% include "../../examples/python/vtc_args.py" %}
191191
```
192192

193193
=== "views.py"
@@ -215,7 +215,7 @@ Compatible with sync or async [Function Based Views](https://docs.djangoproject.
215215
=== "components.py"
216216

217217
```python
218-
{% include "../../examples/python/vtc-strict-parsing.py" %}
218+
{% include "../../examples/python/vtc_strict_parsing.py" %}
219219
```
220220

221221
=== "views.py"
@@ -237,7 +237,7 @@ Compatible with sync or async [Function Based Views](https://docs.djangoproject.
237237
=== "components.py"
238238

239239
```python
240-
{% include "../../examples/python/vtc-transforms.py" %}
240+
{% include "../../examples/python/vtc_transforms.py" %}
241241
```
242242

243243
=== "views.py"
@@ -308,7 +308,7 @@ Compatible with sync or async [Function Based Views](https://docs.djangoproject.
308308
=== "components.py"
309309

310310
```python
311-
{% include "../../examples/python/vti-cbv.py" %}
311+
{% include "../../examples/python/vti_cbv.py" %}
312312
```
313313

314314
=== "views.py"
@@ -332,7 +332,7 @@ Compatible with sync or async [Function Based Views](https://docs.djangoproject.
332332
=== "components.py"
333333

334334
```python
335-
{% include "../../examples/python/vti-args.py" %}
335+
{% include "../../examples/python/vti_args.py" %}
336336
```
337337

338338
=== "views.py"
@@ -364,7 +364,7 @@ Compatible with sync or async [Function Based Views](https://docs.djangoproject.
364364
=== "components.py"
365365

366366
```python
367-
{% include "../../examples/python/vti-extra-props.py" %}
367+
{% include "../../examples/python/vti_extra_props.py" %}
368368
```
369369

370370
=== "views.py"
@@ -388,7 +388,7 @@ Allows you to defer loading a CSS stylesheet until a component begins rendering.
388388
=== "components.py"
389389

390390
```python
391-
{% include "../../examples/python/django-css.py" %}
391+
{% include "../../examples/python/django_css.py" %}
392392
```
393393

394394
??? example "See Interface"
@@ -413,7 +413,7 @@ Allows you to defer loading a CSS stylesheet until a component begins rendering.
413413
Here's an example on what you should avoid doing for Django static files:
414414

415415
```python
416-
{% include "../../examples/python/django-css-local-link.py" %}
416+
{% include "../../examples/python/django_css_local_link.py" %}
417417
```
418418

419419
??? question "How do I load external CSS?"
@@ -423,7 +423,7 @@ Allows you to defer loading a CSS stylesheet until a component begins rendering.
423423
For external CSS, you should use `#!python html.link`.
424424

425425
```python
426-
{% include "../../examples/python/django-css-external-link.py" %}
426+
{% include "../../examples/python/django_css_external_link.py" %}
427427
```
428428

429429
??? question "Why not load my CSS in `#!html <head>`?"
@@ -450,7 +450,7 @@ Be mindful of load order! If your JavaScript relies on the component existing on
450450
=== "components.py"
451451

452452
```python
453-
{% include "../../examples/python/django-js.py" %}
453+
{% include "../../examples/python/django_js.py" %}
454454
```
455455

456456
??? example "See Interface"
@@ -475,7 +475,7 @@ Be mindful of load order! If your JavaScript relies on the component existing on
475475
Here's an example on what you should avoid doing for Django static files:
476476

477477
```python
478-
{% include "../../examples/python/django-js-local-script.py" %}
478+
{% include "../../examples/python/django_js_local_script.py" %}
479479
```
480480

481481
??? question "How do I load external JS?"
@@ -485,7 +485,7 @@ Be mindful of load order! If your JavaScript relies on the component existing on
485485
For external JavaScript, you should use `#!python html.script`.
486486

487487
```python
488-
{% include "../../examples/python/django-js-remote-script.py" %}
488+
{% include "../../examples/python/django_js_remote_script.py" %}
489489
```
490490

491491
??? question "Why not load my JS in `#!html <head>`?"

docs/src/reference/decorators.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ This only works with ReactPy components, and is inspired by Django's [`user_pass
1717
=== "components.py"
1818

1919
```python
20-
{% include "../../examples/python/user-passes-test.py" %}
20+
{% include "../../examples/python/user_passes_test.py" %}
2121
```
2222

2323
??? example "See Interface"
@@ -42,7 +42,7 @@ This only works with ReactPy components, and is inspired by Django's [`user_pass
4242
=== "components.py"
4343

4444
```python
45-
{% include "../../examples/python/user-passes-test-component-fallback.py" %}
45+
{% include "../../examples/python/user_passes_test_component_fallback.py" %}
4646
```
4747

4848
??? question "How do I render a simple `#!python reactpy.html` snippet if the test fails?"
@@ -52,5 +52,5 @@ This only works with ReactPy components, and is inspired by Django's [`user_pass
5252
=== "components.py"
5353

5454
```python
55-
{% include "../../examples/python/user-passes-test-vdom-fallback.py" %}
55+
{% include "../../examples/python/user_passes_test_vdom_fallback.py" %}
5656
```

0 commit comments

Comments
 (0)