Skip to content

Commit

Permalink
Cleaner hyperlinks to local files
Browse files Browse the repository at this point in the history
  • Loading branch information
Archmonger committed Dec 2, 2024
1 parent 4527e9f commit 9ecfb19
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion docs/src/learn/your-first-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Components are one of the core concepts of ReactPy. They are the foundation upon

!!! abstract "Note"

If you have reached this point, you should have already [installed ReactPy-Django](../learn/add-reactpy-to-a-django-project.md) through the previous steps.
If you have reached this point, you should have already [installed ReactPy-Django](./add-reactpy-to-a-django-project.md) through the previous steps.

---

Expand Down
8 changes: 4 additions & 4 deletions docs/src/reference/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ We supply some pre-designed that components can be used to help simplify develop

This allows you to embedded any number of client-side PyScript components within traditional ReactPy components.

{% include-markdown "../reference/template-tag.md" start="<!--pyscript-def-start-->" end="<!--pyscript-def-end-->" %}
{% include-markdown "./template-tag.md" start="<!--pyscript-def-start-->" end="<!--pyscript-def-end-->" %}

{% include-markdown "../reference/template-tag.md" start="<!--pyscript-raw-text-start-->" end="<!--pyscript-raw-text-end-->" %}
{% include-markdown "./template-tag.md" start="<!--pyscript-raw-text-start-->" end="<!--pyscript-raw-text-end-->" %}

=== "components.py"

Expand Down Expand Up @@ -58,9 +58,9 @@ This allows you to embedded any number of client-side PyScript components within

<!--pyscript-setup-required-end-->

{% include-markdown "../reference/template-tag.md" start="<!--pyscript-js-exec-start-->" end="<!--pyscript-js-exec-end-->" %}
{% include-markdown "./template-tag.md" start="<!--pyscript-js-exec-start-->" end="<!--pyscript-js-exec-end-->" %}

{% include-markdown "../reference/template-tag.md" start="<!--pyscript-multifile-start-->" end="<!--pyscript-multifile-end-->" trailing-newlines=false preserve-includer-indent=false %}
{% include-markdown "./template-tag.md" start="<!--pyscript-multifile-start-->" end="<!--pyscript-multifile-end-->" trailing-newlines=false preserve-includer-indent=false %}

=== "components.py"

Expand Down
4 changes: 2 additions & 2 deletions docs/src/reference/hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Prefabricated hooks can be used within your `components.py` to help simplify dev

Execute functions in the background and return the result, typically to [read](https://www.sumologic.com/glossary/crud/) data from the Django ORM.

The [default postprocessor](../reference/utils.md#django-query-postprocessor) expects your query function to `#!python return` a Django `#!python Model` or `#!python QuerySet`. This needs to be changed or disabled to execute other types of queries.
The [default postprocessor](./utils.md#django-query-postprocessor) expects your query function to `#!python return` a Django `#!python Model` or `#!python QuerySet`. This needs [to be changed](./settings.md#reactpy_default_query_postprocessor) or disabled to execute other types of queries.

Query functions can be sync or async.

Expand Down Expand Up @@ -157,7 +157,7 @@ Query functions can be sync or async.

This design decision was based on [Apollo's `#!javascript useQuery` hook](https://www.apollographql.com/docs/react/data/queries/), but ultimately helps avoid Django's `#!python SynchronousOnlyOperation` exceptions.

With the `#!python Model` or `#!python QuerySet` your function returns, this hook uses the [default postprocessor](../reference/utils.md#django-query-postprocessor) to ensure that all [deferred](https://docs.djangoproject.com/en/stable/ref/models/instances/#django.db.models.Model.get_deferred_fields) or [lazy](https://docs.djangoproject.com/en/stable/topics/db/queries/#querysets-are-lazy) fields are executed.
With the `#!python Model` or `#!python QuerySet` your function returns, this hook uses the [default postprocessor](./utils.md#django-query-postprocessor) to ensure that all [deferred](https://docs.djangoproject.com/en/stable/ref/models/instances/#django.db.models.Model.get_deferred_fields) or [lazy](https://docs.djangoproject.com/en/stable/topics/db/queries/#querysets-are-lazy) fields are executed.

---

Expand Down
2 changes: 1 addition & 1 deletion docs/src/reference/html.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ The `pyscript` tag functions identically to HTML tags contained within `#!python
{% include "../../examples/html/pyscript_tag.html" %}
```

{% include-markdown "../reference/components.md" start="<!--pyscript-setup-required-start-->" end="<!--pyscript-setup-required-end-->" %}
{% include-markdown "./components.md" start="<!--pyscript-setup-required-start-->" end="<!--pyscript-setup-required-end-->" %}
4 changes: 2 additions & 2 deletions docs/src/reference/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ The default host(s) that can render your ReactPy components.

ReactPy will use these hosts in a round-robin fashion, allowing for easy distributed computing. This is typically useful for self-hosted applications.

You can use the `#!python host` argument in your [template tag](../reference/template-tag.md#component) to manually override this default.
You can use the `#!python host` argument in your [template tag](./template-tag.md#component) to manually override this default.

---

Expand All @@ -164,7 +164,7 @@ During pre-rendering, there are some key differences in behavior:
3. The component will be non-interactive until a WebSocket connection is formed.
4. The component is re-rendered once a WebSocket connection is formed.

You can use the `#!python prerender` argument in your [template tag](../reference/template-tag.md#component) to manually override this default.
You can use the `#!python prerender` argument in your [template tag](./template-tag.md#component) to manually override this default.

---

Expand Down
6 changes: 3 additions & 3 deletions docs/src/reference/template-tag.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Each component loaded via this template tag will receive a dedicated WebSocket c
{% include "../../examples/python/template_tag_bad_view.py" %}
```

_Note: If you decide to not follow this warning, you will need to use the [`register_component`](../reference/utils.md#register-component) function to manually register your components._
_Note: If you decide to not follow this warning, you will need to use the [`register_component`](./utils.md#register-component) function to manually register your components._

<!--context-end-->

Expand Down Expand Up @@ -107,7 +107,7 @@ Each component loaded via this template tag will receive a dedicated WebSocket c

??? question "Can I render components on a different server (distributed computing)?"

Yes! This is most commonly done through [`settings.py:REACTPY_HOSTS`](../reference/settings.md#reactpy_default_hosts). However, you can use the `#!python host` keyword to render components on a specific ASGI server.
Yes! This is most commonly done through [`settings.py:REACTPY_HOSTS`](./settings.md#reactpy_default_hosts). However, you can use the `#!python host` keyword to render components on a specific ASGI server.

=== "my_template.html"

Expand All @@ -127,7 +127,7 @@ Each component loaded via this template tag will receive a dedicated WebSocket c

??? question "How do I pre-render components for SEO compatibility?"

This is most commonly done through [`settings.py:REACTPY_PRERENDER`](../reference/settings.md#reactpy_prerender). However, you can use the `#!python prerender` keyword to pre-render a specific component.
This is most commonly done through [`settings.py:REACTPY_PRERENDER`](./settings.md#reactpy_prerender). However, you can use the `#!python prerender` keyword to pre-render a specific component.

=== "my_template.html"

Expand Down
4 changes: 2 additions & 2 deletions docs/src/reference/utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Utility functions provide various miscellaneous functionality for advanced use c

This function is used register a Django view as a ReactPy `#!python iframe`.

It is mandatory to use this function alongside [`view_to_iframe`](../reference/components.md#view-to-iframe).
It is mandatory to use this function alongside [`view_to_iframe`](./components.md#view-to-iframe).

=== "apps.py"

Expand Down Expand Up @@ -76,7 +76,7 @@ Typically, this function is automatically called on all components contained wit

For security reasons, ReactPy requires all root components to be registered. However, all components contained within Django templates are automatically registered.

This function is commonly needed when you have configured your [`host`](../reference/template-tag.md#component) to a dedicated Django rendering application that doesn't have templates.
This function is commonly needed when you have configured your [`host`](./template-tag.md#component) to a dedicated Django rendering application that doesn't have templates.

---

Expand Down

0 comments on commit 9ecfb19

Please sign in to comment.